Skip to content
System Designer

System design interview preparation

System design interview questions

Explore six system design interview questions with real game requirements, clarification answers and design decisions. Play each matching problem.

Play the matching problem

Start by asking what success means

Use these six game scenarios to practise asking questions before drawing an architecture. Each has a different user promise. A redirect should be quick, a message must survive a retry and a room must not be sold twice. Read the clarification answers, explain the mechanism that protects the promise and predict a failure you can test.

The answers below come from the matching game problems. They set the scope for each exercise. Use the linked full briefs for scale, request mix, budget and response targets. Keep those quantities in your estimate so the discussion has a concrete workload.

URL shortener

People paste a long web address and get back a short one. Millions of other people then tap that short link, so reading is almost everything. Keep every tap fast, and never lose a link.

Can a short link change after it is made?

No. A link never changes once created, so saved answers never go out of date and caching is safe.

How many people tap a link compared with people who make one?

About 99 taps for every 1 new link. This is a read-heavy system.

What to explain

Separate creating a link from following one. Explain where a new mapping is saved before success is returned, then estimate how many redirects reach storage after caching. Test a cold cache as well as a warm one. Immutability makes cached answers useful, but it does not remove the need for durable originals.

Play this interview problem or read its full requirements.

Rate limiter for a public API

Developers call your public API from scripts and apps. A few misbehaving or malicious clients can crowd out everyone else. Build limits that are fair, fast and cheap, and that survive a retry storm.

What should an over-limit client see?

A quick, polite "429 slow down" with a hint when to try again. It must be faster than a normal answer.

Is the limit per person or per key?

Per API key. One customer may have many servers sharing one key.

What to explain

Follow two simultaneous requests using the same customer key. Explain how the allowance is checked and spent without both requests using the same remaining token. Then describe the response when the counter store cannot answer. Tie that outage choice to the downstream work you are protecting.

Play this interview problem or read its full requirements.

One-to-one chat

People send short messages to each other from their phones. A message must arrive once, in order, even when the phone is on a bad connection and sends it again. If the other person is offline, the message waits and a notification goes out.

What if the phone loses signal mid-send?

The app retries. The message must still arrive exactly once.

What if the other person is offline?

Save the message and send a push notification. They get it when they open the app.

What to explain

Trace a message that was stored just before the sender lost its connection. Give the retry a stable identity and explain where the server keeps its previous outcome. Then follow an offline recipient catching up. Open connections, durable history and duplicate protection have different jobs.

Play this interview problem or read its full requirements.

Notification service

Every other team asks you to send messages: order shipped, new login, a sale starting. You send them by push, email and text through outside providers who have their own limits. Send each message once, and never block the team that asked.

Does the sender wait until the message is delivered?

No. They only need to know it was accepted. Delivery happens afterwards.

What if the same message is asked for twice?

Send it only once. A double "your card was charged" text is a bad day.

What to explain

Trace acceptance by your API separately from a provider accepting the send. Explain how workers respect the provider quota and how long a message may wait. For a lost provider reply, state what support is needed to avoid sending twice. More workers alone do not resolve an unknown outcome.

Play this interview problem or read its full requirements.

Social feed

Every person opens the app and sees a feed of posts from the people they follow. Most people have a few hundred followers, but a few have millions, and when they post, millions of feeds must change. The feed must be fast and your own post must show up at once.

Must the feed be perfectly fresh?

A few seconds behind is fine, except for your own posts, which must show at once.

How many followers does a typical account have?

About 200. A few thousand accounts have over a million.

What to explain

Estimate the work caused by a post from an ordinary account and from an account with a million followers. Compare preparing followers’ feeds in advance with assembling them when read. Keep the original post durable and explain how its author sees it before background fanout has finished.

Play this interview problem or read its full requirements.

Hotel booking

You run a hotel booking site. People search for rooms, open hotel pages and book. Search can be a little behind, but you must never sell the last room twice. Bots copy your prices all day, and sometimes the payment company slows down.

Can search results be a little stale?

Yes, by a minute or so. A result that says "2 rooms left" may be out of date.

Can the final booking be stale?

No. The booking step must check the real count, so the last room is never sold twice.

What to explain

Separate searching for a room from committing a booking. A cached search result can help someone browse, but the final write must protect the remaining inventory. Walk through two customers trying to book the last room and one customer retrying after losing the confirmation reply.

Play this interview problem or read its full requirements.

Turn an answer into an experiment

Choose one scenario and write down the first bottleneck you expect. Build a baseline, run a whole traffic day and compare the result with your prediction. Change one decision and run the same workload again. Use the debrief for capacity, response time, safety and cost, and trace retries and crashes separately in your explanation.

Follow the full system design practice loop or plan a sequence of interview practice sessions.

Playing on systemdesigner.io needs a free Google or GitHub account. These pages, the lessons and the guides can be read without one. Figures in the game are teaching approximations.

More interview practice