The interview playbook
Read first: Back-of-the-envelope estimation, Design a URL shortener
A 45-minute loop is requirements, an estimate, a diagram, one deep dive, and one failure. They grade whether you clarify, whether the numbers are sane, whether the path could serve the request, whether you found the hard part, and whether you can say what you gave up. Practice on this course: redraw from memory, answer the checks, time one case every few days in weeks 9 to 11, and retell one production story in five minutes in week 12.
A 45-minute round has five parts, and the interviewer is grading five habits. Silence while you think is fine. A monologue that never asks what the product needs is a failed opening. The clock below is the one you rehearse. In the room they will move the boundaries, usually by pulling the deep dive forward once they trust the diagram. You notice that only if you had a clock to begin with.
You are Aravinda Kashyap. The loops in front of you run from new-grad through SWE II, on backend systems and on agents. You have an M.S. in computer science from Virginia Tech and a SWE internship at Tesla. The degree means you can follow a mechanism. The internship means you have one true story. The loop does not grade the biography. It grades the five habits in the next section. Use the degree when a mechanism comes up. Use the internship when they ask what you worked on. Do not decorate either one with a number you did not measure.
The 45 minutes
Do the math before you name a product. A back-of-the-envelope estimate is the whole of that advice in this round. The practice clock:
| Minutes | Part | What you put on the board |
|---|---|---|
| 0 to 5 | Requirements | Who the user is, one success path, two non-goals |
| 5 to 10 | Estimate | One rate, with the arithmetic visible, peak labeled as an assumption |
| 10 to 20 | Diagram | The path of one request, and which hop the user waits on |
| 20 to 35 | One deep dive | The hard part they point at, or the one you named and they accepted |
| 35 to 45 | One failure | One of: dependency down, retry storm, hot partition, lost write |
Five plus five plus ten plus fifteen plus ten is the whole forty-five. Write the minute marks in the corner if you are practicing alone. Stop when a mark says stop, including when the diagram is ugly. A finished ugly path beats an unfinished beautiful one, because the grade is on the path and the trade, not on the artwork.
flowchart LR
req[Requirements]
est[Estimate]
diagram[Diagram of one path]
deep[One deep dive]
failure[One failure]
req --> est --> diagram --> deep --> failure
Requirements
Ask who the user is before you draw. In the loops you are heading into, the user is one of three: a person hitting an API, a person sending a message, or an agent calling a tool. Those are different clocks. The person waits on the redirect or the send. The agent waits on a tool that can charge, send, or write, and then the loop may call the tool again.
Ask what must succeed, in one sentence. The short link redirects. The message is in the database before anyone else sees it. The tool’s side effect happens once. Then say two non-goals out loud so you stop designing them. Search, a recommendation model, a second region, and “we might also want analytics” are the usual thieves. A non-goal you did not say will reappear as a box at minute 25.
Estimate
A day is 86,400 seconds. The interview shortcut is about 10^5 seconds, about 100,000. One million requests a day is about 12 per second, because 1,000,000 divided by 86,400 is about 11.6. Use the shortcut in the room and the exact division when you practice, so you remember what the shortcut hides.
One hundred million daily active users with 20 actions each is 2 billion actions a day. Divided by 10^5, that is about 20,000 actions per second on average. A peak of 2x to 5x is an assumption you must state. Pick a multiplier inside that band and write the word assumption next to it. Your Tesla internship does not let you skip the label. If the team never showed you a rate, you do not have a rate. You have this arithmetic.
1 day = 86,400 seconds
shortcut = about 100,000 seconds
1,000,000 / 86,400 = about 11.6 per second, call it 12
100,000,000 users * 20 actions = 2,000,000,000 actions per day
2,000,000,000 / 100,000 = 20,000 per second average
peak, assumption, 3x inside the 2x to 5x band = 60,000 per second
Storage, when they ask, stays in multiples you can defend. Three replicas kept for 30 days is 90 times one day of ingest. Say that. Then say you still need a bytes-per-record assumption before the 90 becomes gigabytes, and either ask for the size or assume one and label it. Do not quote a price. Do not quote a company’s traffic as if you had measured it.
Diagram
One request, from the client to the store and back. Mark the hop the user waits on. Everything the user does not wait on can be slow, retried, and behind. Say which arrows are which. A box with no arrow into the request is a decoration. Delete it.
For a backend loop the honest first drawing is a client, one stateless service, one database, a cache only if a read is hot, and a queue only if the work can leave the user’s clock. For an agent loop, draw the loop once: model, tool call, observation, stop. Then draw the single tool that writes. A step cap goes on the loop. An idempotency key goes on the tool.
One deep dive
They pick it. If they do not, you name the hard part and start, and you let them redirect you. You do not get two deep dives. A second one is how minute 35 arrives with no failure on the board.
For backend questions the hard part is usually one of four: a hot key, a double charge, a cache stampede, or a fanout whose latency is the max. For an agent question the hard part is the tool that touches the world. The model name is not the hard part unless they ask. Evals, a set of tasks with a known outcome, come before prompt tweaks. You can say that in one sentence and then design the tool.
One failure
Pick a failure that fits the diagram you drew. Dependency down, if something on the path can be unreachable. A retry storm, if you already added retries. A hot partition, if you sharded. A lost write, if you acknowledged before the durable store. Do not force a failure that does not fit. Do not kill a second region you never drew.
The same clock on a URL shortener
This is a rehearsal of the URL shortener, not a second design. Say the assumptions as assumptions.
Requirements, minutes 0 to 5. A user creates a short link and later anyone with the code is redirected. Non-goals: custom analytics, editing the target later, and a second region. You said them so they do not grow boxes.
Estimate, minutes 5 to 10. Assume 100 million redirects a day. That number is an assumption you write down, not a measurement.
assumption: 100,000,000 redirects per day
100,000,000 / 100,000 = 1,000 per second average
peak assumption 3x = 3,000 per second
storage: 3 replicas * 30 days = 90 times one day of new links
bytes per link: ask, or assume and label, before you say gigabytes
Diagram, minutes 10 to 20. Create goes to the service and the database. Redirect reads a cache and falls through to the database on a miss. The user waits on the redirect read. Creation can be slower. Six boxes is enough. Stop drawing.
Deep dive, minutes 20 to 35. They will usually point at either the hot code on the read path or the way you generate an id that does not collide. Do the one they point at. A hot code is a cache problem, including the stampede when that key expires. An id is a generation problem. You will want to do both. You have fifteen minutes.
Failure, minutes 35 to 45. The cache is empty and every redirect hits the database, or the database is down and you decide whether a redirect may be served from a stale cache entry. One of those. Say what the user sees.
The same clock on an agent tool
Requirements. The agent may call a tool that sends a message or creates a record. Non-goals: which model, and a second region. The success sentence is that the side effect happens once.
Estimate. Assume a cap of 8 tool calls per task and 20 tasks per second. Both numbers are assumptions.
assumption: 20 tasks per second, cap of 8 tool calls
upper bound = 20 * 8 = 160 tool calls per second
The cap is the product. Without it the loop spends the budget, and the 160 is not an upper bound anymore. Write the cap on the diagram.
Diagram. Model, tool, observation, stop. The tool that writes goes through an idempotency key. The tool has a timeout. If it can touch the world, it runs in a sandbox. Guardrails are allowlists and checks.
Deep dive. The key, the timeout, and what a retry does. This is the agent path that matters. A paragraph in the prompt is not a guardrail.
Failure. The tool succeeded and the process died before the outcome was recorded. A retry would send the message again or create the record again. The shape from the Stripe writeup is the one to describe: record that you are about to make the call, make the call, record that you did. A local database transaction can roll back. The external send cannot. A retry continues from the recovery point.
What they grade
They are grading five things. They are not grading lettering, and they are not grading a product pitch. They are not grading a Paxos proof. You can explain Raft. In this loop you explain it when the question is consensus. Otherwise the sentence is one leader, a replica, and a failover with a fencing token.
| What they grade | What they hear when it is going well | The miss |
|---|---|---|
| Clarifying | You ask who the user is and you name two non-goals | Ten minutes of design, then you learn it is an internal tool |
| Sane numbers | You show that 1 million a day is about 12 per second, and you label the peak | Every tier is described as busy |
| A path that could work | They can point at a box and you can say what it stores | Boxes that the request never enters |
| The hard part | You reach the hot key, the duplicate side effect, or the tool loop | You deepen the load balancer |
| A tradeoff | You say what got worse when you chose this | You say the design is consistent, available, and fast |
Early-career interviewers want a clear path, a number, a bottleneck, and one honest tradeoff. The bottleneck is the hop the user waits on, or the hop that falls over first. Point at it. A tradeoff is a sentence of the form “I gave up X to get Y.” Stale reads, to stay off the primary. A slower send, to persist before broadcast. A tool that will not blindly retry, because the call is not idempotent. Eventual consistency is a choice you state, the way a published system states it, not a word you hope they will not ask about.
On a backend loop, the path they can believe is the small one: client, service, database, and a cache or a queue only for a reason you say. On an agent loop, add the step cap and the key on the mutating tool, and say how you will know the tool did the right thing. That last part is an eval of the tool’s outcome, which is a different question from whether the model’s sentence sounded right.
When they ask about the internship, use the same five grades on your own story. What you clarified with the team. One number you actually saw. The path. The hard part. The trade. If you never got the number, say so, and give the estimate you would make now with the shortcut above. A small true story from the internship beats a blog-post retelling with their peak pasted onto your work. Keep the published peaks on the published systems.
Pitfalls
- Monologue. You talk through a full design before you know whether the product is a person sending a message or an internal agent calling a tool. The symptom is that at minute 8 they ask who it is for, and your boxes are for the wrong user. Ask in the first minute.
- No numbers. Every tier is “horizontally scalable,” and nothing on the board can be divided by 100,000. The symptom is the question “how many per second?” with nowhere to start. Write 86,400, and the shortcut of about 100,000, in the corner before you draw.
- Boxes with no bottleneck. A load balancer, a gateway, several services, a cache, a database, and a queue, and you cannot say which hop the user waits on or which hop breaks first. The symptom is that you pick a box at random when they ask where it hurts. Mark the wait. Delete the box the request does not enter.
- Claiming exactly-once. You say the queue is exactly-once, so a card is charged once or an email is sent once. Exactly-once across a database and a third party is not a property you get from a checkbox. An idempotent producer and transactions give effectively-once processing inside Kafka’s protocol. A charge or an email is outside that protocol. The practical shape is at-least-once delivery plus an idempotent handler, or a recovery point if the side effect has already left your database. The symptom is the follow-up “what does the second POST do?”
- Jumping to microservices. A shortener becomes a handful of deployables that must ship together and fail together, which is a distributed monolith. Split when a team, a scale shape, or a compliance boundary forces it. The symptom is that the deep dive is spent on discovery. For this loop the honest answer is one deployable with a hard boundary inside it, until one of those forces is actually in the problem. That is the service-boundaries answer, and it is the one to draw first.
- Drawing active-active unprompted. Two regions both take writes, and there is no rule for which write wins. Active-active serves writes in more than one region and then has to reconcile. Active-passive fails over and accepts a recovery time. The default in this loop is one region, one primary, and the failover. The symptom is the question “which write wins?” aimed at two arrows and no answer. If they do ask about a region dying, say how much data you can lose and how long you can be down, and keep the writes in one region. Multi-region active-active is the advanced page. A design that says it uses Spanner to get out of the question has not said the directory, the commit wait, or the failover.
How to practice
This course is the plan. Do not add a second syllabus.
After each lesson in weeks 1 through 8, close the page. Redraw the diagram from memory. Answer every check without looking. If a check fails, reread that section only. Rereading the whole page is how you feel busy without finding the hole.
Weeks 9, 10, and 11 are the cases. Run one timed case every few days, on the clock above, on paper, with the lesson closed. You will not clock every case in the catalog. Clock the ones that match the loops, and sketch the rest so the shape is not a surprise.
Week 9, the classic set. Time the URL shortener first, because it is the prerequisite and the cleanest clock. Then time chat, the news feed, and the key-value store. Sketch the rate limiter, unique ids, notifications, and the crawler on a shorter pass. Chat matters because the send path is where you either persist before broadcast or you invent ghost messages. The key-value store matters because ownership, replication, and a hot key show up in almost every backend loop.
Week 10, product systems. Time payments. That is the double-charge question, and it is the one you should be able to do while tired. Sketch video, file sync, nearby search, ride matching, a message queue, and ad click aggregation unless a loop you are actually in is one of those products, in which case you time that one and you still time payments.
Week 11, contention and jobs. Time the job scheduler, because “run this once” is the idempotency question in work clothes. Time the LLM chat service, and time it a second time from a blank page a few days later. The second pass is the one that counts. Sketch metrics, hotel reservation, ticket sales, and the leaderboard. The exchange is advanced. Do it once, off the clock, so a new-grad loop does not turn into a matching-engine hobby.
Rules you do not relax. The lesson stays closed. You stop at the minute mark. The assumption sits next to the number. You end with one sentence, “I gave up X to get Y.” If the run goes badly, you change one thing the next time. The diagram ran long: next time it is six boxes and you stop. You had no failure: next time you write the failure sentence at minute 35 even if you interrupt yourself. You drifted into microservices: next time the first box is one service.
Week 12, one production story a day, five minutes, from a blank page. The shape is the dive shape. The problem. The design. What they traded. What you would steal. What you would not build with five people. Across the week, retell these, because they match the loops you are in: Stripe’s idempotency key and recovery points, Slack’s persist-before-broadcast, Cloudflare’s blast radius and the control plane that rode the data plane, Figma’s server as the authority, and one contrast between Dynamo and Spanner. Dynamo wants the store always writable. Spanner wants commit order to match real time. Five minutes is enough for one of them, or for the contrast in a single sitting, not for both papers recited. The other dives are the same exercise on the days you have left. TAO’s inverse edge and Uber’s refusal to be one system are the two that repay a retelling if your loop is storage-heavy.
The internship story is the same exercise, once, for five minutes. Problem, design, trade, failure. One number you personally saw, or an honest statement that the team did not have that metric. Do not move a published peak onto the internship. Do not move an internship anecdote onto a published system. The listener can tell when a story has two sources.
What you skip on purpose, in the room and in the retelling. A second deep dive. A Paxos walkthrough. An active-active drawing nobody asked for. A microservice split. A product pitch. Any metric you did not derive on the board or read in the source you are retelling. You are an M.S. student, and you will be tempted to spend the fifteen minutes on the mechanism you understand best. Spend them on the hard part of the product they asked about.
Check yourself
You have ten minutes left. The diagram has nine boxes and you have not named a failure. What do you do with the ten minutes?
You stop drawing. You point at the hop the user waits on, you delete or ignore the boxes the request never enters, and you spend the time on one failure that fits the path you already have. Dependency down, a retry storm, a hot partition, or a write you acknowledged too early. A tenth box does not recover the failure you have not said. Nine boxes was already past the diagram’s ten minutes.
They ask how a second POST avoids charging the card twice. What do you say, and which two published patterns are you using?
At-least-once delivery plus an idempotent handler. The client sends an idempotency key. The server stores the key with the outcome and returns the stored outcome on a retry. That is the Stripe pattern, including a fingerprint of the parameters and a lock so two workers do not both run the call. If the charge has already left your database, you use a recovery point: record that you are about to charge, charge, record that you did, and resume from that record. Exactly-once inside a log does not cover the card. Kafka’s guarantee stops at Kafka’s protocol.
They have not mentioned a second region. The database machine dies. What do you draw, and what do you refuse to draw?
One region, one primary, a replica if the commit has to survive the machine, and a failover with a fencing token so the old primary cannot keep writing. You say how much data you can lose and how long you can be down if those are the trade. You refuse an active-active pair of regions, because nobody asked and you would then owe a conflict rule. You refuse the sentence that you will use Spanner. That sentence has not named a directory, a commit wait, or the failover.
An agent tool sends the email, and the process crashes before recording success. Why is claiming the framework is exactly-once the wrong sentence?
Exactly-once across your process and an email provider is not a checkbox, and a framework’s delivery word does not bind the provider. The email already went. A retry sends it again unless you recorded the intention before the send and the result after it, and the retry resumes from that record. The tool needs an idempotency key or that recovery point, a timeout, and a step cap on the loop so a crash-and-retry cycle cannot run without a bound. A line in the prompt does not do any of those.
It is week 12. Give the five-minute outline of Slack's send path using only the published numbers.
The problem is a message on a socket that history does not have, so the send path persists to MySQL before the websocket broadcast. They shard by channel id so a large workspace spreads out, and one hot channel stays one shard. From the Vitess writeup, the migration began in 2017, 99 percent of query load was on Vitess at the time of the post, and they expected to finish by the end of 2020. The peak in that post is 2.3 million queries per second, about 2 million reads and 300,000 writes, median 2 ms, p99 11 ms. Channel servers are in memory, assigned by consistent hash, on the order of 16 million ids per host, and a dead one can be replaced in under 20 seconds with a blip for the channels that moved. You would steal persist-then-broadcast and the channel shard key. You would not start a five-person system on Vitess or on 2.3 million queries per second.
Based on: Alex Xu, ByteByteGo volumes; Marc Brooker, AWS Builders' Library.