Interview questions
New Grad Backend Engineer Interview Questions
Backend engineering interviews for new grads test whether you can translate CS fundamentals into working, reasoned code — not whether you have production war stories. Expect heavy emphasis on data structures, algorithms, and basic system awareness, with some questions probing how you think about correctness and edge cases. Companies know you're fresh; they're evaluating ceiling and coachability, not years of experience.
What to expect
A typical new grad backend loop runs 4–5 rounds: one or two coding rounds (LeetCode-style, medium difficulty, occasionally easy-hard), one system design or system fundamentals round (scaled way down — think 'design a URL shortener' not 'design YouTube'), one behavioral round, and sometimes a language/runtime knowledge screen. You won't be expected to have led projects or made architectural decisions at scale, but you should be able to reason about tradeoffs at a basic level, write clean correct code under time pressure, and explain your CS coursework fluently. Debugging and testing awareness is a differentiator at this level.
These are the questions every Backend Engineer gets.
Get questions tailored to your experience, answer them, and get honest feedback — free, no credit card.
Run a free fit check →12 questions, with how to answer them
Coding – Data Structures
1. Given a list of integers, find the two numbers that sum to a target value. Return their indices. Assume exactly one solution exists.
How to answer: Start with the brute-force O(n²) solution to show you understand the problem, then optimize to O(n) using a hash map: iterate once, storing each number's index; for each element, check if (target - current) is already in the map. Walk through an example with collisions or negative numbers to show edge-case awareness.
What they look for: Whether you reach the hash map solution without prompting, whether you articulate the time/space tradeoff explicitly, and whether you handle edge cases (duplicate values, negative numbers) before being asked.
Coding – Arrays & Sliding Window
2. Given a string, find the length of the longest substring without repeating characters.
How to answer: Use a sliding window with two pointers and a hash set (or hash map tracking last-seen index). Expand the right pointer; when a duplicate is found, shrink from the left until the duplicate is removed. O(n) time, O(k) space where k is the character set size. Be ready to trace through 'abcabcbb' and 'bbbbb' explicitly.
What they look for: Fluency with the sliding window pattern, correct pointer movement logic, and awareness that the naive nested-loop approach is O(n²). Interviewers watch whether you immediately reach for the right pattern or need significant hinting.
Coding – Recursion & Trees
3. Given a binary tree, write a function to return the maximum depth (height) of the tree.
How to answer: Recursive DFS is the natural fit: base case is null returns 0; recursive case is 1 + max(depth(left), depth(right)). Mention the iterative BFS alternative using a queue if asked for a follow-up. Discuss stack overflow risk on extremely deep trees as a real-world concern.
What they look for: Clean recursive thinking, correct base case handling, and the ability to trace through a small example. Bonus signal: unprompted mention of iterative fallback or tail recursion limits in your runtime environment.
Coding – Sorting & Searching
4. Implement binary search on a sorted array of integers. Then explain what changes if the array can contain duplicates and you need the first occurrence.
How to answer: Standard binary search: maintain lo and hi pointers, check mid, move lo or hi accordingly, return -1 if not found. For first occurrence with duplicates: when you find a match, don't return immediately — record the index, then continue searching left (hi = mid - 1). Walk through a case like [1,2,2,2,3] target=2.
What they look for: Correct off-by-one handling (a classic bug), clean loop termination condition, and whether you can adapt the algorithm for a variant without starting from scratch. This tests algorithmic thinking depth beyond rote memorization.
Coding – Linked Lists
5. Detect whether a singly linked list contains a cycle. If it does, return the node where the cycle begins.
How to answer: Floyd's cycle detection (tortoise and hare): fast pointer moves 2 steps, slow moves 1 step. If they meet, a cycle exists. To find the entry point: reset one pointer to head, advance both one step at a time — they meet at the cycle start. Prove why this works mathematically if asked (distance algebra). O(n) time, O(1) space.
What they look for: Knowledge of Floyd's algorithm beyond just cycle detection (finding the entry node is the harder part). Interviewers want to see you derive the 'reset to head' trick, not just recite it — they may ask you to explain why it works.
CS Fundamentals – Concurrency
6. What is a race condition? Give a concrete example and describe one way to prevent it.
How to answer: Define it precisely: a race condition occurs when program behavior depends on the relative timing of thread execution. Concrete example: two threads both read a counter (value=5), both increment locally, both write back — result is 6 instead of 7. Prevention: use a mutex/lock around the read-modify-write section, or use an atomic operation. Mention tradeoffs: locks can cause contention and deadlock if misused.
What they look for: Whether you can go beyond a textbook definition and give a concrete scenario. They want to see you understand why the bug is subtle (both reads succeed before either write), not just that 'threads are unsafe'.
CS Fundamentals – Databases
7. Explain what a database index is, when you'd add one, and what the downside of indexing every column would be.
How to answer: An index is a separate data structure (often a B-tree) that maps column values to row locations, making reads faster at the cost of extra storage and write overhead. Add an index on columns frequently used in WHERE clauses or JOIN conditions with high cardinality. Downside of over-indexing: every INSERT/UPDATE/DELETE must update all affected indexes, slowing writes; indexes also consume significant disk space.
What they look for: Understanding that indexes are a tradeoff, not a free lunch. New grads often know what indexes do but can't articulate the write-amplification cost. Being able to say 'high cardinality columns benefit most' shows practical depth.
CS Fundamentals – Networking
8. Walk through what happens, at a technical level, when you type 'https://example.com' into a browser and press Enter.
How to answer: Cover: DNS resolution (recursive lookup, caching), TCP handshake (SYN/SYN-ACK/ACK), TLS handshake (certificate verification, key exchange), HTTP request sent, server processes request (load balancer → app server → possibly database), HTTP response returned, browser renders. You won't be expected to go deep on every layer, but you should hit the major steps in order and be able to expand on whichever layer the interviewer probes.
What they look for: Breadth of systems awareness and ability to layer-by-layer decompose a familiar action. They're not expecting expert-level TLS knowledge; they want to see you think in systems and not skip the networking fundamentals taught in any OS/networking course.
System Design – Fundamentals
9. Design a URL shortening service (like bit.ly). Focus on the core components: how do you generate short codes, store mappings, and handle redirects?
How to answer: Define scope first: read-heavy, needs low-latency redirects, global? Core design: a key-value store (short_code → original_url), short code generation (base62 encoding of an auto-incremented ID, or hashing with collision handling), an API endpoint for creation and a redirect endpoint (HTTP 301 vs 302 and caching implications). Discuss where a cache (Redis) helps for hot URLs. Don't over-engineer — at your level, a clear simple design with sound reasoning beats a half-explained distributed one.
What they look for: Ability to scope a problem, identify the core data model, and reason about one or two real tradeoffs (301 vs 302 caching, ID generation uniqueness). They're not expecting consistent hashing or multi-region replication — they want structured thinking and correct fundamentals.
System Design – API Design
10. You're building a REST API for a simple to-do list app (create, read, update, delete tasks). Design the endpoints and explain your decisions.
How to answer: Propose standard REST conventions: POST /tasks (create), GET /tasks (list), GET /tasks/{id} (single task), PUT or PATCH /tasks/{id} (update), DELETE /tasks/{id} (delete). Discuss status codes (201 Created, 404 Not Found, 400 Bad Request). Mention pagination for the list endpoint. Distinguish PUT (full replacement) vs PATCH (partial update). Keep it grounded — don't over-engineer authentication unless asked.
What they look for: Whether you've internalized REST conventions rather than invented your own scheme. Correct HTTP verb usage, meaningful status codes, and the PUT vs PATCH distinction separate candidates who've built real APIs from those who've only read about them.
Behavioral
11. Tell me about a project — academic or personal — where something didn't go as planned. What happened and what did you do?
How to answer: Use STAR structure: Situation (the project and goal), Task (your specific responsibility), Action (what you did when things broke — debugging steps, reaching out for help, changing approach), Result (what you learned or delivered). Be honest about failure; don't sanitize it into a non-problem. Concrete technical detail ('our database queries were returning stale cached data because...') is more credible than vague narrative.
What they look for: Intellectual honesty and a growth mindset. Can you articulate a real failure without blaming others? Do you show systematic problem-solving under pressure? At the new grad level, the story doesn't need to be impressive — it needs to be real and self-aware.
Behavioral
12. Describe a time you had to learn something technical quickly that you hadn't encountered before. How did you approach it?
How to answer: Name the specific technology or concept (not just 'a new framework'). Describe your learning strategy: documentation first, then a small proof-of-concept, then applied to the real task. Mention what was hard and how you verified you understood it correctly (tests, code review, etc.). If you made a mistake during the learning process, including that adds credibility.
What they look for: Learning velocity and self-direction — the most important traits for a new grad since everything else will be learned on the job. Interviewers want evidence that you can bootstrap yourself, not that you already know everything. Specific technology names and concrete steps beat generic 'I googled it and figured it out'.
Study tips
- Practice on a whiteboard or blank editor without autocomplete — not just on LeetCode where you get syntax highlighting and instant feedback. Backend interviews often involve Google Docs or CoderPad with no IDE assistance, and the gap shocks unprepared candidates.
- For system design, study three or four canonical designs deeply (URL shortener, key-value store, rate limiter, simple messaging queue) rather than skimming twenty. At your level you'll get a foundational problem, and depth on a few beats shallow familiarity with many.
- Know your language runtime well enough to discuss memory management, how common data structures are implemented underneath (e.g., Python dict is a hash table with open addressing), and what operations are O(1) vs O(n). Interviewers probe this to distinguish engineers who code vs. engineers who understand what their code is doing.
- Prepare two or three honest behavioral stories from coursework, internships, or personal projects. The mistake most new grads make is vague storytelling. Write your stories down, time yourself telling them in under 2 minutes, and make sure each one has a specific technical detail that proves it's real.
- After solving any practice problem, ask yourself: what happens if the input is empty, null, or has one element? What if it's extremely large? Getting into the habit of probing your own edge cases before the interviewer does is one of the clearest signals that separates hirable new grads from the rest.
Practice these against your own résumé
Get questions tailored to your experience, answer them, and get honest feedback — free, no credit card.
Run a free fit check →