ShortlistOne
Interview guide

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

  1. Reverse a string without using a built-in reverse.
  2. Check whether a sentence is a palindrome, ignoring case and punctuation.
  3. Find the second largest number in a list in one pass.
  4. Count how often each word appears in a sentence.
  5. Find two numbers in a list that add up to a target.
  6. Check whether a string of brackets is balanced.
  7. Find the first non-repeating character in a string.
  8. Merge two sorted lists into one sorted list.
  9. Search a sorted list faster than checking every item.
  10. Find the largest sum of a contiguous part of a list.
These are practice prompts written by us to show the kinds of questions asked. They are not real exam papers.
Try a Coding interview question, free

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 free

What 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

Common questions

Which language should I use?

Use the one you know best. Most rounds accept any common language, and many accept clear pseudocode.

What do interviewers check besides correctness?

Whether you handle edge cases, explain your thinking, and know the speed and memory cost of your solution.

What should I learn first?

Strings, arrays, hash maps (dictionaries), stacks, two pointers and binary search cover a large share of beginner and fresher rounds.

More guides

Job interviewSee the questions →Fresher and campus interviewSee the questions →HR interviewSee the questions →IELTS speakingSee the questions →TOEFL speakingSee the questions →UPSC personality testSee the questions →