Whiteboard Interview Tips: A Step-by-Step Approach That Works

Whiteboard Interview Tips: A Step-by-Step Approach That Works

A six-step method for whiteboard and shared-doc coding interviews: clarify, example, approach, code, test, optimise. Worked example included.

Whiteboard interviews — solving a problem by hand on a whiteboard, or in a plain shared document without an IDE — are still common in on-site rounds and in some virtual interviews at product companies. They feel harder than coding in an editor because there is no autocomplete, no compiler and no way to run tests. But the interviewer knows that. They are not grading syntax; they are watching how you think. A consistent method makes a large difference. Here is one that works, followed by a worked example.

The six-step method

1. Clarify the problem

Repeat the problem in your own words and ask questions before writing anything. What are the input types and sizes? Can there be duplicates, negatives or empty input? What should be returned if there is no answer? Interviewers often leave details unspecified on purpose to see whether you ask.

2. Work through an example

Write a small example on the board and solve it by hand. This catches misunderstandings early and often reveals the pattern of the solution. Add an edge case example too.

3. State an approach before coding

Describe a brute-force solution first, with its time and space complexity, then improve it. Say what data structure you will use and why. Get a nod from the interviewer before you start writing code — it avoids spending fifteen minutes on an approach they would have redirected.

4. Write clean code

Write top to bottom, leaving space between lines for corrections. Use meaningful variable names, and break logic into small helper functions if it gets long. Small syntax slips are fine; say "I'd check the exact method name in the docs" and move on.

5. Test by hand

Trace your code with the example from step 2, writing variable values as you go. Then check edge cases: empty input, single element, all duplicates, very large values. Fix bugs calmly as you find them. This step is where many candidates either impress or lose the round.

6. Discuss complexity and improvements

State the final time and space complexity. Mention trade-offs and what you would change for different constraints — a much larger input, streaming data, or limited memory.

A worked example

Problem: given an array of integers and a target, return the indices of two numbers that add up to the target.

Clarify: Is there exactly one solution? Can I use the same element twice? Is the array sorted? (Assume one solution, no reuse, unsorted.)

Example: `[2, 7, 11, 15]`, target `9` → `[0, 1]`.

Approach: brute force checks every pair, O(n²) time. Better: one pass with a hash map from value to index; for each number, check whether `target - number` is already in the map. O(n) time, O(n) space.

Test: `i=0, num=2, need=7` → not seen; store `{2:0}`. `i=1, num=7, need=2` → found at 0, return `[0, 1]`. Edge cases: duplicates such as `[3, 3]` with target `6` work because we check before storing; no solution returns an empty list.

Complexity: O(n) time, O(n) space. If the array were sorted, two pointers would give O(1) extra space.

Communication habits that matter

Practise on paper or a plain text file with no syntax highlighting, and time yourself. The first few attempts feel clumsy; after ten or fifteen problems, writing code without an editor becomes much more natural.

  • Think aloud continuously, especially when stuck: "I'm considering sorting first, but that loses the original indices."
  • When the interviewer hints, acknowledge it and build on it rather than defending your earlier idea.
  • Keep your board organised: example on one side, code in the middle, notes on complexity at the bottom.
  • Check in at natural points: "Does this approach sound reasonable before I code it?"

Common mistakes

  • Starting to code immediately without clarifying or working through an example.
  • Going silent for long stretches.
  • Writing cramped code that becomes impossible to edit.
  • Declaring "done" without testing the code by hand.
  • Ignoring hints, or getting flustered by small bugs.
  • Forgetting to state complexity at the end.

When you get stuck

Everyone gets stuck sometimes, and interviewers expect it. What matters is how you respond. Go back to your example and solve it slowly by hand, noticing what you do. Try a simpler version of the problem — a smaller input, a sorted array, no duplicates — and solve that first. Think about which data structures give fast lookups or ordering. If two or three minutes pass without progress, say what you have tried and ask whether you are heading in the right direction. A well-used hint costs far less than ten minutes of silence.

Virtual whiteboards

In virtual interviews, you may use a shared doc, a drawing tool or an online editor with execution disabled. The same method applies. Type a little slower and keep the structure clear, since the interviewer is reading as you write. Test your setup — microphone, camera, screen sharing, a pen tablet if you use one — before the interview.

How to prepare

  • Learn the core patterns: two pointers, sliding window, hashing, binary search, BFS/DFS, recursion, basic dynamic programming.
  • Solve two or three problems a day on paper using the six steps.
  • Do mock interviews with friends where one person plays the interviewer and gives hints.
  • Review every problem afterwards: what slowed you down, what you missed in testing.

Getting to the on-site round

Whiteboard rounds usually come after a resume screen and often a phone or online coding round. Keep your resume clear about your languages and projects — the Algnetic ATS resume builder can check it against target postings — and let auto-apply keep applications moving while you practise.

Key takeaways

  • Follow six steps: clarify, example, approach, code, test, complexity.
  • Agree on the approach before writing code.
  • Test by hand with your example and edge cases.
  • Think aloud and use hints well.
  • Practise on paper until writing code without an editor feels normal.

Let Algnetic apply to matching jobs for you · More career guides

Related guides

https://algnetic.com/blog/whiteboard-interview-tips-that-work