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.
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