System design interview questions

31 questions, easy to hard. Read one, then answer it out loud: an AI interviewer follows up, hints when you're stuck and grades your answer.

System design interviews ask you to design a real service out loud: requirements, data, scaling, caching, reliability and the trade-offs between them.

System Design

  1. Design a service that turns long web addresses into short links, like a link shortener, and redirects anyone who opens a short link to the original address. Walk through the main parts, how you'd generate the short codes, and how you'd store and look them up.

    What a strong answer covers
    • The questions you'd ask before designing, including a rough sense of scale.
    • The handful of components involved and how a short link turns into a redirect.
    • How short codes are produced, how unique they stay and how many a given length can hold.
    • Why the read-to-write balance shapes storage and caching choices.

    Common mistake: Diving into databases and code formats before agreeing what the service must do and how busy it will be.

  2. Before designing a photo-sharing app, your interviewer asks for a rough estimate: ten million daily users, each viewing about fifty photos and uploading one photo a week. Talk through a back-of-the-envelope estimate of requests per second and storage per year.

    What a strong answer covers
    • Clear, rounded assumptions stated out loud before any arithmetic.
    • Turning daily figures into a per-second rate, then allowing for busy periods.
    • A yearly storage figure built from uploads and a typical file size.
    • What the numbers mean for the design, not just the numbers themselves.

    Common mistake: Chasing precise arithmetic instead of rounding boldly and saying what the estimate implies.

  3. Add a Cache
    • medium
    • Pro

    A product page is slow because every visit runs several database queries, and the database is near its limit at peak times. Explain how you'd add caching, what you'd cache and where, and how you'd keep users from seeing stale or wrong data.

    What a strong answer covers
    • Which data is a good candidate for caching and which should always be read fresh.
    • Where the cache sits and how the application uses it.
    • How cached data is kept fresh enough when the source changes.
    • What can go wrong under heavy load and how to soften it.

    Common mistake: Caching everything on the page, including data that must always be accurate, with no plan for when it changes.

  4. Your public API is being overloaded by a few clients sending far too many requests. Design a rate limiter that allows each API key, say, a hundred requests per minute across all of your servers. Explain the algorithm, where it runs, and what the client sees when they're limited.

    What a strong answer covers
    • A comparison of a few counting approaches and how each copes with bursts.
    • How the limit is enforced consistently when many servers share the traffic.
    • Where the limiter lives and what it does if its own storage fails.
    • What a limited client receives so it knows how to behave.

    Common mistake: Keeping a separate count on each server, so a client spread across servers gets far more than its limit.

  5. Users of your app need to upload videos of up to two gigabytes, and uploads through your web servers keep timing out and using all their memory. Design an upload flow that copes with large files and unreliable connections.

    What a strong answer covers
    • Keeping large file transfers away from the application servers.
    • Making uploads survive a dropped connection without starting again.
    • How the app tracks each file's state and learns an upload is complete.
    • What happens to a file after it lands and how it reaches viewers.

    Common mistake: Improving the web servers' timeouts and memory instead of questioning whether the bytes should pass through them at all.

  6. Many teams in your company want to send users emails, text messages and push notifications. Design one shared notification service that respects user preferences, doesn't spam people, and keeps working when a provider is down.

    What a strong answer covers
    • How other teams hand over messages without waiting for them to be sent.
    • Respecting each user's choices and keeping message content consistent.
    • Staying useful when an outside provider fails.
    • Guarding against duplicate or excessive messages and knowing what was delivered.

    Common mistake: Designing only the happy path of sending, with no thought for opt-outs, repeats or a provider outage.

  7. A mobile game with five million players wants a live global leaderboard showing the top one hundred and each player's own rank, updated as soon as a game ends. Design how you'd store scores and answer these queries quickly.

    What a strong answer covers
    • Why a straightforward database query struggles at this size.
    • A data structure that keeps players ordered as scores change.
    • How scores survive if the fast store is lost.
    • Extras such as ties, time-boxed boards and growing beyond one machine.

    Common mistake: Proposing a fast in-memory store with no durable copy, so a restart wipes every score.

  8. Your web app does slow work inside requests, like resizing images and generating invoices, so pages hang. Design a background job system that moves this work out of the request, retries failures and never loses a job.

    What a strong answer covers
    • How slow work leaves the request and who picks it up.
    • How a job survives a worker crashing partway through.
    • Why a job might run more than once and how to make that harmless.
    • Handling jobs that keep failing and knowing when to add workers.

    Common mistake: Assuming each job runs exactly once, so a retry sends a second invoice or does the work twice.

  9. Design the back end of a chat app with one-to-one and group conversations, where messages appear instantly for people who are online and are waiting for people when they come back. Explain how messages travel, how you store them, and how you'd scale to millions of users.

    What a strong answer covers
    • How messages reach online users the moment they're sent.
    • How messages cross between servers and wait for people who are offline.
    • How messages are stored and kept in order at high volume.
    • Reliability and scale concerns, including large groups and presence.

    Common mistake: Having clients poll the server every second, which wastes resources and still feels slow.

  10. Design the home feed of a social network, where each user sees recent posts from the people they follow. Some users follow hundreds of people, and some celebrities have tens of millions of followers. Explain how feeds are built and served quickly.

    What a strong answer covers
    • The two broad moments when a feed could be assembled, and the cost of each.
    • Why accounts with huge followings break the simple approach, and a way around it.
    • What is actually stored per user and how the client pages through it.
    • Ordering, deleted posts and doing heavy work in the background.

    Common mistake: Picking one approach for everyone and never noticing what happens when a celebrity posts.

  11. Design the suggestions that appear as you type into a search box on a large website, showing the most popular matching searches within a fraction of a second. Explain how suggestions are stored, looked up, and kept up to date.

    What a strong answer covers
    • A way to find matching suggestions for a prefix very quickly.
    • Doing the expensive ranking ahead of time rather than per keystroke.
    • How suggestions are refreshed and kept appropriate.
    • Cutting latency and load on both the client and the servers.

    Common mistake: Running a full ranked search on every keystroke, which cannot answer fast enough at scale.

  12. Design the part of a ride-hailing app that tracks drivers' locations every few seconds and finds the nearest available drivers when a rider requests a trip. Explain how you'd store locations, search nearby, and avoid giving one driver two trips.

    What a strong answer covers
    • A sense of how many location updates arrive and where they should live.
    • A way to find nearby drivers without scanning every one.
    • How to make sure one driver never gets two trips at once.
    • Splitting the system by area and keeping trip records separately.

    Common mistake: Storing every location ping in a regular database table and searching it by distance each time.

Reliability and Scaling

  1. Your web app's single server is running out of capacity as traffic grows. Explain the difference between scaling vertically and scaling horizontally, and the pros and cons of each.

    What a strong answer covers
    • What each kind of scaling means in plain terms.
    • The strengths and limits of making one machine bigger.
    • What has to be true of the app before adding more machines works.
    • Why some parts of a system are harder to spread out than others.

    Common mistake: Treating adding more servers as automatically better, without mentioning what the app must change to support it.

  2. You now run four copies of your web server. Explain what a load balancer does, a few ways it can choose which server gets each request, and what happens when one server crashes.

    What a strong answer covers
    • What a load balancer does and where it sits.
    • A few ways it can decide which server gets each request.
    • How it notices a failed server and stops using it.
    • A further consideration, such as session affinity or keeping the balancer itself available.

    Common mistake: Describing how requests are shared out but not what happens when one of the servers dies.

  3. After adding a second server behind a load balancer, users are randomly logged out and lose their shopping baskets. Explain why, what stateless services are, and how you'd fix it.

    What a strong answer covers
    • Why the symptoms appeared only after a second server was added.
    • What it means for a service to hold no user state between requests.
    • Where that state can live instead.
    • What the team gains once any server can handle any request.

    Common mistake: Reaching for sticky sessions as the fix, which hides the problem until a server restarts.

  4. When your recommendations service gets slow, the product pages that call it also hang, and then automatic retries make the slow service even slower. Explain how to use timeouts and retries properly.

    What a strong answer covers
    • Why every call to another service needs a limit on how long to wait.
    • Which failures are worth trying again and which are not.
    • How to space retries so they don't pile up together.
    • How retries at several layers can multiply load.

    Common mistake: Adding more retries to cope with a slow service, which only makes it slower.

  5. Your checkout calls a fraud-check service, which is completely down for twenty minutes. Every checkout waits for a timeout and then fails. Explain how a circuit breaker works and how it would help here.

    What a strong answer covers
    • The breaker's normal state and what it watches.
    • When and why it stops calling the failing service.
    • How it decides the service is healthy again.
    • What checkout could do while the dependency is unavailable.

    Common mistake: Describing only the open and closed states, with no way for the breaker to ever let traffic back through.

  6. Your news site's home page combines articles, personalised recommendations, comments counts and the weather. When any one of these fails, the whole page shows an error. Explain how you'd design the page to degrade gracefully.

    What a strong answer covers
    • Which parts of the page are essential and which are extras.
    • Containing each extra so its failure stays in its own corner.
    • What each section shows when its data isn't available.
    • Related techniques for protecting shared resources under strain.

    Common mistake: Wrapping calls in error handling but still waiting on a slow dependency, so the whole page hangs anyway.

  7. Users report that checkout is sometimes slow, but your team has no idea which of the eight services involved is to blame. Explain logs, metrics and distributed traces, and how you'd use them to find the problem.

    What a strong answer covers
    • What metrics are and what they're best at.
    • What logs add and how to make them searchable.
    • How traces follow one request across many services.
    • How the three combine to pinpoint the slow service and the reason.

    Common mistake: Defining the three terms well but never explaining how you'd actually use them to find this problem.

  8. Your product team wants to ship features fast, and the operations team wants fewer outages, and they argue constantly. Explain service level indicators, objectives and error budgets, and how they can settle this argument.

    What a strong answer covers
    • What you'd measure to reflect what users actually experience.
    • How a reliability target over a time window is set.
    • How that target translates into an allowance for failure.
    • How the allowance turns arguments into an agreed rule for shipping versus fixing.

    Common mistake: Aiming for perfect reliability, which leaves no room to ship and makes the budget meaningless.

  9. Your app runs on two web servers behind one load balancer, with one database, one Redis cache, all in a single data centre. Walk through the single points of failure and how you'd remove each, and what that costs.

    What a strong answer covers
    • A component-by-component check for anything whose loss takes the site down.
    • A way to add redundancy for each weak point.
    • Spreading across separate locations, and the extra cost and latency that brings.
    • Matching effort to the reliability target and proving that failover works.

    Common mistake: Doubling the web servers but leaving the database, cache or data centre as the single thing everything depends on.

  10. Your ticketing site expects fifty times its normal traffic in the first minute that tickets for a huge concert go on sale. Explain how you'd prepare the system so it stays up and sells tickets fairly.

    What a strong answer covers
    • Taking as much load as possible off your own servers before the rush.
    • Preparing capacity in advance rather than relying on it appearing in time.
    • Controlling how many people enter at once while keeping it fair.
    • Protecting the stock so nothing sells twice, and dropping extras at the peak.

    Common mistake: Relying on autoscaling alone, which usually reacts after the first minute is already over.

