Careers and getting hired · Intermediate · 17 min
Solve coding interview problems out loud
By Padding · Updated 18 Nov 2026
Any editor or practice site · November 2026
You will work one live coding problem end to end the way interviewers score it and finish with a practice log of five problems, each holding your clarifying questions, approaches, Big-O and a hand-run test.
On this page
A live coding round is not a test of whether you reach the perfect answer in silence. The interviewer is watching how you think: do you check what the problem means, get something working, judge its cost, test it and keep going when you get stuck? Candidates who solve the problem quietly and then say "done" often score lower than candidates who talk through a slower solution and spot its weak points themselves.
This tutorial follows Tolu, a self-taught developer in Lagos with a live coding round next week for a junior full-stack role. You work through one problem with Tolu, word by word, then build a practice log of five problems that you can rehearse out loud. The examples use Python because it reads close to plain English, but every step works in any language. Use the language the company names, or the one you write most comfortably if they let you choose.
At the end you have a document with five entries. Each one lists the clarifying questions you asked, a simple approach and a better one with their Big-O, the code, and a test you ran by hand.
Step 1 · Set up your practice log
Create a document called "Coding practice log". Each problem gets one entry with the same headings, so you practise the same habits every time. Copy this template:
Problem: <one-line name>
Pattern: <the technique it uses, filled in after you solve it>
Date and time taken: <date, minutes>
1. My restatement:
2. Clarifying questions and the answers I assumed:
3. Examples, including edge cases:
4. Simple approach and its Big-O:
5. Better approach and its Big-O, with the trade-off:
6. Code:
7. Hand-run test (inputs, what each variable holds, output):
8. Where I got stuck and what I said:
9. What I would say differently next time:Headings 1 to 3 come before any code. That order is the whole point: in an interview, the first few minutes of talking about the problem are scored too.
Check it worked
Your document has the heading "Coding practice log" and one empty copy of the template with all nine numbered headings, ready for the first problem.
Step 2 · Restate the problem and ask clarifying questions
Here is the problem Tolu gets:
You are given a list of order IDs in the order they arrived. Return the first order ID that appears twice. If no ID repeats, return nothing.
Do not start typing. Say the problem back in your own words, then ask about inputs, outputs and edge cases. Here is how Tolu opens:
Tolu: So I get a list of order IDs, in arrival order, and I return the first one that shows up a second time. Can I check a few things before I start? Are the IDs numbers or strings? >Interviewer: Assume integers. >Tolu: Can the list be empty? And how long can it get, roughly? >Interviewer: It can be empty. Assume up to a million IDs. >Tolu: "First" could mean two things. Take 7, 3, 9, 3, 7. The ID that repeats soonest is 3, because its second copy comes before the second 7. But 7 is the first ID in the list that has a copy somewhere. Which one do you want? >Interviewer: Good question. The one whose second copy comes earliest, so 3. >Tolu: And if nothing repeats, should I return None, or something like minus one? >Interviewer: None is fine.
The question about what "first" means is the one that earns credit. It shows Tolu built a small example in their head and found an ambiguity before writing a line. Useful questions for almost any problem:
- What type are the inputs, and can they be empty, negative, duplicated or very large?
- How big can the input get? (This tells you whether a slow approach is acceptable.)
- What should I return when there is no answer?
- Can I change the input, or must I leave it as it is?
Write your examples down where the interviewer can see them, in the shared editor as comments if that is what you have: [7, 3, 9, 3, 7] -> 3, [] -> None, [5] -> None, [4, 4] -> 4.
Check it worked
Under headings 1 to 3 of your first log entry you have a one-sentence restatement, at least three clarifying questions with the answers above, and at least four examples, including the empty list and a list with no repeats.
Step 3 · Give a simple working approach first
Say the simplest correct idea out loud, even if you can see it is slow. A working slow solution is a safe place to stand; a fast idea you cannot finish is not.
Tolu: The simplest thing I can think of: for each position, look back at everything before it and check whether the same ID is there. The first position where I find a match is the earliest second copy, so I return that ID. For n IDs, that is a loop inside a loop, so roughly n squared comparisons, O(n²) time and no extra memory. With a million IDs that is far too slow, so I would like to improve it, but I wanted us to agree on a correct baseline first.
That last sentence matters. It tells the interviewer you know this is not the final answer and you are choosing to start here on purpose. Some interviewers will say "write that one first"; most will say "go on, improve it". Either way you have shown a correct plan.
If they ask you to write it:
def first_repeat_slow(order_ids):
for j in range(len(order_ids)):
for i in range(j):
if order_ids[i] == order_ids[j]:
return order_ids[j]
return NoneCheck it worked
Heading 4 of your entry states the nested-loop idea in one or two sentences and its cost as O(n²) time and O(1) extra space, with one sentence on why that is too slow for a million IDs.
Step 4 · Improve it and talk through the trade-off
Ask yourself what work the slow version repeats. Here, it re-reads the earlier IDs again and again. If you remembered every ID you have already seen, you could answer "have I seen this before?" in one step.
Tolu: The slow part is scanning backwards each time. If I keep a set of IDs I have seen, checking membership is constant time on average. So I walk the list once: if the ID is in the set, return it; otherwise add it. That is O(n) time. The cost is memory: the set can grow to hold every ID, so O(n) extra space. For a million integers that is fine on a normal server. If memory were very tight I could sort the list in place, which takes O(n log n) time but needs no set. I would be changing the input, though, which goes back to my earlier question about whether that is allowed, and sorting loses the arrival order, so I could not tell which repeat came first without extra work. I will go with the set.
Name both sides: what you gain (time), what you pay (memory), and what the alternative would cost. If Big-O still feels shaky, work through estimate how code slows down with Big-O before your next practice session. In the interview you only need to be clear about the order of growth, not exact counts.
Check it worked
Heading 5 names the set-based approach, gives O(n) time and O(n) extra space, and has one sentence on a rejected alternative and why you rejected it.
Step 5 · Write the code while you narrate
Talk in short phrases as you type, about what each line is for, not what the syntax is. Silence for a minute is fine when you are concentrating; say so ("give me a moment to write the loop") so the interviewer knows you have not frozen.
def first_repeat(order_ids):
seen = set()
for order_id in order_ids:
if order_id in seen:
return order_id
seen.add(order_id)
return NoneTolu: A set for IDs I have passed. Walk the list once. If I have seen this one, it is the earliest second copy, so return it straight away. Otherwise remember it. If the loop ends, nothing repeated, so None.
Use clear names (seen, order_id) rather than s and x. The interviewer reads your code while you talk, and good names save you explaining.
Check it worked
Heading 6 holds your code, and you can read each line out loud with a one-phrase reason for it. Record yourself doing that once and play it back: there should be no line you skip because you cannot explain it.
Step 6 · Test it by hand with your examples
Do not say "I think that works". Run your own examples through the code, out loud, tracking what each variable holds. Start with the normal case, then the edge cases from Step 2.
For [7, 3, 9, 3, 7]:
order_id in seen? seen afterwards result
7 no {7} keep going
3 no {7, 3} keep going
9 no {7, 3, 9} keep going
3 yes (unchanged) return 3Then the edge cases: [] skips the loop and returns None; [5] adds 5 and returns None; [4, 4] returns 4 on the second item. All four match the expected answers you wrote earlier.
Tolu: All four match. One more I want to try is a long list with no repeats, which is the worst case: the loop runs n times and the set ends with n items, which is the O(n) time and space I said.
If a trace does not match, say so calmly and fix the line. Finding your own bug by testing scores better than never finding it.
Check it worked
Heading 7 has a trace table for one normal example and a one-line result for each edge case, and every result matches the expected answer from heading 3.
Step 7 · Recover when you get stuck
Everyone gets stuck in some round. What you say next is scored. Keep a few honest phrases ready, and use them instead of going quiet:
- Go back to an example. "Let me try this on a small input by hand and see what I am actually doing." Most stuck moments clear when you do the task manually on three or four items.
- Say where you are. "I have the loop working. What I am unsure about is how to handle the case where the list is empty."
- Simplify the problem. "Let me solve it first assuming the IDs are already sorted, then remove that assumption."
- Ask for a nudge, with a reason. "I have tried a set and sorting. Am I missing a property of the input I should use?" A hint taken well rarely sinks a round; a long silence often does.
- Fall back to the slow version. "I will finish the O(n²) version so we have something correct, then come back to the faster one if there is time."
Practise this on purpose. In your next session, pick a problem slightly above your level, set a timer for 25 minutes, record yourself, and when you get stuck, use one of these phrases out loud. Write which one you used, and what happened next, under heading 8.
Check it worked
Heading 8 of at least one entry quotes the exact sentence you said when you got stuck and one line on what unblocked you.
Step 8 · Build a practice plan around patterns
Solving hundreds of random problems is slow and teaches less than you would hope. Most interview problems reuse a small set of techniques. Practise by pattern: solve one or two problems per pattern, out loud, and write down how you recognised it.
A starting set of patterns for junior roles:
- Look-up with a set or map. "Have I seen this before?" or "how many times?" The order IDs problem is one.
- Two pointers. Two positions moving through a sorted list or a string, for pairs that meet a condition or reversing in place.
- Sliding window. The best run of consecutive items, such as the longest stretch of days under a spending limit.
- Stack. Matching brackets, undo history, or "the most recent unmatched item".
- Binary search. Finding a value or a boundary in sorted data in O(log n).
Pick one problem for each pattern from any practice site or book you use, and work each through all nine headings of your log, out loud and recorded. Aim for one problem per sitting rather than five in a night. Revisit an entry a week later and solve it again from the problem statement alone; if you cannot, the pattern is not yet yours.
Some companies run the round as pair programming instead: you work in a small real codebase, extend a function or fix a failing test, and the interviewer acts as a colleague. The same habits apply. Read the existing code out loud before you change it, ask how they would like you to work ("should I run the tests as I go?"), take their suggestions as a teammate would, and narrate small commits of progress. Ask the recruiter beforehand which format, language and editor to expect.
In Nigeria and across Africa: many rounds for remote roles happen over video on a home connection. Before the day, top up enough mobile data for a full call plus a margin, keep a phone hotspot ready as a backup, and agree with the interviewer at the start what you will do if the call drops ("I will rejoin the same link within two minutes"). If English is not the language you think in, it is fine to talk more slowly and to use short sentences; clarity scores, speed does not.
Check it worked
Your practice log has five entries, one per pattern, and every entry has heading 2 filled with at least two clarifying questions and heading 7 filled with a hand-run test whose result matches the expected answer.
Next steps
Before your next practice session, play back one recording and note under heading 9 the place where you went quiet for longest.
If the Big-O parts of your entries felt like guesses, work through estimate how code slows down with Big-O. To fit this round into the full hiring process, see prepare for each stage of a tech interview. If the company sends a take-home task instead of a live round, read complete a take-home test without overdoing it, and for backend and full-stack roles that add a design round, try answer a system design interview question as a junior developer.
Related tutorials
- Estimate how code slows down as data grows: Big-O by experimentYou will time four Python functions on 1,000, 10,000 and 100,000 items, sort them into O(1), O(n) and O(n²) from your own numbers, and rewrite a slow duplicate finder so it scales.
- Prepare for each stage of a tech interviewYou will map the hiring process for one real application and finish with a prep sheet holding company research, six timed interview stories, a practice plan for your skills round, questions to ask and a follow-up note.
- Complete a take-home test without overdoing itYou will turn a take-home brief into a timeboxed plan, cover every must-have before any polish, and submit with a README a reviewer can follow to run your work in under five minutes.
Need this done for you?
Padding does this work for growing companies, from the first diagnosis to a system that keeps working.
Get new tutorials