Layer 3 · Go deeper · 7 min
Go deeper
Size it, build it, then make the calls an interviewer will push you on.
Back of the envelope
Size it up
Tap through each step of the arithmetic.
How hard does one export hit the database through a shared cache?
How long do other sellers’ OTPs wait behind one festive SMS blast?
Build-up · 6 steps
From one FIFO queue to fair turns
W’s 2-million-job Diwali export, first in one shared queue, then in per-tenant queues behind a fair scheduler. Same 200 workers throughout.
Step 1 of 6
One shared queue, arrival order
Every seller’s jobs share one queue. 200 workers each finish 20 jobs a second, 4,000 in all, comfortably above the other sellers’ 1,500. Capacity decides whether anyone suffers; fairness decides who.
4 interview moments
You’re the candidate
The interviewer pushes on the hard parts. Pick an approach and see how it holds up.
Deep dive 1 of 4
Interviewer
“A seller’s “Export all orders” fans out into 2 million jobs on your shared queue. How do you schedule background work?”
200 workers finish 4,000 jobs a second; the other sellers need 1,500.
Your move. Pick an approach:
Deep dive 2 of 4
Interviewer
“A tenant may send 100 report requests a second, each taking 50 ms. Then the database slows. What protects your threads and connections?”
Your move. Pick an approach:
Deep dive 3 of 4
Interviewer
“Mid-sale, a zone is lost and the system is over capacity. Requests keep coming. What do you drop first?”
Your move. Pick an approach:
Deep dive 4 of 4
Interviewer
“An enterprise tenant is a fifth of its shard’s load. Its limits fire every day, though it pays well. What do you do?”
Your move. Pick an approach: