Skip to content
InterviewTigerInterviewTiger
Back to the journal
Coding interviews

How to explain your coding solution before you type

A practical speaking order for constraints, approach, edge cases and complexity.

Engineer explaining a coding approach with flow diagrams and edge cases5 min read

In a coding interview, the interviewer is evaluating how you think as much as whether your final code runs. A short explanation before you type makes your reasoning visible and prevents avoidable rework.

Restate the problem

Summarize the input, expected output and important constraints in your own words. Confirm anything ambiguous before choosing a data structure.

Start with the straightforward approach

Briefly name the simplest correct solution, even if it is not optimal. This creates a baseline and shows why your improved approach is worth using.

Explain the better approach

Name the data structure or pattern, then describe the steps in plain language. Keep this to three or four sentences before you begin coding.

Call out edge cases

Mention empty input, duplicates, boundaries and invalid values when they apply. You do not need an exhaustive list; choose the cases most likely to break the solution.

Finish with complexity

State time and space complexity and connect each one to the operations in your approach. If there is a trade-off, say what you gain and what it costs.

Keep preparing

View all guides