Skip to main content

Must-know System design interview questions

43 reported frequent at Flipkart, Swiggy, Stripe and 11 more. “Reported” because the company tags have no public source. Every quick answer is free.

Questions on this page
43
Must know
0
picked by the editor
Reported frequent
43
company tags, reported
Companies
14
with a frequent tag

Reported frequent· 43

Tagged as frequent at a company. Reported: the tags have no public source.

  1. Design a rate limiter for an API (e.g. limit each client to N requests per window).Use token bucket (allows bursts) or sliding-window counter, with per-client state in a central Redis updated via atomic ops / Lua so distributed servers agree. Run it as gateway middleware returning 429 + Retry-After. Decide fail-open vs fail-closed.AdvancedFreeReported frequent at Airbnb+4
  2. Design a distributed key-value store and a caching layer on top of it (like Redis or Azure Cache): partitioning, replication, consistency and eviction.Partition keys with consistent hashing and virtual nodes, replicate to N nodes, and pick consistency per use. A Dynamo-style store uses quorums (R+W>N, with caveats); a Redis-style cache uses a primary per shard with async replication, TTL and LRU/LFU eviction, and can lose acknowledged writes on failover.Advanced₹499 (Pro plan required)Reported frequent at Airbnb+3
  3. Design a URL shortener like TinyURL.Generate a unique 7-char Base62 key from a distributed counter (collision-free) or a hash. Store key->URL in a KV store, cache reads in Redis/CDN since traffic is read-heavy, and redirect via 301/302. Shard by key to scale.IntermediateFreeReported frequent at Amazon+2
  4. Design a search autocomplete / typeahead system (Google search suggestions).Serve completions from a Trie whose nodes cache the top-k popular suggestions, so a lookup is O(prefix) with no runtime ranking. Build/update those caches offline from aggregated query logs. Shard by prefix, cache hot prefixes, debounce keystrokes; precompute trades memory for sub-100ms reads.Advanced₹99 (Interview Prep or Pro plan required)Reported frequent at Google+2
  5. Machine coding: design and implement a working Splitwise-like expense-sharing system that adds users, records an expense split EQUALLY, by EXACT amount or by PERCENTAGE, and shows simplified balances.Model User and Expense, use a Split strategy per type (equal, exact, percent) that returns integer paise per user, keep a net-balance map, and simplify debts by matching the largest creditor with the largest debtor using two heaps. Never use floats for money; give equal-split remainder paise to the first participants.Intermediate₹99 (Interview Prep or Pro plan required)Reported frequent at Flipkart+1
  6. Design a chat/messaging system like Facebook Messenger.Clients keep WebSockets to gateway servers. A message service persists each message with a per-conversation sequence number and routes it by pub/sub to the recipients' gateways; offline users get a push and resync on reconnect. Store in Cassandra by conversation, shard sockets with a user-to-gateway registry.Advanced₹499 (Pro plan required)Reported frequent at Meta+1
  7. Design a push notification system like APNs that reliably delivers notifications to hundreds of millions of devices.Persistent per-device connections sharded across gateways with a token->gateway registry, fed by a durable queue and fan-out dispatchers. Store-and-forward for offline devices with TTLs, at-least-once delivery with client-side dedup, and priority tiers for time-sensitive pushes.Advanced₹499 (Pro plan required)Reported frequent at Apple+1
  8. Implement a double-entry payment ledger that records money movement. Support posting transactions, guarantee every transaction balances to zero, keep entries immutable, and support querying an account balance. Design the classes and API.Model money movement as balanced double-entry: each transaction's signed legs sum to zero and are appended atomically and immutably (corrections are reversing entries, never edits). Balance is the sum of an account's signed entries. Use integer cents, idempotent posting by transaction id, and running-balance snapshots.Advanced₹99 (Interview Prep or Pro plan required)Reported frequent at Flipkart+1
  9. Machine coding: build an online food-ordering system with restaurants and menus, a customer cart, order placement and order status tracking with valid state transitions.Model Restaurant, MenuItem, Cart, Order and an OrderStatus state machine with an allowed-transitions map, so illegal moves such as DELIVERED to PLACED raise an error. OrderService validates availability, computes totals in paise and updates status. Ship a demo and tests for empty cart, totals and transitions.Intermediate₹99 (Interview Prep or Pro plan required)Reported frequent at Flipkart+1
  10. Design a video streaming platform like YouTube.Async transcode uploads into multiple bitrates, segment for HLS/DASH, store bytes in blob storage + metadata in a DB, and serve segments from a CDN with adaptive bitrate. Decouple upload/transcode from streaming; use async counters for views; CDN edge caching is the key to smooth global playback.Advanced₹499 (Pro plan required)Reported frequent at Google+1
  11. Design a parking lot system (object-oriented / low-level design).Model ParkingLot -> Level -> Spot, with a Vehicle hierarchy declaring required spot size and a Strategy for fees. Assign nearest fitting spot using per-size free-counters, issue a Ticket, compute fee on exit. Use polymorphism over enums and lock spot assignment for concurrency.Intermediate₹99 (Interview Prep or Pro plan required)Reported frequent at Amazon
  12. Design a file sync service like OneDrive/Dropbox (with delta sync and conflict resolution).Chunk and hash files so only changed chunks upload (delta sync). Store chunks in an object store and ordered chunk lists in a metadata database, and push deltas to other devices via a notification service. Resolve concurrent edits with version vectors, keeping conflicted copies. Shard metadata by user; dedupe chunks.Advanced₹499 (Pro plan required)Reported frequent at Microsoft
  13. Design a multi-level cache: reads check L1, then L2, then main memory, with a configurable number of levels and a pluggable eviction policy.Hold an ordered list of cache levels, each with its own capacity and eviction policy (LRU via hash map plus ordering, O(1)). get() probes top-down, promotes a hit into the faster levels, and on a full miss reads the backing store and fills the levels. Define the write policy (write-through here).Advanced₹99 (Interview Prep or Pro plan required)Reported frequent at Flipkart
  14. Design an e-commerce order management / checkout system (Amazon-style).Split into Cart, Order, Inventory, Payment, Fulfilment services with a queue between them. Reserve inventory atomically, run checkout as an idempotent Saga with compensating actions, and keep money/stock strongly consistent while status views are eventually consistent.Advanced₹499 (Pro plan required)Reported frequent at Amazon
  15. Tell me about a time you had to scale a system to handle a large increase in load. How do you answer this behavioural interview question using the STAR method?Use STAR with your own real story: name the load increase, the measurement that found the true bottleneck, the specific fix you owned, and a measured result. Interviewers look for diagnosis before action, trade-offs, and what you learned. Do not copy sample numbers; use yours.Advanced₹99 (Interview Prep or Pro plan required)Reported frequent at Netflix
  16. Design Uber's surge pricing engine: compute a per-area price multiplier in near real time based on supply (available drivers) and demand (ride requests), updating roughly every 30 seconds.Stream requests and driver locations into per-cell (S2 or geohash) windowed aggregates, compute multiplier = f(demand/supply) with smoothing and a cap, and publish to Redis keyed by cell. Lock the multiplier into each quote so mid-trip changes do not affect the rider. Trade-off: responsiveness versus oscillation.Expert₹499 (Pro plan required)Reported frequent at Uber
  17. Build a rate limiter for the Stripe API that supports per-key tiers (e.g. free vs paid customers get different limits). Design the class/API, pick an algorithm, implement it, and explain how it works distributed across many servers.Use a token bucket per key: lazily refill tokens by elapsed time times rate up to capacity, consume one per request, deny at zero. It is O(1) and supports bursts. Tiers are different (capacity, refill) pairs. Distribute with bucket state in Redis and an atomic Lua refill-and-consume; return 429 with Retry-After.Advanced₹99 (Interview Prep or Pro plan required)Reported frequent at Stripe
  18. Design Stripe's webhook delivery system: when an event occurs (e.g. payment succeeded), reliably deliver it to millions of merchant endpoints with at-least-once delivery, retries with backoff, and reasonable ordering.Persist events durably, fan out into per-endpoint queues, and have workers POST HMAC-signed payloads. Retry failures with exponential backoff for up to days, then dead-letter. Delivery is at-least-once, so include a stable event id and have consumers dedupe. Use partitioned queues for per-object ordering.Expert₹499 (Pro plan required)Reported frequent at Stripe
  19. Machine coding (90 minutes): design and build a working ride-sharing or carpool system where users can offer rides on a route and others can search and book seats.Model User, Ride (ordered stops, seats, price) and Booking. RideService offers rides, searches rides where origin comes before destination in the stops, ranks with a pluggable strategy, and books seats under a per-ride lock so the last seat cannot be oversold. Ship a runnable demo and tests.Intermediate₹99 (Interview Prep or Pro plan required)Reported frequent at Flipkart
  20. Design an iMessage-style end-to-end encrypted messaging system that syncs across a user's iPhone, iPad, Mac and Watch with correct ordering and offline delivery.Treat the server as a blind relay. The sender encrypts per recipient device key from a key directory, the server stores ciphertext in per-device durable queues, and push wakes devices. Order by per-conversation sequence number. This is a design approximation, not Apple's confirmed internals.Advanced₹499 (Pro plan required)Reported frequent at Apple
  21. Design an A/B testing / experimentation platform to safely roll out and measure features at Netflix scale.Deterministic hash bucketing, hash(user+experiment) mod N, gives stateless, consistent, independent variant assignment, with edge-cached configs. Stream exposure and outcome events to an analysis pipeline computing significance with guardrail metrics and auto-rollback. Use exclusive layers; check sample-ratio mismatch.Advanced₹499 (Pro plan required)Reported frequent at Netflix
  22. Design a LinkedIn-style home feed that shows each member a ranked stream of activity from their network.Store posts, build candidates per member with hybrid fan-out (push for normal authors, pull for very popular ones), then rank in two stages: a cheap model narrows hundreds of candidates, an expensive ML model orders the final few. Cache pages, accept eventual consistency. LinkedIn details are reported, not confirmed.Advanced₹499 (Pro plan required)Reported frequent at LinkedIn
  23. Implement idempotency keys for a payment API so that a client that retries a create-charge request never double-charges. Design the data model, the API and the handling of concurrent duplicates and crashes.Keep a table keyed by (account, idempotency key) with a request fingerprint and status. A unique-constraint insert decides who runs the charge; duplicates get the stored response, a changed body is rejected, in-progress duplicates get 409, and a stale lock lets a retry recover after a crash.Advanced₹499 (Pro plan required)Reported frequent at Stripe
  24. Implement an in-memory cache with fixed capacity and a pluggable eviction policy (support both LRU and LFU) with O(1) get and put.Cache holds a dict and delegates to an EvictionPolicy with access, add, evict and remove. LRU uses an ordered map (hash map plus doubly linked list). LFU keeps key-to-frequency, frequency-to-ordered keys and a min-frequency pointer; ties evict the least recently used. Updating an existing key calls access, never add.Advanced₹99 (Interview Prep or Pro plan required)Reported frequent at Swiggy
  25. Design the delivery-partner assignment service: given a new order, pick the best available partner based on distance, availability, and reliability.Keep partner locations in a geo index for fast radius queries, score nearby free partners by ETA, load and reliability, and offer with a timeout, atomically flipping partner state on accept to prevent double-assignment. Partition by city, favor greedy matching, and widen the radius or batch under supply crunch.Advanced₹499 (Pro plan required)Reported frequent at Swiggy
  26. Design a web crawler for a search engine.URL Frontier (per-domain queues) feeds fetcher workers that respect robots.txt/politeness; parser extracts links; a Bloom filter + content hash dedupes; new URLs re-enter the frontier. Shard by domain, use queues between stages, and balance freshness vs politeness vs coverage.Advanced₹499 (Pro plan required)Reported frequent at Google
  27. Design an in-memory key-value store that is durable, so data is not lost if the machine crashes or reboots.Use an in-memory hash map for speed plus a write-ahead log (WAL) fsynced before acknowledging, for durability; on restart, replay the WAL from the latest snapshot. Add periodic snapshots and log compaction to bound size. Follow-ups: group-commit fsync, Raft replication for machine failure, LSM eviction beyond RAM.Advanced₹499 (Pro plan required)Reported frequent at Databricks
  28. Design Uber's core ride-hailing system: a rider requests a ride, the system finds nearby available drivers, matches one, and tracks the trip in real time at city scale.Stream driver GPS into an in-memory geospatial index (geohash, S2 or quadtree) sharded by city so nearby-driver lookups stay bounded. A dispatch service ranks candidates by estimated time of arrival (ETA) and uses a Redis TTL lock per driver for one-rider-one-driver, then a trip service persists the lifecycle.Expert₹499 (Pro plan required)Reported frequent at Uber
  29. Implement the game of Snake and Ladder for N players on a configurable board with multiple snakes and ladders and a dice roll, with a working demo.Model Board as one position-to-target jump map (snakes go down, ladders go up), inject the Dice for deterministic tests, and run a turn queue with an exact-finish rule. Validate the board (no jump landing on another jump, no jump from the last cell) and add a max-turns guard so the game always ends.Intermediate₹99 (Interview Prep or Pro plan required)Reported frequent at Swiggy
  30. Design the real-time order tracking feature: the customer sees the delivery partner's live location on a map as the order moves.Partners stream GPS over MQTT or WebSockets into a Location service that keeps the latest position in Redis and publishes to a pub/sub layer; customers subscribe to their order's topic for live push updates. Throttle or sample updates, interpolate on the client, and treat location as eventually consistent.Advanced₹499 (Pro plan required)Reported frequent at Swiggy
  31. Design the Facebook/Meta News Feed.Model it as fanout: push post ids into followers' feed caches on write for fast reads, but pull recent posts at read time for celebrity accounts (hybrid) to dodge write amplification. Rank with recency + engagement/ML, hydrate from cache, paginate by cursor. Feed can be eventually consistent.Advanced₹499 (Pro plan required)Reported frequent at Meta
  32. Design a live comments / real-time reactions system for a live video or post (high write and read fan-out).Ingest comments to a per-live-object pub/sub topic; gateway servers subscribe and push to the connections each holds, so fan-out is distributed (tree or hierarchical), not one node reaching millions. Aggregate or sample high-volume reactions and rate-limit spikes. Delivery is best-effort and eventually consistent.Advanced₹499 (Pro plan required)Reported frequent at Meta
  33. Design a People You May Know (PYMK) recommendation system like LinkedIn's: suggest relevant new connections to each member.Generate candidates offline with friend-of-friend (triangle closing) plus shared school or employer signals, using a distributed batch job such as Spark. Store the top candidates per member in a key-value store, then re-rank online with an ML acceptance model and filter out existing or dismissed connections.Advanced₹499 (Pro plan required)Reported frequent at LinkedIn
  34. Find and fix the bugs in this payment-processing code (withdraw, transfer, refund). It has a race condition, no idempotency check, a non-atomic balance check and an unbounded refund.Name each bug with its failure scenario: check-then-act race (two withdrawals overdraw), retry double-charge (no idempotency key), non-atomic transfer (money lost on failure), refund above the charge. Fix with a per-account lock or conditional update, stored idempotency results, one atomic transfer, and a refund cap.Advanced₹99 (Interview Prep or Pro plan required)Reported frequent at Stripe
  35. Design a collaborative document editor like Google Docs.Real-time convergence via Operational Transformation (central server transforms concurrent ops) or CRDTs (per-char ids merge without a transform). Clients use WebSockets to a per-document server that orders, broadcasts, and persists an op log + snapshots. Pin each doc to one server; scale by document.Expert₹499 (Pro plan required)Reported frequent at Google
  36. Design a payment system like Apple Pay: secure, no duplicate or lost charges, with fraud detection and integration to external card networks.Tokenize the card in the secure element and use one-time cryptograms so the PAN never leaves the device. A strongly consistent double-entry ledger with idempotency keys and a saga state machine guarantees exactly-once. Real-time fraud scoring and async settlement/reconciliation complete it.Advanced₹499 (Pro plan required)Reported frequent at Apple
  37. Design Airbnb's booking / hotel reservation system. Focus on how a user searches for available listings and reserves one without double-booking.Split fast approximate search (Elasticsearch plus Redis) from strongly consistent booking. Keep reservation and inventory data together for a local ACID transaction, prevent double-booking with row locks, optimistic concurrency or a Redis hold, and make booking idempotent. Shard by listing ID; use Sagas with refunds.Advanced₹499 (Pro plan required)Reported frequent at Airbnb
  38. Design the search and availability service for Airbnb: users search by location, date range, price, and amenities and get relevant, fast results at scale.Feed listing/availability changes through Kafka into a denormalized Elasticsearch index with geo (geohash/S2) and attribute filters; filter by precomputed availability calendars, rank, and cache hot results. Accept stale availability since the reservation service revalidates at booking. Shard by region for scale.Advanced₹499 (Pro plan required)Reported frequent at Airbnb
  39. Design iCloud Photos: store and sync a user's photo and video library across all their devices with deduplication and efficient bandwidth use.Store originals in an object store, metadata per user in a database with change tokens. Devices hash before upload to skip duplicates (scoped per user), upload in resumable chunks, and sync by pulling changes since a token. Cross-user dedup conflicts with encryption. Apple's real dedup is not public.Advanced₹499 (Pro plan required)Reported frequent at Apple
  40. Design a discount and coupon engine that applies flat, percentage-with-cap, BOGO and free-delivery offers to a cart and honours stacking rules.Make each offer a Coupon strategy with is_applicable and discount in integer paise. A separate StackingPolicy decides which applicable coupons combine (best single, or an allow-list in priority order) and caps the total at the payable amount. New offers are new classes, with no change to the engine.Intermediate₹99 (Interview Prep or Pro plan required)Reported frequent at Swiggy
  41. Design a food delivery system like Swiggy end-to-end: browsing restaurants, placing orders, assigning delivery partners, and handling millions of concurrent orders.Decompose into catalog/search (geo-indexed, cached), order, payment, dispatch/assignment, and tracking services, glued by Kafka events. Keep browsing eventually consistent but the order+payment path ACID and idempotent. Partition by city, use CQRS for read-heavy tracking, and smooth peaks with queues and autoscaling.Advanced₹99 (Interview Prep or Pro plan required)Reported frequent at Swiggy
  42. Design a subscription grocery service for Flipkart (BigBasket-style): stores list items and delivery locations; users subscribe to recurring items fulfilled by any nearby store that serves their location.Split into catalog, serviceability (geo-indexed location to stores), subscription, matching and inventory services. A scheduler pulls due subscriptions, matches an in-range, in-stock store, atomically reserves inventory and places the order. Cache catalog and serviceability; keep inventory transactional.Advanced₹499 (Pro plan required)Reported frequent at Flipkart
  43. Design the inventory and order system for a Big Billion Day style flash sale where a limited-stock product gets millions of simultaneous buy requests, without overselling.Gate traffic with a CDN, waiting room and rate limits. Reserve stock with an atomic Redis Lua script that decrements and records a reservation with a TTL, persist orders through a queue, and reconcile with the database. Redis can lose writes on failover, so the database stays the source of truth.Expert₹499 (Pro plan required)Reported frequent at Flipkart

Reported frequent at

Must-know questions for other tools