ScaleCrafts

System design interview questions

57 problems, from a URL shortener to ride sharing. Draw the architecture, explain your choices, and see how an interviewer would score it.

57 problems
StatusProblemTopicsDifficultyBestLists
Problem of the dayDesign Spotify

Stream songs on demand, build playlists and search a huge catalog, like Spotify.

StreamingCDNSearchMedium
Design a URL shortener

Build a service like bit.ly that turns long URLs into short links and redirects visitors to the original address.

HashingCachingRead-heavyEasy
Design Pastebin

Let users paste text, get a short link and share it, like Pastebin or GitHub Gist.

Object storageCachingRead-heavyEasy
Design a gaming leaderboard

Rank millions of players by score in real time and show each player their position, like a mobile game’s global leaderboard.

Sorted setsCachingReal-timeEasy
Design an image hosting service

Let users upload images, share them by link and view them in several sizes, like Imgur.

Object storageCDNUploadsEasy
Design a parking garage reservation system

Let drivers find and reserve spots in parking garages ahead of time and pay for them.

ReservationsConsistencySQLEasy
Design an online polling app

Let anyone create a poll, share the link and watch votes come in live, like Strawpoll.

CountersQueuesSpikesEasy
Design a view and like counter

Count views and likes on posts and videos at huge scale and show the totals wherever they appear.

CountersBatchingEventual consistencyEasy
Design a weather API

Serve current weather and forecasts for any location to millions of apps, using data bought from upstream providers.

CachingThird-party dataRead-heavyEasy
Design a comment system

Add threaded comments to any web page, with replies, likes and moderation, like Disqus.

ThreadsModerationRead-heavyEasy
Design a website uptime monitor

Check websites every minute from several regions and alert owners the moment one goes down, like UptimeRobot.

SchedulingWorkersAlertsEasy
Design a feature flag service

Let teams turn features on or off and roll them out to a percentage of users without deploying, like LaunchDarkly.

ConfigurationCachingPushEasy
Scenario: the database is at 95% CPU

A product catalogue API runs on one MySQL server. Traffic has grown to 30,000 reads a second, database CPU sits at 95% and p99 latency has climbed from 50 ms to 2 seconds. Bring latency back down, and keep it down as traffic doubles.

ScenarioRead scalingCachingEasy
Design a distributed rate limiter

Limit how many requests each user or API key can make in a time window, across a fleet of servers.

AlgorithmsRedisConsistencyMedium
Design a social news feed

Show each user a timeline of recent posts from the people they follow, like Twitter or Instagram.

Fan-outQueuesCachingMedium
Design Instagram

Share photos and short videos with followers, browse a feed, and like and comment, like Instagram.

MediaFeedsCDNMedium
Design Dropbox

Store files in the cloud and keep them in sync across all of a user’s devices, like Dropbox or Google Drive.

File syncObject storageChunkingMedium
Design Ticketmaster

Sell tickets to concerts and games, with seat maps and huge rushes when popular events go on sale.

ReservationsConsistencySpikesMedium
Design search autocomplete

Suggest the top completions as a user types into a search box, like Google’s autocomplete.

TriesCachingRead-heavyMedium
Design a notification service

Send push, email and SMS notifications for every product team, reliably and at the right time.

QueuesFan-outRetriesMedium
Design a web crawler

Download billions of web pages for a search engine, following links while being polite to every site.

QueuesPolitenessDedupMedium
Design Yelp

Find nearby restaurants and businesses, read reviews and see ratings, like Yelp.

GeospatialSearchRead-heavyMedium
Design a hotel booking system

Search hotels by city and dates, see prices and book rooms, like Booking.com.

ReservationsSearchConsistencyMedium
Design an online coding judge

Let users solve coding problems, submit code in many languages and get it graded against test cases, like LeetCode.

SandboxingQueuesContestsMedium
Design live comments

Show viewers of a live video the comments everyone else is posting, in real time, like Facebook Live or YouTube Live chat.

Real-timePub/subFan-outMedium
Design Reddit

Communities where users post links and text, vote on them and discuss in threaded comments, like Reddit.

RankingVotingCachingMedium
Design a distributed job scheduler

Run millions of one-off and recurring jobs at the right time across a fleet of workers, like a distributed cron.

SchedulingQueuesReliabilityMedium
Design an online auction

Let sellers list items and buyers place bids until the auction closes, with live price updates, like eBay.

Real-timeConsistencyBiddingMedium
Design a price tracker

Track product prices on shopping sites and alert users when a price drops below their target, like CamelCamelCamel.

CrawlingSchedulingAlertsMedium
Design Google Calendar

Create events, invite people, handle recurring meetings and send reminders, like Google Calendar.

