Software engineer interview questions and answers

Software engineering interviews usually mix coding problems, a design conversation and behavioral questions. Below are the questions that come up most often, what each one is really testing, and how to structure a strong answer.

Technical and coding questions

  • Walk me through how you would find duplicates in a large list. — What they're looking for: whether you clarify constraints and reason about time and space trade-offs. Strong answer outline: ask about input size and memory, start with a hash set for O(n) time, mention sorting as an O(n log n) option that uses less extra memory, and test edge cases out loud.
  • Explain the difference between a process and a thread. — What they're looking for: solid fundamentals, not textbook recitation. Strong answer outline: processes have separate memory spaces; threads share memory within a process, so they are cheaper to create but need synchronization; give a real example of a race condition you have seen or prevented.
  • How would you design a URL shortener? — What they're looking for: structured thinking about requirements, data model and scale. Strong answer outline: confirm read/write ratio and features, propose an ID generation scheme, a key-value store, caching for hot links, and discuss collisions, analytics and expiry.
  • What happens when you type a URL into a browser and press Enter? — What they're looking for: breadth across the stack. Strong answer outline: DNS lookup, TCP and TLS handshakes, HTTP request, server processing, response, then parsing HTML, loading assets and rendering; go deeper wherever the interviewer shows interest.

Behavioral questions

  • Tell me about a bug that was hard to track down. — What they're looking for: a methodical debugging process and ownership. Strong answer outline: describe the symptom, how you narrowed it down (logs, reproduction, bisecting), the root cause, the fix, and what you changed so it would not recur.
  • Describe a time you disagreed with a technical decision. — What they're looking for: whether you can push back with evidence and then commit. Strong answer outline: state the decision, the data you brought, how you discussed it respectfully, and the outcome, including if you were overruled.
  • Tell me about a project you are proud of. — What they're looking for: your specific contribution and impact. Strong answer outline: one or two sentences of context, the hardest problem you personally solved, and a measurable or observable result.

Situational questions

  • A production service is returning errors right after your deploy. What do you do? — What they're looking for: calm prioritization of users over ego. Strong answer outline: roll back or disable the change first, communicate status, then investigate with logs and metrics, and write a blameless postmortem.
  • You inherit a codebase with no tests. How do you start? — What they're looking for: pragmatism. Strong answer outline: add tests around the code you need to change first, prioritize critical paths, and improve coverage gradually instead of proposing a rewrite.

Questions to ask the interviewer

  • How does code get from a pull request to production here?
  • What does the on-call rotation look like, and how are incidents reviewed?
  • What would a successful first 90 days look like for this role?

How to prepare

  • Practice solving problems out loud, explaining your reasoning before you write code.
  • Review core data structures (arrays, hash maps, trees, graphs, heaps) and their typical complexities.
  • Sketch two or three system designs you know well, including where they would break at higher scale.
  • Prepare four or five stories from your work that you can adapt to different behavioral questions.
  • Read the company's engineering blog or public repositories to learn their stack and challenges.

Sample answer: "Tell me about a hard bug you fixed"

This is the behavioral question engineers hear most. Here is a STAR-format answer you can adapt to your own experience.

Situation: Our checkout API started timing out for a small share of users, but only during peak hours, and we could not reproduce it locally. Task: As the engineer on call, I owned finding the cause before the weekend sale. Action: I added request-level tracing, compared slow and fast requests, and noticed the slow ones all hit a database query that was missing an index on a recently added column. Under load, it was scanning the full table. I added the index in a migration, load-tested it in staging, and added an alert on query latency. Result: Timeouts stopped after the deploy, and the new alert caught a similar regression two months later before customers noticed. I also wrote up the investigation so the team could reuse the tracing approach.

Frequently asked questions

How many rounds are typical in a software engineer interview?

It varies by company, but a common pattern is a recruiter screen, one or two technical screens, and a final loop with coding, system design and behavioral interviews. Ask the recruiter for the format so you can prepare for each part.

Should I use a specific programming language in coding interviews?

Use the language you are most fluent in unless the job requires a specific one. Interviewers care more about clear reasoning and correct code than about the language itself.

What if I get stuck on a coding question?

Say what you are thinking, describe a simpler or brute-force approach, and ask clarifying questions. Showing how you work through being stuck is part of what is being evaluated.