System Design MCQs - Classic Design Problems (Set 4)

System Design MCQs - Classic Design Problems (Set 4) - CodingHumans

This fourth set goes through the design problems interviewers ask most, from a URL shortener to a video streaming service. Each question looks at one key decision or one quick back-of-envelope estimate. Get these small pieces right and the full design becomes much easier to explain.

How to practise: read each question and tap the option you think is correct. You will see right away whether you got it, along with a short explanation, and your score is tracked at the bottom of the screen. This set has 15 questions.

System Design MCQ series: | Interview Preparation Hub

Topics covered in this set

  • URL shortener storage and ID generation
  • Chat apps and WebSocket fan-out
  • News feed fan-out on write vs read
  • Distributed rate limiters and notification systems
  • File storage with chunking and presigned URLs
  • Search typeahead and adaptive video streaming

System Design MCQs with answers and explanations

Q1. A URL shortener stores 100 million new links per month, each record taking about 500 bytes. About how much storage is needed for 5 years?

a) About 30 TB

b) About 600 GB

c) About 3 TB

d) About 300 GB

Q2. A URL shortener runs on many app servers. Which approach generates unique short codes without collisions or a database check on every insert?

a) Give each server its own block of IDs from a counter service (or use a Snowflake-style ID) and Base62-encode the number

b) Each server picks a random 3-character code

c) Use the current timestamp in seconds as the code

d) Hash the long URL with MD5 and keep the first character

Q3. In a chat app, user A is connected by WebSocket to gateway server 1 and user B to gateway server 7. How does a message from A reach B?

a) A opens a second WebSocket directly to B's device

b) B polls server 1 every second

c) Server 1 looks up which gateway holds B's connection (in a session registry or through a pub/sub channel such as Redis or Kafka) and forwards the message there, and server 7 pushes it to B

d) Server 1 sends it to every client it holds

Q4. A chat service must hold 50 million concurrent WebSocket connections, and one gateway server handles about 50,000. About how many gateway servers are needed, before adding headroom?

a) About 100

b) About 10,000

c) About 1,000

d) About 5,000

Q5. Messages in a group chat must appear in the same order for every member, even though they pass through different servers. What is a common solution?

a) Assign each message an increasing sequence number per conversation at a single point, such as the conversation's partition, and order by it

b) Sort by each sender's device clock

c) Order messages alphabetically

d) Deliver all messages through one global server

Q6. In a news feed, what does "fan-out on write" mean?

a) When a user posts, the post ID is pushed into the precomputed feed of every follower, so reading a feed is a fast lookup

b) Users write posts to a queue that nobody reads

c) Feeds are built only when a user opens the app

d) Posts are written to several databases for backup

Q7. A celebrity with 10 million followers posts on a platform that uses fan-out on write. What is the problem, and what is the usual fix?

a) Followers cannot see the post; increase the cache TTL

b) Nothing; fan-out on write handles this cheaply

c) The post is lost; write it twice

d) One post triggers about 10 million feed writes; use a hybrid where celebrity posts are pulled and merged at read time while normal users' posts are pushed

Q8. A rate limiter must enforce one limit per user across 20 API servers. Where should the counters live?

a) In a shared fast store such as Redis, updated atomically (for example INCR with an expiry, or a Lua script) and returning HTTP 429 with Retry-After when exceeded

b) In a log file read once a day

c) In the user's browser cookie

d) In each server's memory, with each server enforcing the full limit

Q9. A sliding window counter rate limiter allows 100 requests per minute. The previous minute had 80 requests, the current minute has 30 so far, and we are 25% into the current minute. What is the estimated count, and is the next request allowed?

a) 30; allowed

b) 110; rejected

c) 90; allowed

d) 80; allowed

Q10. Why does a notification system place a message queue between the service that creates notifications and the workers that call APNs, FCM, SMS and email providers?

a) Providers only accept messages from queues

b) Queues make notifications encrypted

c) It absorbs traffic spikes, lets each channel scale and retry independently, and stops a slow or failing provider from blocking the rest of the system

d) Queues remove the need for user preferences

Q11. A file sync service splits files into 4 MB chunks, each identified by its content hash. A user edits a few bytes in the middle of a 1 GB file. What happens?

a) The file is stored as 256 chunks, and only the changed chunk needs to be uploaded again

b) The file is split into 1,024 chunks

c) The edit cannot be synced

d) All 256 chunks are uploaded again

Q12. Users upload large videos to an object store such as Amazon S3. Why do many designs use presigned URLs?

a) The app server issues a short-lived signed URL, and the client uploads directly to object storage, so large files never pass through the app servers

b) They compress files on upload

c) They replace authentication entirely

d) They make files public forever

Q13. In a search typeahead system, how is a trie usually made fast enough to answer within a few milliseconds per keystroke?

a) By scanning every query in the logs for each keystroke

b) By storing the top k completions at each node, rebuilding the trie offline from query logs, and caching popular prefixes close to users

c) By storing the whole trie on disk and reading it per request

d) By rebuilding the trie on every request

Q14. How does adaptive bitrate streaming (HLS or DASH) keep a video playing smoothly on a changing network?

a) The CDN lowers the frame rate for all users

b) The server sends one high-quality file and the player skips frames

c) The video is encoded at several bitrates and split into short segments, and the player picks each segment's quality based on measured bandwidth and buffer level

d) The video is downloaded fully before playing

Q15. A live stream has 1 million concurrent viewers, each watching at 5 Mbps. What total egress bandwidth is needed, and what does this imply?

a) About 500 Mbps

b) About 5 Tbps, so the video must be served from a CDN's edge servers rather than from origin servers

c) About 50 Tbps

d) About 5 Gbps, which one server can handle

Quick revision notes

  • URL shortener: 6 billion links × 500 bytes ≈ 3 TB; use ID ranges + Base62 to avoid collisions.
  • Chat: route between gateways via a session registry or pub/sub; 50M connections ÷ 50k ≈ 1,000 servers; order by per-conversation sequence.
  • Feeds: push for normal users, pull for celebrities. This mix is called the hybrid model.
  • Rate limiter: shared atomic counters; sliding window estimate = prev × (1 − elapsed) + current.
  • Files: 4 MB chunks (1 GB = 256), presigned direct uploads; video: ABR segments + CDN (1M × 5 Mbps = 5 Tbps).

Frequently asked questions

How should I structure an answer to a classic design question?

First clear up the functional and non-functional requirements. Estimate the scale, then define the API and data model. Draw a high-level design, and finally go deep on the hardest parts, like fan-out or storage.

How exact do back-of-envelope estimates need to be?

Being within 10 times of the real number (one order of magnitude) is usually enough. Round freely, for example treat a day as about 100,000 seconds, and say your assumptions out loud.

Do I need to name specific technologies?

Naming tools like Redis, Kafka or S3 helps. But also say what you need from them, like atomic counters, durable logs or cheap object storage. That shows you know why you picked them.

Comments

Answered 0/0Correct 0