Clarifying Questions and Edge Cases
35 min · Intermediate
A clarifying question is a short question you ask before coding to remove any doubt about the input, the output or the rules. Interviewers often leave a problem vague on purpose; two minutes of good questions and an edge-case list prevent the most common way to fail: solving a slightly different problem.
Topics in this lesson
- The first two minutes: restate and confirm input and output
- The standard clarifying questions
- Listing edge cases before coding
- Worked example: two sum
- Worked example: longest substring without repeating characters
Interview questions this lesson answers
- Why should you ask clarifying questions before coding?
- What do you do in the first two minutes of a coding round?
- Which clarifying questions do you ask most often?
- Why does the input size matter?
- Why ask about the value range?
- Why ask whether the input is sorted?
- Why ask about duplicates?
- What do you do if the interviewer says "you decide"?
- What is an edge case?
- Why list edge cases before coding instead of after?
Sign in free to continue this lesson
Create a free account to read every lesson, practise with the exercises and keep track of your progress.