Order the steps
Order the opening steps.
- Ask about input size, edge cases and output format
- State the brute-force idea and its cost
- Restate the task in your own words
- Work one small example by hand
Choose an answer, then open Show answer below to check it.
Show answer
Answer: C A D B
- Restate the task in your own words Confirms you and the interviewer mean the same thing.
- Ask about input size, edge cases and output format These decide which approaches are allowed.
- Work one small example by hand It becomes your first test case.
- State the brute-force idea and its cost It gives a correct baseline to improve on.