</> MAANG.io
system design · 301

Advanced

Master system design interviews with scalable architecture patterns, distributed systems, and real-world design challenges.

0/480 solved 0% complete

Section 1: One Prompt, Three Products - Problem Understanding & Clarifications

Executive Summary: "Design Stack Overflow or Quora" sounds like one product, but the prompt names three different ones: curated Q&A with reputation, social Q&A with feeds, and communities with deep threaded discussion. This section breaks the prompt into what, who, why and how, then runs six clarifying questions that each fix or remove part of the design. The most important answer is about readers, not writers: most of the traffic is anonymous people arriving from a search engine, which makes cacheability the central problem. It ends with written assumptions and the running example.

The interviewer reads the prompt aloud:

"Design a question-and-answer platform like Stack Overflow or Quora. People ask questions, others answer, anyone can comment, and votes push the best answers to the top. Then we'll talk about what changes when comments nest like Reddit's."

The prompt gives you three product names, and they are not interchangeable. Stack Overflow is a curated knowledge base: one question, competing answers, an accepted answer, reputation, and strangers allowed to edit your post. Quora is social Q&A: you follow topics and people, and a personalized feed decides what you see. Reddit is a set of communities where the discussion is the product and comment threads go many levels deep. Each implies a different read path, data model and ranking problem. Draw before you know which one you're building and you'll design parts of all three.

Decomposing the Prompt

Before asking anything, map the problem out loud in four parts.

  • What it does. Six verbs: ask, answer, comment, vote, edit, search. Voting is the one with a rule attached, since votes only mean something if each person gets one per post.
  • Who it serves. Two very unequal groups. A small group of signed-in people write the content. A much larger group reads it, most of them never sign in, and most arrive from a search engine with an error message pasted into the search box.
  • Why it exists. The product is finding an answer that already exists. Writing is the supply side. A reader who lands on the right page and leaves two minutes later is a success, even though they never clicked anything.
  • How it's used. Through web pages, and mostly through a search engine's results page. The question URL is the front door, and it has to be stable, fast and readable by a crawler.

The Q&A platform prompt decomposed into what, who, why and how, each leading to its constraint: one vote per person per post, pages cacheable for everyone, search and duplicate prevention, and stable public URLs with server-rendered HTML

Quick check before moving on:

Sign in to continue reading

The rest of this lesson is available with a free account. Signing in with Google or Microsoft is free.

Sign in to read the full lesson

Sign in to MAANG.io

Use your Google or Microsoft account — no password to remember.

Continue with Google Continue with Microsoft

Please accept the terms above to continue.