# Software engineer interview questions

Canonical: https://www.apply4me.io/en/interview-questions/software-engineer

A software engineering interview usually has two halves: a conversation about your past work and a technical round (fundamentals, a live coding exercise, a take-home task or a system design discussion). Interviewers are checking how you reason out loud and whether you understand the trade-offs in your own code, not just whether you reach the right answer.

## 8 questions with sample answers

1. ### Walk me through a project you're proud of.
   Sample answer
   Situation: our online shop processes 20,000 orders a month, and payments failed whenever the provider was slow to respond. Task: as owner of the payments module, I had to stop the failures without risking double charges. Action: I moved retries onto a queue and added idempotency keys so a retry could never charge twice. Result: failed checkouts dropped from 2% to 0.3%, and I learned more about error handling in distributed systems than on any other project.
   What the interviewer is checking: Whether you can explain the problem, your part and a measurable result, and why that solution beat the alternatives.
2. ### What happens when you type a URL into a browser and press Enter?
   Sample answer
   The browser resolves the domain to an IP address through DNS, opens a TCP connection and negotiates TLS, then sends an HTTP request. The server returns HTML, and the browser parses it into the DOM, fetches CSS and JavaScript, calculates layout and paints the page. I'm happy to go deeper on any step, such as DNS caching or HTTP/2 multiplexing.
   What the interviewer is checking: Breadth of fundamentals. Expect a follow-up on one step to see where your knowledge stops.
3. ### How do you debug a problem that only happens in production?
   Sample answer
   I start with logs and metrics: when it began, which release, which users. Then I narrow the scope and add targeted logging if I need more signal. Once I can reproduce it locally with production-like data, I write a failing test first and only then fix the code, so the bug can't quietly come back.
   What the interviewer is checking: A method rather than guesswork, and whether a regression test is part of your fix.
4. ### How do you approach testing?
   Sample answer
   Most of my tests are unit tests around business logic, fewer are integration tests against the database and API, and a handful of end-to-end tests cover critical paths like checkout. I test behaviour rather than implementation so refactoring doesn't break the suite. Every bug report starts with a test that reproduces it.
   What the interviewer is checking: Whether you know the testing pyramid and treat tests as part of the work, not an afterthought.
5. ### How would you design a URL shortener?
   Sample answer
   I'd start by clarifying scale: say 100 million new links a month and far more reads than writes. Writes generate a short key, base62 from a counter or a hash with collision checks, and store it in a key-value store. Reads go through a cache in front of the database, since a small share of links get most of the traffic. Then I'd cover analytics, expiry and abuse prevention if time allows.
   What the interviewer is checking: Whether you ask about requirements before drawing boxes, and whether you can reason about reads, writes and bottlenecks.
6. ### SQL or NoSQL: how do you choose?
   Sample answer
   For related data that needs consistency, like orders and payments, I reach for a relational database such as PostgreSQL: schemas, transactions and joins. NoSQL fits flexible structures, very high write volumes or caching. On most projects I start relational and add another store only when a specific need appears.
   What the interviewer is checking: That you justify technical choices by the project's needs, not by what is fashionable.
7. ### What does a good code review look like to you?
   Sample answer
   I open small pull requests with a clear description of what changed and why. When reviewing, I focus on logic, readability, security and tests, and leave formatting to the linter. I phrase comments as questions or suggestions, and I treat feedback on my own code as a way to get a better result, not as criticism.
   What the interviewer is checking: How you collaborate, and whether you can take feedback without getting defensive.
8. ### What do you do when you get stuck in a live coding exercise?
   Sample answer
   I say out loud what I understand from the problem and ask about edge cases. I get a simple working version first and improve it after. If I can't remember a library function, I say what I'd look up in the docs and keep moving rather than going silent.
   What the interviewer is checking: Your thinking and communication under pressure. Ten minutes of silence lands worse than an unfinished solution you explained well.

## How to prepare

- Go through every technology in the job posting and prepare one example from your own work for each.
- Practise two or three algorithm problems out loud, narrating each step as you go.
- Reopen your main repository or portfolio and remind yourself why each key decision was made.
- Sketch one system design end to end: requirements, data model, API, scaling and failure modes.

## Questions to ask the interviewer

- How does a change get from a pull request to production here?
- How much time does the team spend on technical debt?
- What would my first month look like?
