Interview questions

Programmer Interview Questions

19 programmer interview questions on coding fundamentals, debugging, code quality and teamwork, with what strong answers include. For both sides.

Programmer Interview Questions

What's here

19 Programmer interview questions, grouped into 4 areas: programming fundamentals, problem-solving and debugging, code quality and tools and teamwork and situational questions. Each one comes with why it is worth asking and what a strong answer contains, so the same question can be scored the same way by different interviewers.

  • Use a practical coding exercise in the language and type of work the role involves, rather than puzzle questions
  • Score the candidate's process: clarifying questions, testing and how they recover from mistakes
  • Ask candidates to walk through code they wrote and explain the trade-offs
For hiring teams

Cohesyve finds, contacts and tests Programmer candidates on the real work, then ranks them for these interviews. 14-day free trial for 10 candidates, not charged until it ends.

Preparing for this interview yourself? Practise it free →

Programmers write, test, debug and maintain the code that runs applications and systems. Whatever the language, the job rests on the same skills: breaking a problem into steps, writing clear and correct code, finding and fixing bugs, and working with others through version control and code review. These programmer interview questions test those fundamentals for junior to mid-level roles. Interviewers can use the 'what to look for' notes as a scoring guide; candidates can use them to see what a strong answer includes.

Programming Fundamentals

Core concepts that apply across languages.

  1. 1

    Explain the difference between an array and a linked list. When would you use each?

    Why ask it

    Tests understanding of basic data structures and trade-offs.

    What to look for

    Arrays give fast index access and good memory locality; linked lists make insertion and removal cheaper at known positions but need traversal to find items. A sensible example of when each fits, and awareness that in practice dynamic arrays are often the default.
  2. 2

    What is a hash map and how does it work at a high level?

    Why ask it

    Hash maps are used everywhere.

    What to look for

    Keys hashed to buckets, typical constant-time lookup, collisions and how they are handled, and the need for good hash functions and stable keys.
  3. 3

    How do you think about the time and space complexity of your code?

    Why ask it

    Shows whether the candidate can reason about performance.

    What to look for

    Using Big O notation correctly for simple examples, spotting nested loops, and balancing complexity against readability and real data sizes.
  4. 4

    Explain recursion and give an example where it is a good fit.

    Why ask it

    Tests comfort with a common technique.

    What to look for

    Base case and recursive case, examples like tree traversal, and awareness of stack depth limits and when iteration is better.
  5. 5

    What does it mean for code to be object-oriented or functional? Which do you prefer and why?

    Why ask it

    Reveals breadth and the ability to reason about design.

    What to look for

    Encapsulation, inheritance and polymorphism versus pure functions, immutability and composition. A pragmatic view that uses each where it fits.
For hiring teams

Before the Programmer interviews, see who can do the work

Cohesyve finds and contacts Programmer candidates from your job description and tests each one on an AI job simulation of the role, so these questions go to a ranked shortlist. 14-day free trial for 10 candidates, not charged until it ends.

Problem-Solving and Debugging

How the candidate approaches unfamiliar problems and broken code.

  1. 6

    Talk me through how you approach a coding problem you have not seen before.

    Why ask it

    Process matters more than memorised answers.

    What to look for

    Clarifying requirements and edge cases, working an example by hand, starting with a simple solution, then improving it, and testing as they go. Thinking aloud.
  2. 7

    Describe the hardest bug you have fixed. How did you find it?

    Why ask it

    Debugging is a large part of the job.

    What to look for

    Reproducing the bug, narrowing it down with logs, a debugger or by bisecting changes, forming and testing hypotheses, fixing the root cause and adding a test to prevent regression.
  3. 8

    Your code works on your machine but fails in the test environment. What do you check?

    Why ask it

    Environment issues are common and frustrating.

    What to look for

    Configuration and environment variables, dependency versions, data differences, file paths, permissions, time zones and concurrency. A systematic approach.
  4. 9

    How do you handle errors and edge cases in your code?

    Why ask it

    Robust code anticipates failure.

    What to look for

    Validating inputs, handling expected errors clearly, failing loudly on unexpected ones, useful error messages and logs, and tests for edge cases such as empty, null and very large inputs.

Code Quality and Tools

