Coding interview: the questions interviewers ask
A coding round gives you a small problem and asks you to solve it by writing code or pseudocode while explaining your thinking. Interviewers mostly check how you break a problem down, whether your logic is correct and how you handle edge cases, more than the exact syntax.
Every interview asks different questions. Use the examples below to see the kind of question to expect, then learn the idea behind each one instead of memorising answers.
Questions interviewers commonly ask
- Reverse a string without using a built-in reverse.
- Check whether a sentence is a palindrome, ignoring case and punctuation.
- Find the second largest number in a list in one pass.
- Count how often each word appears in a sentence.
- Find two numbers in a list that add up to a target.
- Check whether a string of brackets is balanced.
- Find the first non-repeating character in a string.
- Merge two sorted lists into one sorted list.
- Search a sorted list faster than checking every item.
- Find the largest sum of a contiguous part of a list.
Get a coding problem, write your solution in pseudocode or any language, and get an AI review of your logic, the edge cases you missed and what to study next. No sign-up needed.
Try a coding questionSign up freeWhat interviewers are looking for
- Restate the problem and ask about edge cases before writing anything.
- Start with a simple working approach, then improve it.
- Think aloud: interviewers are scoring your reasoning as much as the answer.
- Trace your solution by hand on a small example and on an empty or single-item input.
- Know the speed and memory cost of your solution (for example O(n)).
What to expect in the round
- A short problem is read out or shown
- You clarify the problem and talk through an approach
- You write code or pseudocode
- You test it on an example and on edge cases
- The interviewer asks about speed and memory, and for improvements
What to learn and practise
- Answer out loud, not only in your head. Speaking is a skill that improves only by speaking.
- Use a simple shape: the point first, then a short example, then what happened or what you learned.
- Record yourself, listen back, and fix one thing at a time (pace, filler words, structure).
- Practise with a timer so your answers fit the time you will really have.
Common questions
Use the one you know best. Most rounds accept any common language, and many accept clear pseudocode.
Whether you handle edge cases, explain your thinking, and know the speed and memory cost of your solution.
Strings, arrays, hash maps (dictionaries), stacks, two pointers and binary search cover a large share of beginner and fresher rounds.