SchedulingRecurrenceNotificationsMedium
Design Strava

Record runs and rides with GPS, share them with friends and compete on route segments, like Strava.

Geo dataUploadsLeaderboardsMedium
Design a Q&A site

Let people ask questions, post answers, vote on the best ones and find answers through search, like Stack Overflow.

SearchVotingCachingMedium
Design Spotify

Stream songs on demand, build playlists and search a huge catalog, like Spotify.

StreamingCDNSearchMedium
Design an e-commerce checkout

Let shoppers add items to a cart, check out and pay, while keeping stock counts right during big sales, like Amazon.

InventoryPaymentsConsistencyMedium
Design Google News

Collect articles from thousands of publishers, group stories about the same event and show each reader a personalized front page.

IngestionClusteringPersonalizationMedium
Scenario: a slow payment provider takes the site down

Checkout calls a third-party payment provider. During the evening peak its responses slow from 200 ms to 30 seconds. Requests pile up waiting on it, and within minutes even browsing and search stop responding. Redesign so one slow dependency can’t take the whole site down.

ScenarioResiliencePaymentsMedium
Design a real-time chat app

Build one-to-one and group messaging with delivery receipts and online status, like WhatsApp.

WebSocketsOrderingPresenceHard
Design YouTube

Upload videos, process them into many formats and stream them to a global audience, like YouTube.

VideoTranscodingCDNHard
Design Uber

Match riders with nearby drivers in real time, track trips live and handle payments, like Uber or Lyft.

GeospatialReal-timeMatchingHard
Design Google Docs

Let many people edit the same document at once and see each other’s changes and cursors live, like Google Docs.

CollaborationOT / CRDTReal-timeHard
Design a distributed key-value store

Build a highly available key-value database that spreads data across many machines, like DynamoDB or Cassandra.

ReplicationPartitioningConsistencyHard
Design a payment system

Accept card payments for online merchants, move money correctly and never charge anyone twice, like Stripe.

PaymentsIdempotencyLedgerHard
Design Google Maps

Show map tiles, search places and compute driving routes with live traffic, like Google Maps.

GraphsMap tilesGeospatialHard
Design Zoom

Host video meetings with many participants, screen sharing and chat, like Zoom or Google Meet.

WebRTCMedia serversLow latencyHard
Design a web search engine

Crawl the web, build an index and return the most relevant pages for any query in a fraction of a second, like Google Search.

Inverted indexRankingCrawlingHard
Design an ad click aggregator

Count billions of ad clicks in near real time so advertisers see results and are billed accurately.

StreamingAggregationExactly-onceHard
Design a distributed message queue

Build a durable, high-throughput message broker that many producers and consumers share, like Kafka.

LogsReplicationPartitioningHard
Design a stock exchange

Accept buy and sell orders, match them fairly in microseconds and publish trades to the market, like NASDAQ.

Low latencyMatching engineOrderingHard
Design DoorDash

Let customers order from local restaurants and send couriers to deliver it, with live tracking, like DoorDash.

DispatchGeospatialReal-timeHard
Design a metrics monitoring system

Collect metrics from millions of servers, store them as time series, draw dashboards and fire alerts, like Datadog or Prometheus.

Time seriesIngestionAlertingHard
Design Gmail

Send, receive, store and search email for hundreds of millions of users, with spam filtering, like Gmail.

StorageSearchSpamHard
Design a real-time multiplayer game backend

Match players into game sessions and keep everyone’s game state in sync with very low latency, like Fortnite.

Real-timeNetcodeMatchmakingHard
Design trending topics (top K)

Find the top trending hashtags or videos over the last minute, hour and day from a firehose of events, like Twitter Trends.

StreamingApproximationTop KHard
Design a recommendation system

Recommend products or videos each user is likely to want, from a catalog of millions, like Amazon’s “customers also bought” or Netflix’s home page.

Machine learningBatch + streamingRankingHard
Design a content delivery network

Serve websites, images and video from servers close to users all over the world, like Cloudflare or Akamai.

Edge cachingDNSNetworkingHard
Design an object storage service

Store and retrieve any amount of data as objects in buckets with extreme durability, like Amazon S3.

DurabilityErasure codingMetadataHard
Design Twitch

Let creators stream live video to millions of viewers with low delay and live chat, like Twitch.

Live videoTranscodingChatHard
Scenario: a flash sale brings 10,000 requests a second

An online store’s traffic is usually a fiftieth of what it’s about to get. At noon a flash sale opens on 5,000 discounted phones and traffic jumps to 10,000 requests a second for 30 minutes. Every shopper must get an answer, not one phone may be oversold, and the rest of the store must keep working.

ScenarioTraffic spikesInventoryHard