How would you implement sub-question decomposition, and when does it make things worse?
Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.
Model answer: the part to lead with
Decomposition splits a compound question into independently retrievable sub-questions, retrieves for each, then synthesizes. It is the fix for questions where no single chunk can contain the answer.
Full worked answer with diagram
Decomposition splits a compound question into independently retrievable sub-questions, retrieves for each, then synthesizes. It is the fix for questions where no single chunk can contain the answer.
Two distinct shapes, and conflating them is a common error:
Parallel decomposition for comparative questions: 'How does our refund policy differ between EU and US?' splits into two independent queries, retrieved concurrently, then merged. Cheap, latency is one round trip.
Sequential decomposition for multi-hop questions: 'Who signed the contract with our largest supplier by 2025 spend?' You cannot write the second query until the first resolves the supplier. This is inherently serial, and it is where an agentic loop beats a static plan, because the planner cannot know the sub-questions upfront.
def answer(q):
subs = plan(q) # LLM emits sub-questions
ctx = [retrieve(s) for s in subs] # parallel where independent
return synthesize(q, subs, ctx)
When it makes things worse:
- Simple questions. Decomposing 'what is our PTO policy' into three sub-questions triples cost and latency and dilutes the context with near-duplicates. Gate it with a cheap classifier or let the model decide, and measure how often the router is wrong.
- Error compounding. Each hop multiplies failure probability. If each retrieval is 85% reliable, three serial hops land near ~60%.
- Bad plans on unfamiliar corpora. The planner invents sub-questions your corpus cannot answer, so you retrieve confident irrelevance.
- Synthesis drift. With five sub-answers, the final model often answers the sub-questions rather than the original question.
My default is to not decompose by default. Ship single-shot, measure which queries fail, and turn on decomposition for the classes that provably need it. It is a real win on comparative and multi-hop questions and a pure tax everywhere else.
Worth sketching. The fork between parallel and serial hops is the distinction interviewers are listening for, and the compounding number sits naturally on the serial branch.
flowchart TD
Q["Compound question"] --> C{"Does one sub-answer<br/>feed the next query?"}
C -->|"no: compare EU and US"| P["Fan out sub-queries,<br/>retrieve concurrently"]
C -->|"yes: find supplier,<br/>then find signer"| S["Hop 1 retrieve"]
S --> S2["Write hop 2 query<br/>from hop 1 result"]
S2 --> Y["Three serial hops at 85%<br/>each land near 60%"]
P --> M["Synthesise against the<br/>original question"]
Y --> M
What a good answer covers
- Decomposition splits a compound question into independently retrievable sub-questions, retrieves for…
- It is the fix for questions where no single chunk can contain the answer
- Parallel decomposition for comparative questions
- Sequential decomposition for multi-hop questions
- This is inherently serial, and it is where an agentic loop beats a static plan, because the planner…
Key terms: Parallel decomposition · Sequential decomposition · Simple questions · Error compounding · Bad plans on unfamiliar corpora · Synthesis drift
Interviewer follow-ups to expect
How would you decide, at query time and cheaply, whether a question needs decomposition?
How do you keep the final synthesis answering the original question rather than the sub-questions?
Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep