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.
| Status | Problem | Topics | Difficulty | Best | Lists |
|---|---|---|---|---|---|
| Problem of the dayDesign Spotify Stream songs on demand, build playlists and search a huge catalog, like Spotify. | StreamingCDNSearch | Medium | |||
| 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-heavy | Easy | |||
| Design Pastebin Let users paste text, get a short link and share it, like Pastebin or GitHub Gist. | Object storageCachingRead-heavy | Easy | |||
| 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-time | Easy | |||
| Design an image hosting service Let users upload images, share them by link and view them in several sizes, like Imgur. | Object storageCDNUploads | Easy | |||
| Design a parking garage reservation system Let drivers find and reserve spots in parking garages ahead of time and pay for them. | ReservationsConsistencySQL | Easy | |||
| Design an online polling app Let anyone create a poll, share the link and watch votes come in live, like Strawpoll. | CountersQueuesSpikes | Easy | |||
| 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 consistency | Easy | |||
| 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-heavy | Easy | |||
| Design a comment system Add threaded comments to any web page, with replies, likes and moderation, like Disqus. | ThreadsModerationRead-heavy | Easy | |||
| Design a website uptime monitor Check websites every minute from several regions and alert owners the moment one goes down, like UptimeRobot. | SchedulingWorkersAlerts | Easy | |||
| 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. | ConfigurationCachingPush | Easy | |||
| 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 scalingCaching | Easy | |||
| 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. | AlgorithmsRedisConsistency | Medium | |||
| Design a social news feed Show each user a timeline of recent posts from the people they follow, like Twitter or Instagram. | Fan-outQueuesCaching | Medium | |||
| Design Instagram Share photos and short videos with followers, browse a feed, and like and comment, like Instagram. | MediaFeedsCDN | Medium | |||
| 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 storageChunking | Medium | |||
| Design Ticketmaster Sell tickets to concerts and games, with seat maps and huge rushes when popular events go on sale. | ReservationsConsistencySpikes | Medium | |||
| Design search autocomplete Suggest the top completions as a user types into a search box, like Google’s autocomplete. | TriesCachingRead-heavy | Medium | |||
| Design a notification service Send push, email and SMS notifications for every product team, reliably and at the right time. | QueuesFan-outRetries | Medium | |||
| Design a web crawler Download billions of web pages for a search engine, following links while being polite to every site. | QueuesPolitenessDedup | Medium | |||
| Design Yelp Find nearby restaurants and businesses, read reviews and see ratings, like Yelp. | GeospatialSearchRead-heavy | Medium | |||
| Design a hotel booking system Search hotels by city and dates, see prices and book rooms, like Booking.com. | ReservationsSearchConsistency | Medium | |||
| Design an online coding judge Let users solve coding problems, submit code in many languages and get it graded against test cases, like LeetCode. | SandboxingQueuesContests | Medium | |||
| 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-out | Medium | |||
| Design Reddit Communities where users post links and text, vote on them and discuss in threaded comments, like Reddit. | RankingVotingCaching | Medium | |||
| 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. | SchedulingQueuesReliability | Medium | |||
| Design an online auction Let sellers list items and buyers place bids until the auction closes, with live price updates, like eBay. | Real-timeConsistencyBidding | Medium | |||
| Design a price tracker Track product prices on shopping sites and alert users when a price drops below their target, like CamelCamelCamel. | CrawlingSchedulingAlerts | Medium | |||
| Design Google Calendar Create events, invite people, handle recurring meetings and send reminders, like Google Calendar. | SchedulingRecurrenceNotifications | Medium | |||
| Design Strava Record runs and rides with GPS, share them with friends and compete on route segments, like Strava. | Geo dataUploadsLeaderboards | Medium | |||
| Design a Q&A site Let people ask questions, post answers, vote on the best ones and find answers through search, like Stack Overflow. | SearchVotingCaching | Medium | |||
| Design Spotify Stream songs on demand, build playlists and search a huge catalog, like Spotify. | StreamingCDNSearch | Medium | |||
| 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. | InventoryPaymentsConsistency | Medium | |||
| Design Google News Collect articles from thousands of publishers, group stories about the same event and show each reader a personalized front page. | IngestionClusteringPersonalization | Medium | |||
| 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. | ScenarioResiliencePayments | Medium | |||
| Design a real-time chat app Build one-to-one and group messaging with delivery receipts and online status, like WhatsApp. | WebSocketsOrderingPresence | Hard | |||
| Design YouTube Upload videos, process them into many formats and stream them to a global audience, like YouTube. | VideoTranscodingCDN | Hard | |||
| Design Uber Match riders with nearby drivers in real time, track trips live and handle payments, like Uber or Lyft. | GeospatialReal-timeMatching | Hard | |||
| 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-time | Hard | |||
| Design a distributed key-value store Build a highly available key-value database that spreads data across many machines, like DynamoDB or Cassandra. | ReplicationPartitioningConsistency | Hard | |||
| Design a payment system Accept card payments for online merchants, move money correctly and never charge anyone twice, like Stripe. | PaymentsIdempotencyLedger | Hard | |||
| Design Google Maps Show map tiles, search places and compute driving routes with live traffic, like Google Maps. | GraphsMap tilesGeospatial | Hard | |||
| Design Zoom Host video meetings with many participants, screen sharing and chat, like Zoom or Google Meet. | WebRTCMedia serversLow latency | Hard | |||
| 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 indexRankingCrawling | Hard | |||
| Design an ad click aggregator Count billions of ad clicks in near real time so advertisers see results and are billed accurately. | StreamingAggregationExactly-once | Hard | |||
| Design a distributed message queue Build a durable, high-throughput message broker that many producers and consumers share, like Kafka. | LogsReplicationPartitioning | Hard | |||
| Design a stock exchange Accept buy and sell orders, match them fairly in microseconds and publish trades to the market, like NASDAQ. | Low latencyMatching engineOrdering | Hard | |||
| Design DoorDash Let customers order from local restaurants and send couriers to deliver it, with live tracking, like DoorDash. | DispatchGeospatialReal-time | Hard | |||
| 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 seriesIngestionAlerting | Hard | |||
| Design Gmail Send, receive, store and search email for hundreds of millions of users, with spam filtering, like Gmail. | StorageSearchSpam | Hard | |||
| 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-timeNetcodeMatchmaking | Hard | |||
| 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 K | Hard | |||
| 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 + streamingRanking | Hard | |||
| Design a content delivery network Serve websites, images and video from servers close to users all over the world, like Cloudflare or Akamai. | Edge cachingDNSNetworking | Hard | |||
| Design an object storage service Store and retrieve any amount of data as objects in buckets with extreme durability, like Amazon S3. | DurabilityErasure codingMetadata | Hard | |||
| Design Twitch Let creators stream live video to millions of viewers with low delay and live chat, like Twitch. | Live videoTranscodingChat | Hard | |||
| 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 spikesInventory | Hard |