Lesson 4 of 30
Before any data model or API gets discussed, most frontend system design prompts expect a component tree sketched on the whiteboard — and where you draw the boundaries is itself the design decision being graded.
13 min read
Every option explains itself — why the right one is right, and why each wrong one is wrong. Miss one and it comes back later on a spaced-repetition schedule.
Question 1 of 3
SearchBox and ResultsList both need the same query text, but each is currently sketched as an independent box. Where should that state go?
Hints without spoilers, and a plain explanation of why a wrong answer was wrong — answered only from this lesson. Free account, no card.
Sign up freeWhat interviewers actually ask about this, and what a strong answer has to cover.
A strong answer covers
Likely follow-ups
Once a prompt's requirements are scoped, the next thing a strong candidate does is sketch a component tree — a rough box-and-line breakdown of the screen or feature, before touching data models or APIs. This is whiteboard-level architecture, not implementation: you're not writing component code, you're deciding where the seams go.
Two questions do almost all the work:
A feature's natural boundary in the tree is usually wherever a self-contained container sits: the box that owns the state and the fetch, with everything below it just rendering what it's handed.
Say the prompt is "design a search-as-you-type feature: a text box and a results list below it." The instinct is to sketch two independent boxes, SearchBox and ResultsList, each seemingly self-contained.
Requirement: a search feature needs a SearchBox for typing a query and a ResultsList showing matches.
The problem surfaces immediately: ResultsList needs the query text that SearchBox owns, to know what to fetch and render. That state can't live in either child alone — it lifts up to a new common ancestor, SearchFeature, which becomes the container: it owns the query state and the fetch, while SearchBox and ResultsList stay presentational, rendering only what they're given (an input value plus an onChange, and a results array, respectively). Saying this reasoning out loud — "these two need to share state, so it lifts to their common parent" — is exactly the signal an interviewer is listening for.
Almost every "design this UI feature" prompt expects a component tree sketch early on, and the strongest signal a candidate gives is correctly identifying where state has to lift and why — not just drawing boxes, but explaining the forcing function behind each boundary.