What you will be able to do#
- Distinguish consequential questions from performative checklist recitation.
- Cover the contract dimensions that commonly change implementation behavior.
- Translate each answer into an algorithm or test consequence.
Ask questions with consequences#
A useful question can change the representation, algorithm, return value, or test set. Ask it before committing to the affected decision. If an assumption is harmless and conventional, state it briefly and continue rather than seeking permission for every line.
Do not ask for information already supplied, list edge cases without connecting them to behavior, or ask the interviewer to choose your algorithm.
Cover the dimensions that matter#
Select the dimensions relevant to the prompt; not every problem needs every question.
- Valid input and invalid-input behavior: reject, ignore, normalize, or assume the precondition.
- Output shape: one answer, all answers, count, witness, stable ordering, or in-place result.
- Duplicates and ties: preserve, deduplicate, choose earliest, or accept any valid result.
- Ordering and mutation: sorted or arbitrary input; whether reordering or changing it is permitted.
- Numeric bounds: input size, value range, overflow behavior, and precision.
- Text model: bytes, code units, Unicode code points, normalization, and case rules.
- Graph contract: directed or undirected, weighted or unit-cost, parallel edges, self-edges, and disconnected nodes.
Endpoint semantics can change the answer#
Suppose a service can run at most one job at a time and receives intervals. Ask whether [start, end) is half-open. If a job ending at 10 frees the service for another starting at 10, end events must release capacity before same-coordinate start events. If both endpoints are closed, those jobs overlap and the peak can increase.
Before and after#
Before: 'Are there edge cases? Should I use a heap?' These questions transfer the work to the interviewer and do not define behavior.
After: 'Are intervals half-open, so a job ending at t does not overlap one starting at t? That determines how I order equal-coordinate events and what I test.' The second question names the decision it changes.
Question → answers → consequence#
Write the consequence before moving on; an answer that changes nothing was probably not a necessary question.
| Question | Possible answers | Algorithm or test consequence |
|---|---|---|
| May the input contain duplicate values? | Yes, preserve multiplicity; No, values are unique | Choose count-based state and duplicate tests, or rely on uniqueness only when it is guaranteed. |
| May I reorder the input? | Yes; No; original order or indices must remain | Sorting may enable a scan, or an auxiliary structure may be needed to preserve position. |
| Are graph edges weighted? | All moves cost one; Nonnegative unequal costs; Negative costs possible | Choose BFS, Dijkstra-style relaxation, or a method whose contract permits negative edges. |
| What should invalid intervals do? | Input is guaranteed valid; Reject reversed intervals; Ignore empty intervals | Separate precondition from validation and add tests for the declared behavior. |
Finish with a usable contract#
You are ready to solve when you can state the valid input, exact output, mutation and ordering rules, relevant bounds, and the one or two edge semantics that change the approach. Completion is not reciting the longest checklist.
Worked example#
Capacity scheduling with equal endpoints
Intervals [1, 4), [2, 5), and [4, 6) share a scheduling resource.
- Ask whether intervals are half-open and whether zero-length intervals are ignored.
- Under half-open semantics, the interval ending at 4 releases capacity before [4, 6) starts.
- Group equal-coordinate events or explicitly order end before start, then test the coordinate 4 boundary.
Outcome: The endpoint answer determines event ordering and prevents an incorrect peak-overlap count.
Apply the idea#
For an interval-capacity problem, write three clarifying questions. For each, give two plausible answers and the algorithm or test consequence.
Reveal the worked answer
Ask whether intervals are half-open: yes means end-before-start at equal coordinates; closed means they overlap. Ask whether reversed intervals are valid: guaranteed-valid input removes validation, while invalid input requires rejection behavior and tests. Ask whether the output needs only peak capacity or also the earliest coordinate: the latter requires deterministic tie handling while grouped events are processed.
Choose the next session#
Open one question and write only the questions whose answers would change its representation, algorithm, or tests before revealing any recognition prompt.
Practice clarifying a public questionSource and review record#
This original Engineering Foundry guide was checked by Codex against the recorded research scope on 2026-09-05. It has not received independent human editorial review.
Evidence IDs: SRC-COMP-AMAZON-OFFICIAL SRC-COMP-MICROSOFT-OFFICIAL