Skip to content
About
Main content

Interview questions

Try each one before you open the answer.

Storage devices and object stores

1A benchmark of an NVMe drive rated for 1 million IOPS shows only 12,000. Is the drive faulty?

Probably not: the benchmark is most likely issuing one request at a time ( depth 1). At about 80 µs per request, one request at a time gives 1 / 80 µs = 12,500 . Reaching 1 million needs about 80 requests in flight at once, by . The drive is fast only when it is given parallel work.

Read moreNVMe

2Why are queries over many small Parquet files on S3 slow?

Every request to an object store pays a fixed minimum of 20–100 ms and a per-request fee, however few bytes it returns. A thousand small reads is about 50 seconds of waiting if done one after another. Compact small files into large ones, and read large byte ranges in parallel, so the fixed cost is .

Read moreObject storageFixed cost per operation

3Why is write amplification a problem for write-heavy databases on SSDs, and how do LSM-trees help?

Flash cannot overwrite in place; it erases whole blocks. Small random updates mix data of different ages inside each block, so the drive's must copy the still-live pages elsewhere before erasing, and the drive writes much more than the host asked (). write large files whose contents all age together, so the drive's is close to 1. The cost does not vanish: it moves into the LSM's own .

Read moreWrite amplificationWhy LSM-trees exist

4Why does deleting data not speed up an SSD until TRIM runs?

The drive does not know a file was deleted; only the file system does. Until tells the drive which blocks are free, it treats them as live data, so it stays effectively full and keeps copying them during garbage collection. The slowdown comes from missing information, not from the physics of flash.

Read moreNAND flash (SSDs)

5Why is renaming a folder in S3 not atomic, and how do table formats work around it?

S3 guarantees consistency per object only, and it has no real folders. Renaming a "folder" is N copies and N deletes, and it can stop halfway. Table formats such as Iceberg and Delta never rename: they write new files, then commit by swapping one pointer to a new metadata file in a single atomic step, and make every other step safe to repeat.

Read moreObject storage

6Restoring data from an archive storage class takes 12 hours or more. Tape can be read in minutes. Why the gap?

The delay is the provider's batch-scheduling policy, not the physics of tape. Requests are queued and served in batches so the provider can keep its tape drives and robots fully used; you are paying a low price in exchange for waiting.

Read moreTape and cold tiers

7A vendor claims its storage engine has zero write amplification. How do you evaluate the claim?

Assume the cost was moved, not removed, and ask where it went: extra space, slower reads, background compaction, more memory, or work pushed onto another component or team. Every storage design pays for its writes somewhere; the useful question is which of those you would rather pay.

Read moreCosts are conserved, never removed

8Is sequential access always faster than random access?

No. The advantage is 100–1,000× on a hard disk, 2–10× on an SSD, 5–10× in , and nothing on object storage. What "sequential" really buys is large requests (amortizing the fixed cost) and predictable ones (which can be fetched ahead).

Read moreSequential versus random access

CPU and memory

9Why do analytical databases store data by column?

Memory moves in 64-byte . In a row layout, a query that needs one column out of twenty still drags the other columns through every cache line, about 20× more bytes than it uses. In a column layout every byte fetched is useful, access is sequential so the hardware keeps up, and values of one type next to each other compress much better.

Read moreCache misses dominate scansThe case for columnar storage

10Adding threads made a program slower, although each thread updates only its own counter. Why?

. The counters sit in the same 64-byte cache line, and a cache line is owned by one core at a time, so every update forces the line to move between cores. Pad each counter onto its own cache line, or keep thread-local counters and combine them at the end.

Read moreFalse sharing

11Why can sorting the data before filtering it make the filter loop faster?

Because the branch becomes predictable. On sorted data the filter's condition is false for a long run and then true for a long run, so the CPU's branch predictor is almost always right. On random data it guesses wrong about half the time, and each wrong guess costs 15–20 cycles of discarded work.

Read moreBranch prediction

The network

12Can you run synchronous consensus (Raft or Paxos) across continents for user writes?

Not with acceptable latency. A round trip between continents takes 70–250 ms, and consensus needs one or two round trips per commit, so every write would take hundreds of milliseconds. Keep each within one region, across its availability zones (1–2 ms apart), and replicate between regions asynchronously.

Read moreThe latency tiers

14Why are shuffles so much heavier on the network than their byte count suggests?

A is all-to-all traffic: every machine sends to every other. Data-centre networks are priced and built assuming most traffic stays local, with fewer links higher up (oversubscription), so all-to-all traffic hits the thinnest part of the network. And because many senders reply to one receiver at the same moment, shuffles also trigger .

Read moreBisection bandwidthIncast

15Throughput collapses at about 200 workers while the network is mostly idle. Why?

Incast. When many workers reply to one receiver at the same instant, their packets overflow the switch port's small buffer and some are dropped. Small flows cannot detect the loss quickly and recover only after TCP's retransmission timeout, 200 ms or more, so collapses although average is low. Add jitter to replies, limit fan-out, or use ECN-based such as DCTCP.

Read moreIncast

16A request to S3 in the same region takes 20–100 ms, but a round trip between availability zones is about 1 ms. Where does the time go?

Into the service, not the distance: load balancers, TLS, authentication and metadata lookups each add a step. That is why moving your compute closer to S3 does not reduce the minimum latency; only fewer, larger requests do.

Read moreThe latency tiers

Queues, scaling and tails

17A server's CPU is at 80% and p99 latency is rising. Why, if it is not at 100%?

Because waiting time grows sharply long before 100%. In a simple queue, , where S is the time to serve one request and ρ is utilization. At ρ = 0.8 the average request already takes 5 times its service time, the tail is longer still, and any burst pushes the queue toward the wall.

Read moreUtilization and the queueing wallWhy 80% has already used up the budget

18We doubled the number of servers and total throughput went down. How is that possible?

Coordination between servers can grow with the square of their number, since every pair may need to agree. The models this with a coherence term: past a certain size, each added server costs more in coordination than it contributes in work, and throughput falls. Reduce coordination, for example by sharding or partitioning so that servers rarely need each other.

Read moreUniversal Scalability Law

19Each of 100 backends has a p99 of 100 ms. Why is the user-facing p99 much worse when a request calls all of them?

A request is as slow as its slowest backend. If each backend is slow 1% of the time, a request touching 100 of them meets at least one slow backend with probability . So the user-facing is set by roughly the backends' p99.99. Reduce fan-out, or send a duplicate (hedged) request when one is slow.

Read moreTail at scale

20A Spark job went from 10 minutes to 6 after moving to a cluster 10 times bigger. Why not 1 minute?

Part of the job does not parallelize: planning, the final commit, and waiting for the slowest tasks. By , a serial fraction s limits the speedup to 1 / s however many machines you add. What the bigger cluster does buy is the ability to process about 10 times more data in the same time ().

Read moreAmdahl vs. Gustafson

21A database connection pool has 50 connections, and each query holds one for 100 ms. What is the maximum throughput?

By (concurrency = throughput × time in the system), throughput is at most 50 / 0.1 s = 500 queries per second. Beyond that, requests wait for a connection, and their latency grows.

Read moreLittle's Law

22Why do retries make an outage worse?

Because they feed the queue that caused the timeouts. Timeouts trigger retries, retries raise the arrival rate, a higher arrival rate raises utilization, and higher utilization makes every request slower, so more of them time out. Break the loop with retry budgets, circuit breakers and load shedding.

Read moreWhy 80% has already used up the budget

23What does a garbage collector in a log-structured store cost?

To free a segment it must first move the still-live data out. If a fraction u of each cleaned segment is still live, it moves bytes per byte freed: 1 at u = 0.5, 9 at 0.9, 49 at 0.98. Free space is write amplification bought in advance.

Read moreWhat the collector costs

Why these limits last

24A vendor says its new system is faster. What question do the physical limits let you ask?

Which conserved quantity did it economize, and where did the cost go? Costs are moved, not removed; a claim with no answer to that is marketing. The ratios behind it are diverging (capacity grows faster than bandwidth, bandwidth faster than latency), which pushes every design toward moving less data and computing where the data already is.

Read moreWhy these limits last