Writing code that others can read, test and change.

  1. 10

    What makes code easy to maintain?

    Why ask it

    Most code is read far more often than it is written.

    What to look for

    Clear names, small functions with one job, consistent style, avoiding duplication sensibly, comments that explain why, and tests that document behaviour.
  2. 11

    How do you test your code?

    Why ask it

    Testing habits predict quality.

    What to look for

    Unit tests for logic, integration tests for components working together, testing edge cases, running tests before committing, and an understanding of what not to over-test.
  3. 12

    How do you use Git day to day?

    Why ask it

    Version control is essential for team work.

    What to look for

    Branching, small focused commits with clear messages, pull requests, resolving merge conflicts, and never rewriting shared history carelessly.
  4. 13

    What do you look for when reviewing someone else's code, and how do you take feedback on yours?

    Why ask it

    Code review is both a quality and a teamwork skill.

    What to look for

    Correctness, readability, tests, security and performance concerns, kind and specific comments; and receiving feedback without defensiveness.
  5. 14

    How do you keep your code secure?

    Why ask it

    Security flaws often start with ordinary code.

    What to look for

    Validating and sanitising input, parameterised queries, not hard-coding secrets, keeping dependencies updated, and following least privilege.

Teamwork and Situational Questions

Working with others and making sensible calls.

  1. 15

    You are given a task with unclear requirements. What do you do?

    Why ask it

    Ambiguity is normal in real work.

    What to look for

    Asking clarifying questions early, writing down assumptions, building a small version to get feedback, and confirming before investing heavily.
  2. 16

    You realise you will miss a deadline. How do you handle it?

    Why ask it

    Tests honesty and communication.

    What to look for

    Telling the lead early, explaining why, offering options such as reduced scope, and learning to estimate better.
  3. 17

    How do you learn a new language or framework quickly?

    Why ask it

    Programmers constantly learn new tools.

    What to look for

    Official documentation, building something small, reading existing code, and asking colleagues. A recent concrete example.
  4. 18

    You find a bug in code a senior colleague wrote. What do you do?

    Why ask it

    Tests professional confidence and tact.

    What to look for

    Confirming the bug with a reproduction, raising it respectfully with evidence, proposing a fix, and following the team's process.
  5. 19

    Tell me about a project you built that you are proud of.

    Why ask it

    Shows passion, ownership and depth.

    What to look for

    Clear explanation of the problem, technical choices and trade-offs, what they personally built, and what they would improve.

Running the interview well

  • 1Use a practical coding exercise in the language and type of work the role involves, rather than puzzle questions
  • 2Score the candidate's process: clarifying questions, testing and how they recover from mistakes
  • 3Ask candidates to walk through code they wrote and explain the trade-offs
  • 4Include a short debugging task; it often reveals more than writing new code
  • 5Keep take-home tasks short and respect candidates' time
  • 6For junior roles, weigh learning ability and fundamentals above specific framework experience
  • 7Have the same exercise and scoring rubric for every candidate to compare fairly

Common questions

What are common programmer interview questions?

Expect questions on data structures, algorithms and complexity, debugging, testing, code quality, version control and working in a team. Many interviews include a live coding exercise or a take-home task.

How do I prepare for a programming interview?

Practise solving problems out loud in your main language, review core data structures and complexity, and prepare to explain a project you built in detail. Practise debugging as well as writing new code, and be ready to talk about how you test.

What is the difference between a programmer and a software engineer?

The titles overlap and many companies use them interchangeably. Where they differ, software engineer roles tend to include more system design, architecture and ownership of the full development process, while programmer roles focus more on writing and maintaining code.

Which programming language should I use in a coding interview?

Use the language you know best unless the job requires a specific one. Interviewers care most about clear reasoning, correct code and good testing habits.

What questions should I ask at the end of a programmer interview?

Ask about the codebase and tech stack, how code review and testing work, how work is planned, how new starters are supported, and what a typical week looks like.

What do interviewers look for in a programmer?

Solid fundamentals, structured problem-solving, clean and tested code, good debugging habits, clear communication and the ability to learn quickly.

For hiring teams

Save these questions for the Programmer candidates who can do the work

Cohesyve takes your Programmer job description, finds candidates, reaches out to them and runs an AI job simulation of the real work, then returns a ranked shortlist.

1,500+

assessments completed

50%

faster time-to-hire

5 min

from JD to assessment

14-day free trial · 10 candidates · Not charged until the trial ends

For job seekers

Preparing for a Programmer interview yourself? Practise on an AI job simulation of the role. 3-day free trial, cancel anytime.

Practise a Programmer interview free →

See Cohesyve in action

Free 30-min walkthrough

See it on your role