Interviewers ask this to check whether your performance claims are real and whether you understand throughput, batching and bottlenecks. Answer with the actual numbers you remember, the context, and what changed. Here is how to structure it. 1. Clarify what "transactions" meant - Business transactions (orders, payments, ledger entries), messages processed, or database rows written? Per day, per batch or per hour? - Example: "About 1.2 million payment reconciliation records arrived daily as files from the bank." 2. Before and after timing - "Initially, processing one million records took about 6 hours as a nightly batch; after optimisation it took around 25 minutes." - Or for online processing: "We handled about 1 million transactions per day, with peaks of around 150 per second." 3. What made the difference (the part interviewers care about most) - Bulk operations instead of row-by-row: SqlBulkCopy or table-valued parameters into staging tables, then set-based MERGE or UPDATE statements, instead of one EF Core SaveChanges per record. - Batching and parallelism: processing in chunks of 5,000–10,000 records with controlled parallelism (Parallel.ForEachAsync with a MaxDegreeOfParallelism, or several queue consumers). - Reduced round trips: loading reference data once into memory or a cache instead of querying for each record. - Indexing and query tuning on lookup and join columns; disabling or deferring non-essential indexes during bulk loads where appropriate. - Streaming input files instead of loading them fully into memory. - Idempotency and checkpoints so a failed batch could resume without reprocessing everything. - Moving work to asynchronous queues and scaling workers horizontally. 4. How you measured - Timing per stage (parsing, validation, database writes), Application Insights or logs, SQL Query Store, and repeated tests with production-sized data. Example answer "For one million records the original job took about five and a half hours, because it validated and saved each record individually through EF Core, with several lookups per record. I changed it to stream the file, validate in batches of 10,000, bulk insert into a staging table with SqlBulkCopy, and apply a set-based MERGE. Reference data was cached in memory. The same volume then completed in about 18 minutes, and the job could resume from the last completed batch." If you are unsure of exact figures, give honest approximations and explain how you would measure them now.
Ravindra Wadile · · 0 likes