Sobes.tech

What can be said about the query plan's optimality? MVCC There is a table CREATE TABLE orders ( id BIGSERIAL PRIMARY KEY, status TEXT, updated_at TIMESTAMP ); and a query running every second UPDATE orders SET status = 'processed', updated_at = now() WHERE id = 1; After a few days, you notice: • the table size has grown significantly • the query SELECT * FROM orders WHERE id = 1 runs slower Questions for the candidate: 1. Why does the table grow even though the row is always the same? 2. What role does MVCC play in this situation? 3. What should solve this problem?

Middle+
263

What is IAsyncDisposable?

Middle+
228

Are you familiar with vacuum and vacuum full?

Middle+
207

What will the program output with async/await: main prints A, calls saySomething (static, returns Task), delays 5 seconds, then D?

Middle+
197

Types of transactions / levels of isolation?

Middle+
195

What will the program output if throw is uncommented in the specified places?

Middle+
189

There is another problem with multithreading in the Init method. What is it?

Middle+
186

How to make a class iterable?

Middle+
179

What technology stack was used?

Middle+
176

IMemoryCache — what is it and when to use it?

Middle+
175

Review: application code The class contains logic for processing new orders. It retrieves orders and items from the database, then makes an HTTP call to an external Stock microservice, which reserves goods for the order items. If all reservations are successful, the microservice confirms the reservation in Stock and marks the order as processed. The microservice runs in multiple instances, so the Process method can execute in parallel. To prevent processing the same rows, a pessimistic locking mechanism PostgreSQL Select for update ... skip locked is used. The IBus implementation sends messages to RabbitMq. ```csharp public sealed class PendingOrdersProcessor { public async Task PendingOrdersProcessor(ILogger logger, IBus bus, HttpStockService st { var env = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"); var cs = _cs[env]; _db = new OrdersRepository(cs); _bus = bus; logger = logger; ``` ```csharp _stockService = stockService; } private readonly ILogger _logger; private readonly IOrdersRepository _db; private readonly IStockService _stockService; private readonly IBus _bus; private static readonly Dictionary<string, string> _cs = new { { "Development", "User ID=root;Password=myPassword;Host=localhost;Port=5432;Database=myDataBase" }, { "Production", "User ID=root;Password=myPassword;Host=prod-db;Port=5432;Database= "Pooling=true;Min Pool Size=0;Max Pool Size=1;" } }; ```

Middle+
170

When does closure occur?

Middle+
164

Tell us about your last place of work — Severstal. What did you do, how long did you work there, and what was your tech stack?

Middle+
159

Why can't a struct inherit?

Middle+
157

How much memory does a Date instance occupy in 32-bit and 64-bit systems?

Middle+
154

How to fix it so that it displays 0-9?

Middle+
147

IMemoryCache What are the pros and cons of using IMemoryCache in an application? What is OWASP top 10? Code metrics 1. What code quality metrics do you know? 2. Have you used them? 3. How did you calculate them? 4. Part of CI or adhoc Load What will you do if your service (web page) hangs on the test or load circuit, but locally everything works?

Middle+
147

How do transactions work with versions in MVCC?

Middle+
147

The application with the database works in one environment, but degrades in another. Why?

Middle+
146
/3