20 interview questions
Software engineer interview questions and answers
Software engineer interviews usually mix live coding, a design discussion and behavioral questions about how you build and ship. Interviewers care as much about how you reason out loud as about the final answer. The questions below cover the topics that come up in most loops, with the substance a strong answer needs.
Updated
Coding and problem solving
01Given an array of integers and a target, return the indices of two numbers that add up to the target.
What they want to hear: Whether you move from a brute force idea to a better one and can explain the time and space cost of each.
Answer outline
- Clarify: can there be duplicates, is there always exactly one answer, can the same element be used twice?
- Brute force: check every pair, O(n^2) time, O(1) space.
- Better: one pass with a hash map from value to index; for each x, check whether target - x is already in the map, then store x.
- That gives O(n) time and O(n) space. Test with duplicates and negative numbers.
02How do you approach a coding problem you have never seen before?
What they want to hear: A repeatable method under pressure. They want to see you clarify, plan and test rather than type immediately.
Answer outline
- Restate the problem and ask about inputs, sizes and edge cases.
- Work a small example by hand and name a brute force solution first.
- Look for the bottleneck and a structure that removes it (hash map, sort, two pointers, heap).
- Code it cleanly, then trace through your example and edge cases before saying you are done.
03Explain Big O notation. What is the complexity of your solution?
What they want to hear: That you can reason about how code behaves as input grows, not just recite a definition.
Answer outline
- Big O describes how time or memory grows with input size, as an upper bound that ignores constants.
- Common classes: O(1), O(log n) for binary search, O(n) for a single pass, O(n log n) for comparison sorting, O(n^2) for nested loops.
- State both time and space for your solution and point to the line that dominates.
- Mention when constants or average versus worst case matter in practice, such as hash map collisions.
04Reverse a singly linked list.
What they want to hear: Pointer handling without losing nodes, plus whether you can do it iteratively and explain the recursive version.
Answer outline
- Keep three references: prev (starts null), current (starts at head) and next.
- Loop: save next = current.next, point current.next to prev, move prev to current, move current to next.
- When current is null, prev is the new head. O(n) time, O(1) space.
- Mention the recursive version uses O(n) stack space, and test with empty and single-node lists.
05When would you use recursion, and what are its risks?
What they want to hear: Judgment about a tool, not just knowing what it is.
Answer outline
- Recursion fits problems that split into smaller copies of themselves: trees, divide and conquer, backtracking.
- Every recursive solution needs a base case and progress toward it.
- Risks: stack overflow on deep inputs and repeated work on overlapping subproblems.
- Fixes: memoization or bottom-up dynamic programming, or an explicit stack to make it iterative.
Data structures and fundamentals
06How does a hash map work, and what happens on a collision?
What they want to hear: Whether you understand the structure you use most, including why it is usually but not always O(1).
Answer outline
- A hash function maps a key to a bucket index in an array.
- Collisions are handled by chaining (a list per bucket) or open addressing (probing for another slot).
- When the load factor gets too high the table resizes and rehashes, which is why inserts are amortised O(1).
- Worst case degrades toward O(n) with a poor hash function or many collisions.
07What is the difference between an array and a linked list?
What they want to hear: That you pick structures by their access patterns, not by habit.
Answer outline
- Array: contiguous memory, O(1) access by index, cache friendly, inserts in the middle cost O(n).
- Linked list: nodes with pointers, O(n) access by position, O(1) insert or delete once you hold the node.
- In practice arrays and dynamic arrays win most of the time because of cache locality.
- Give a case for each: arrays for lookups and iteration, linked lists for queues or LRU caches with a hash map.
08Explain the difference between a process and a thread.
What they want to hear: Basic systems knowledge that matters when you debug performance or concurrency issues.
Answer outline
- A process has its own memory space; a thread runs inside a process and shares its memory.
- Threads are cheaper to create and switch, but shared memory brings race conditions.
- Processes are isolated, so a crash in one does not take down the others.
- Mention synchronisation tools: locks, atomics, queues, and the risk of deadlock.
09What happens when you type a URL into a browser and press enter?
What they want to hear: Breadth across the stack and the ability to go deeper where the interviewer pushes.
Answer outline
- DNS resolves the domain to an IP address, using caches along the way.
- The browser opens a TCP connection (or QUIC for HTTP/3) and negotiates TLS for HTTPS.
- It sends an HTTP request; servers, load balancers or a CDN return a response.
- The browser parses HTML, fetches CSS, JavaScript and images, builds the DOM and renders the page.
Design and code quality
10How would you design a URL shortener at a high level?
What they want to hear: Whether you can structure an open problem: requirements first, then a simple design, then scale.
Answer outline
- Clarify requirements: create short links, redirect fast, maybe custom aliases and expiry.
- Generate keys with a counter encoded in base62 or a random string with a collision check.
- Store key to URL in a key-value store; redirects are read-heavy, so put a cache in front.
- Discuss scale, analytics as an async pipeline, and abuse prevention.
11What makes code easy to maintain?
What they want to hear: Your standards and whether you write for the next person who reads the code.
Answer outline
- Clear names and small functions that do one thing.
- Tests that describe behaviour and make refactoring safe.
- Simple designs over clever ones; abstractions added when there is real duplication.
- Give an example of code you improved and what it made easier.
12How do you decide what to test, and how?
What they want to hear: A practical testing strategy rather than 'I aim for 100% coverage'.
Answer outline
- Unit tests for logic with many branches, fast and isolated.
- Integration tests for boundaries: database, external APIs, queues.
- A few end-to-end tests for the most important user flows.
- Prioritise by risk: what breaks most often or costs most when it breaks.
13What do you look for when reviewing someone else's code?
What they want to hear: That code review for you is about correctness and shared understanding, not style policing.
Answer outline
- Correctness first: edge cases, error handling, concurrency and security issues.
- Then design: does it fit the codebase, is it simpler than it could be?
- Leave style to linters and formatters.
- Write comments as questions or suggestions, and approve when it is good enough, not perfect.
Debugging and production
14Walk me through how you would debug a bug you cannot reproduce locally.
What they want to hear: A systematic method under uncertainty, and comfort with logs, metrics and hypotheses.
Answer outline
- Collect facts: when it started, who is affected, error messages, recent deploys.
- Compare environments: data, configuration, versions, load, timing.
- Add targeted logging or tracing to test one hypothesis at a time.
- Once found, fix it, add a test that would have caught it, and write down what you learned.
15Tell me about the hardest bug you have fixed.
What they want to hear: Depth and persistence, and whether you can explain a technical story clearly to another engineer.
Answer outline (STAR)
- The symptom and why it was hard to pin down.
- The hypotheses you tested and what ruled each one out.
- The root cause and the fix.
- What you changed afterwards so it would not happen again.
16A service you own is slow in production. What do you do?
What they want to hear: That you measure before you optimise and think about users while you investigate.
Answer outline
- Check impact first: which endpoints, which users, since when, and whether to roll back.
- Use metrics and traces to find where time is spent: database, external calls, CPU, locks.
- Look at common causes: missing index, N+1 queries, a cold cache, a recent change.
- Fix the bottleneck, confirm with the same metrics, and add an alert if one was missing.
Working as an engineer
17Tell me about a project you are proud of.
What they want to hear: Your scope, the decisions you personally made and whether you understand the impact of your work.
Answer outline (STAR)
- The problem and who it mattered to.
- Your role and the key technical decision you made, with the alternative you rejected.
- The outcome in numbers: latency, errors, revenue, time saved.
- What you would do differently now.
18Describe a time you disagreed with a technical decision.
What they want to hear: Whether you argue with evidence and then commit, even when you do not get your way.
Answer outline (STAR)
- The decision and why you disagreed.
- How you made your case: data, a prototype, a written proposal.
- What was decided and how you supported it.
- How it turned out and what you learned.
19Tell me about a time you had to ship with a deadline and cut scope.
What they want to hear: Pragmatism: shipping something useful on time while being honest about trade-offs.
Answer outline (STAR)
- The deadline and what was at stake.
- What you cut, what you kept, and how you agreed it with the product owner.
- How you tracked the technical debt you took on.
- The result and whether you paid the debt back.
20How do you keep your technical skills current?
What they want to hear: Real learning habits, connected to your work, not a list of newsletters.
Answer outline
- Name one recent thing you learned and why.
- Show how you applied it at work or in a side project.
- Mention how you share what you learn with your team.
How to prepare
- Practise coding problems out loud, not just in your head. In the interview, silence for five minutes is harder to read than a wrong first idea explained well.
- Review the core patterns: hash maps, two pointers, sliding window, BFS and DFS, binary search, heaps and basic dynamic programming.
- Prepare two projects you can explain at three levels: one sentence, two minutes, and a deep dive into one design decision.
- Always test your code by tracing a small example and the edge cases before you say you are finished.
- Read the job description for the stack and seniority, and adjust how much design depth you prepare.
Practice these questions out loud with NORDON
Reading answers is not the same as saying them. NORDON's interview practice asks you questions written for the role, listens to your spoken answer and shows you how to make it stronger.
- Upload your CV in the Knowledge base, so questions and feedback use your real background.
- Open Practice, enter the role (for example software engineer), paste the job ad if you have it, and choose 3, 5, 8 or 10 questions and the answer language.
- Listen to each question and answer out loud, as you would in the room. You can also type an answer.
- Get a score from 1 to 10, what worked, what to improve and a stronger answer to rehearse. It uses only what you said and your documents, and leaves a [placeholder] where a fact about you is missing.
- Try the question again, or move on. For a dress rehearsal, run a mock call where an interviewer voice asks the questions out loud.
The free plan includes 10 scored practice answers a month and mock calls of up to 10 minutes, no card needed. Paid plans include more practice and mock calls of up to 30 minutes. How practice works
Practice is for preparing. Use live help in a real interview only where the interviewer allows AI assistance, never in an interview, test or assessment whose rules forbid it.
Preparing for your software engineer interview
What does a software engineer interview process usually look like?
It often starts with a recruiter call and a technical screen, then a set of interviews covering coding, system design for mid-level and senior roles, and behavioral questions. The number of rounds varies a lot between companies, so ask the recruiter for the format.
Which programming language should I use in a coding interview?
Use the language you know best unless the role requires a specific one. Interviewers care more about clear logic and correct complexity than the language itself.
How should I prepare for a take-home assignment?
Read the brief twice, ask questions if anything is unclear, and keep the solution simple. Include tests, a short README with how to run it, and a note on trade-offs you made because of the time limit.