Data and Databases

  1. A teammate wants to use a document database for your new online shop because it's more modern. Explain the main differences between relational and NoSQL databases, and how you'd decide which fits this shop.

    What a strong answer covers
    • What relational databases offer in structure and consistency.
    • The main kinds of NoSQL store and what they're good at.
    • Choosing by how the data is read, written and kept consistent, not by trend.
    • A clear recommendation for this shop, with a reason.

    Common mistake: Choosing on novelty or speed claims without asking what the shop's data and transactions actually need.

  2. Looking up a customer by email takes several seconds now that your users table has five million rows. Explain what a database index is, how it speeds this up, and what it costs.

    What a strong answer covers
    • Why the lookup is slow without any help.
    • What an index is and how it finds a row quickly.
    • What an index costs in space and in write speed.
    • How to decide which columns deserve one and how to check it's used.

    Common mistake: Suggesting an index on every column, ignoring that each one slows down every write.

  3. A bank transfer takes money from one account and adds it to another, and once the server crashed in between, so the money vanished. Explain what a database transaction is, what ACID stands for, and how it prevents this.

    What a strong answer covers
    • What a transaction is in everyday terms.
    • A one-line meaning for each of the four ACID properties.
    • How a transaction would have stopped the money vanishing.
    • What can go wrong when two transfers touch the same account at once.

    Common mistake: Reciting the four words of ACID without connecting them to the lost transfer.

  4. Your orders table copies the customer's name and address into every order row. A colleague says that's bad design, but another says it makes reports fast. Explain normalisation and denormalisation and when each is right, including for this case.

    What a strong answer covers
    • What normalising data means and the problems it prevents.
    • Why teams sometimes duplicate data on purpose, and the cost of doing so.
    • Whether this particular copy is actually a mistake, given what an order records.
    • A sensible default and when to break from it.

    Common mistake: Declaring either side simply right without asking whether an order should keep the address it was shipped to.

  5. Your blog's home page shows fifty posts with their authors, and the logs show fifty-one database queries for each page view. Explain the N plus one query problem and how you'd fix it.

    What a strong answer covers
    • Where the extra queries come from.
    • Why many small queries are slow even when each is quick.
    • How to fetch the related data in far fewer round trips.
    • How to catch the problem before it reaches users.

    Common mistake: Speeding up each individual query instead of reducing how many are made.

  6. To take load off your database you add read replicas, and soon users complain that after editing their profile, the page still shows the old details. Explain how replication works and how you'd fix this.

    What a strong answer covers
    • How writes and reads are split between a primary and its copies.
    • Why the edited profile looked unchanged.
    • Ways to make sure people see their own changes straight away.
    • Which reads can safely accept slightly old data.

    Common mistake: Concluding that replicas are broken and removing them, rather than routing the reads that must be fresh.

  7. You need to rename a column in a busy production table, and new code is rolled out gradually while old code is still running. Explain why a simple rename would cause errors, and how you'd make the change safely.

    What a strong answer covers
    • Why a direct rename breaks while old and new code run side by side.
    • A staged sequence that changes the schema without a breaking moment.
    • How to fill a large table without locking it for long.
    • Keeping every step safe to roll back.

    Common mistake: Doing the rename and the code change in one deploy, assuming every server switches at the same instant.

  8. Your multi-tenant app's single database can no longer handle the write load, even on the biggest machine available. Explain what sharding is, how you'd choose a shard key, and what gets harder once data is split.

    What a strong answer covers
    • What sharding is and why it spreads write load.
    • How to choose the key that decides where each row lives.
    • Ways of mapping keys to shards and what happens when shards are added.
    • The everyday operations that become harder once data is split.

    Common mistake: Picking a shard key without checking for uneven tenants, so one shard ends up doing most of the work.

  9. Your app stores data in two data centres, and the network link between them sometimes fails. Using the CAP theorem, explain the choice the system faces during such a failure, and which behaviour you'd want for a shopping basket compared with a bank balance.

    What a strong answer covers
    • What the theorem says a system must choose between during a network split.
    • When that choice actually applies, and the trade-off at other times.
    • Which behaviour suits a shopping basket, and why.
    • Which behaviour suits a bank balance, and why.

    Common mistake: Saying a system simply picks two of the three properties all the time, rather than facing a choice when the network splits.

Questions about practising

How should I prepare for system design interview questions?
Practise answering them out loud, not just reading them. Explaining an answer under follow-up questions is what interviews test. Work through the 31 questions here from easy to hard, and revisit the ones you struggle with.
Can I practise system design interview questions with an AI?
Yes. Open any question and start a voice session: an AI interviewer asks it, follows up on your answer, gives hints when you're stuck and grades your answer with written feedback when the call ends.
Are these system design interview questions free?
2 of the 31 questions are free to practise. Sign in with Google, no card needed. Pro unlocks the rest, plus practice calls to your phone.