AnyLearn
All interview prep
EngineeringNew gradSoftware Engineer

New Grad Software Engineer Interview Prep: Questions and a Mock Test

The entry-level software engineering loop is the most standardised interview in the industry, which is good news: the surface is finite and it is possible to prepare properly. What surprises people is where the marks actually go. Most candidates who fail do not fail because they could not find an algorithm; they fail because they started coding before understanding the problem, never said what they were thinking, or could not explain the complexity of what they had just written. This page covers the whole loop and ends with a graded mock across six areas.

The loop

How the process is structured

The interview loop: each round, how long it runs, and what it tests
RoundLengthWhat it tests
1.Online assessment[1]Not publishedAutomated coding problems, usually two, under a fixed time limit with hidden test cases. Passing requires correct handling of edge cases you cannot see, so reading constraints carefully and testing your own boundaries matters more than elegance.
2.Technical phone screen[1]Not publishedOne or two algorithm problems in a shared editor with an interviewer present. Assessed on clarifying the problem, thinking aloud, complexity analysis and verification, not only on reaching a working solution.
3.Onsite coding rounds[1]Not publishedSeveral coding interviews of increasing difficulty, often including a follow-up that changes a constraint to see whether you can adapt your approach rather than restart it.
4.Fundamentals and behavioural[3]Not publishedComputer science basics beyond algorithms, HTTP method semantics, databases and version control, plus structured behavioural questions. Amazon's published principles are the clearest example of a written rubric, including the expectation that leaders "work to disconfirm their beliefs".

Bracketed markers point to the dated sources at the end of this article. Loops change; check the retrieval dates before relying on a round count.

Complexity, including the costs you did not think about

Every coding round ends with a complexity question, and a correct solution whose cost you cannot state is a partial answer.

The part candidates underprepare is that language built-ins have costs too, and choosing the wrong one turns a linear solution into a quadratic one silently. Python's own documented average-case complexities make the point precisely: appending to a list is O(1), inserting at a position is O(n), indexing a list is O(1), and the membership test x in list is O(n). By contrast, set membership is O(1) and dictionary get and set are O(1). Sorting a list is O(n log n).

That table explains a very common interview failure. A loop that checks whether an item has been seen using a list is O(n) per check and O(n squared) overall; changing the list to a set makes it linear, and the code looks almost identical. Interviewers set problems where exactly this substitution is the point.

Be precise about what n means, and about space as well as time. A recursive solution has stack depth, a memoisation table has size, and an answer that says linear time without mentioning the linear space it also uses is incomplete.

Worst case and average case differ for hash-based structures, and saying so unprompted is a good signal: dictionary and set operations are constant on average and degrade with adversarial or pathological hashing.

The patterns that cover most questions

Interview algorithm questions are drawn from a surprisingly small set of patterns, and recognising which one applies is most of the work.

Hash map for counting or lookup, which converts repeated searching into constant-time access and is the single highest-yield pattern. Two pointers on a sorted array, for pair sums and in-place partitioning. Sliding window for contiguous subarray or substring problems with a constraint. Binary search, both on a sorted array and, more interestingly, on the answer itself when a predicate is monotonic. Breadth-first search for shortest path on an unweighted graph and depth-first search for exploration and cycle detection, with the reminder that a grid is a graph. A heap for top-k and for streaming problems. And dynamic programming when the problem has overlapping subproblems and optimal substructure, where the practical route is usually to write the recursion first and then add memoisation.

The recognition cues are worth rehearsing. The word sorted suggests two pointers or binary search. Contiguous suggests a sliding window. Shortest path on equal-weight edges means breadth-first search. Count the ways or maximise over choices suggests dynamic programming. Top k suggests a heap.

The habit that earns marks regardless of pattern: state a brute-force solution and its complexity first, then improve it. That guarantees you have something correct on the board, it demonstrates you understood the problem, and it makes the optimisation legible as a decision rather than as a memorised trick.

How the round is actually scored

Interviewers assess four things, and only one of them is the final answer.

Problem understanding comes first. Restating the problem, asking about input size, duplicates, empty input, negative numbers, and whether the input may be modified, takes ninety seconds and prevents the most expensive failure mode, which is solving the wrong problem elegantly.

Communication is second and is where silence is fatal. An interviewer cannot award credit for reasoning they cannot hear. Saying what you are considering and why you are rejecting it is the observable behaviour being graded, and a candidate who works silently for ten minutes and produces a correct answer usually scores worse than one who thinks aloud and needs a nudge.

Code quality is third. Meaningful names, small functions, no duplicated blocks, and handling the edge cases you identified at the start. Writing the edge cases down when you name them, then checking them off, is a cheap way to demonstrate rigour.

Verification is fourth and most often skipped. Walking through your own code with a small example, out loud, catches off-by-one errors before the interviewer finds them, and finding your own bug reads far better than having one pointed out.

On hints: they are deliberate. Taking one gracefully and incorporating it is assessed positively; resisting one is assessed badly. Nobody is expected to solve everything unaided.

The fundamentals round beyond algorithms

Most loops include a round that is not algorithmic, and new graduates are frequently underprepared for it because coursework does not cover it.

HTTP semantics are examinable and precise. RFC 9110 defines a method as safe if "their defined semantics are essentially read-only; that is, the client does not request, and does not expect, any state change on the origin server", covering GET, HEAD, OPTIONS and TRACE. A method is idempotent if "the intended effect on the server of multiple identical requests with that method is the same as the effect for a single such request", which is the safe set plus PUT and DELETE. The consequence worth knowing: POST is neither, so a retried create can duplicate, and DELETE is idempotent even though the second call usually returns 404, because the property concerns server state rather than the status code.

Status codes: 401 means unauthenticated, 403 means authenticated but not permitted, 404 not found, 409 conflict with current state, 500 a server-side failure.

Databases come up at a basic level. What an index is and why it makes reads faster and writes slower, what a primary key and a foreign key are, the difference between inner and left joins, and what a transaction guarantees. If you can also say that the default isolation level in most systems permits a row to change between two reads in the same transaction, you are ahead of most new graduates.

Version control too: what a merge conflict is, the difference between merge and rebase, and why force-pushing to a shared branch is a problem.

Behavioural rounds, where new graduates lose easy marks

The behavioural round is not a formality, and the most common defect is answering in the first person plural.

"We built a recommendation feature" tells an interviewer nothing about you. "I owned the data pipeline, and I argued for a simpler baseline first because we had six weeks" does. The interviewer is assessing you specifically, and a collective subject makes your contribution invisible.

Amazon publishes the clearest example of a written rubric, and several of its Leadership Principles describe behaviours any interviewer is listening for. Customer Obsession states that "leaders start with the customer and work backwards. They work vigorously to earn and keep customer trust." Are Right, A Lot asks that leaders "seek diverse perspectives and work to disconfirm their beliefs". Bias for Action puts the reversibility argument in one line: "Speed matters in business. Many decisions and actions are reversible and do not need extensive study. We value calculated risk taking."

With limited professional experience, coursework, personal projects, internships, part-time work and team activities are all legitimate material. What matters is the structure: situation, what you specifically did, and a result you can quantify even roughly.

Prepare a genuine failure story. The most common mistake is a disguised strength, working too hard or caring too much, which reads as evasion. A real failure with a real cost and a specific change in how you now work is what the question is for. Prepare a disagreement story too, since almost every loop asks for one.

Open-ended

What they actually ask

  1. 1.Find the two numbers in an array that sum to a target. Talk me through it.

    What a strong answer covers

    The expected shape is brute force first, stated with its complexity, then improved. The nested loop is O(n squared); a single pass storing each value's complement in a hash map is O(n) time and O(n) space, and if the array is sorted, two pointers gives O(n) time and O(1) space. Strong candidates clarify before coding: are there duplicates, can the same element be used twice, are there negatives, is the array sorted, and should indices or values be returned. They verify with a small example out loud. The best answers state the space-time tradeoff explicitly rather than jumping to the hash map as a memorised move, because the interviewer is assessing whether you can compare options.

  2. 2.You are asked to detect whether a linked list has a cycle. How do you approach it?

    What a strong answer covers

    Start with the obvious solution and its cost: store visited nodes in a set, O(n) time and O(n) space, which is entirely acceptable and should be said out loud before optimising. Then the constant-space approach with two pointers moving at different speeds, which meet if and only if a cycle exists. Strong candidates can explain why they must meet rather than asserting it, and handle the edge cases: an empty list, a single node, and a single node pointing to itself. If asked to find the cycle's start, the follow-up is that resetting one pointer to the head and advancing both one step at a time meets at the entry point. Being honest that you recall the result but would want to re-derive it reads better than a confident hand-wave.

  3. 3.Tell me about a project you are proud of.

    What a strong answer covers

    The structure that scores: what the problem was and why it mattered, what you specifically did, what was hard about it, and what the outcome was. The most common failure is describing the project rather than your contribution, and the second most common is describing what the technology does rather than what you decided. Strong answers name a real tradeoff you made and why, admit something you would do differently, and quantify the result even loosely. Interviewers frequently probe depth, so choose something you genuinely understand end to end rather than the most impressive-sounding thing on your CV; being unable to explain your own project's architecture is the fastest way to lose a round.

  4. 4.How would you design a URL shortener? Keep it simple.

    What a strong answer covers

    New graduates are not expected to produce a distributed design, but they are expected to reason. Clarify first: expected scale, custom aliases, expiry, whether analytics are needed. Then the core: a mapping from short code to long URL, a key-value or relational store, and the redirect. Key generation is the interesting decision, and comparing a counter encoded in base62, which is simple and predictable, against a hash with collision handling, which is neither, demonstrates real thinking. Strong answers note the read-heavy access pattern and therefore caching, mention which redirect status code to use and why a permanently cacheable one hides traffic from analytics, and identify what they would need to learn to take it further.

  5. 5.Tell me about a time you disagreed with a teammate.

    What a strong answer covers

    Interviewers want evidence you can hold a position and change it. Strong answers state the disagreement concretely, explain both positions fairly including the merits of the other one, describe how it was resolved, and say what happened. The two failure modes are a story where you were simply right and everyone came round, which reads as unreflective, and a story where you avoided the conflict, which answers a different question. A story where you were persuaded is completely acceptable and often stronger, because it demonstrates the behaviour Amazon's principles describe as seeking diverse perspectives and working to disconfirm your own beliefs. Coursework and group projects are entirely valid sources.

  6. 6.Your code passes the given examples but fails a hidden test. How do you think about that?

    What a strong answer covers

    The expected instinct is to enumerate boundaries rather than to re-read the code hoping to spot something. The usual suspects: empty input, a single element, all elements identical, maximum input size and integer overflow, negative numbers and zero, duplicates, and already-sorted or reverse-sorted input. Strong candidates re-read the constraints, since hidden tests usually probe exactly the boundary the statement specified, and check whether their complexity is within the stated limits, because a timeout presents as a failure without being a correctness bug. The mature close is that writing down edge cases before coding, rather than discovering them afterwards, is the habit that prevents this.

Worked examples

Three sample questions, answered

These three show the level the mock is pitched at, with the answer and the reasoning in the open. The graded paper keeps its answer key server-side.

1.In Python, what is the average-case complexity of the membership test x in my_list?
Complexity and operation costs
  • O(1)
  • O(n)
  • O(log n)
  • O(n log n)

Why: A list is scanned element by element, so membership is documented as O(n) on average. Set membership and dictionary lookup are O(1). This is why a seen-before check inside a loop must use a set: with a list the loop becomes O(n squared), and the code looks almost identical either way.

2.Which method is idempotent but not safe, per RFC 9110?
HTTP, databases and version control
  • GET
  • HEAD
  • POST
  • DELETE

Why: Safe methods are read-only in intent: GET, HEAD, OPTIONS and TRACE. Idempotent means repeating the request has the same effect as making it once, which is the safe set plus PUT and DELETE. DELETE changes state so it is not safe, but deleting twice leaves the same state as deleting once. POST is neither.

3.You need to find the shortest path in an unweighted grid. Which algorithm applies?
Algorithm patterns
  • Depth-first search
  • Dijkstra's algorithm with a priority queue
  • Breadth-first search
  • Dynamic programming over the grid

Why: Breadth-first search explores in order of distance from the source, so the first time it reaches a cell it has done so by a shortest path. Dijkstra generalises this to weighted edges and is unnecessary overhead when every edge costs the same. Depth-first search finds a path but gives no guarantee it is shortest.

The mock

An 18-question knowledge check

This is a knowledge check, not a simulation. The real loop happens on a whiteboard, in an editor, and in conversation. What this paper does measure is the underlying knowledge those rounds draw on: each question is tagged with a topic, grading happens per topic, and a weak topic points you at the course that fixes it.

Your paper0 / 18 answered
  1. 1.Inserting an element at position 0 of a Python list has what average-case complexity?
    Complexity and operation costs
  2. 2.An algorithm builds a memoisation table of size n and recurses to depth n. What is its space complexity?
    Complexity and operation costs
  3. 3.Why are dictionary lookups described as O(1) on average rather than in the worst case?
    Complexity and operation costs
  4. 4.You need to repeatedly retrieve and remove the smallest element from a changing collection. Which structure fits?
    Core data structures
  5. 5.What does a hash set provide that a sorted array does not?
    Core data structures
  6. 6.Why does a queue rather than a stack drive breadth-first search?
    Core data structures
  7. 7.Which cue most strongly suggests a sliding window approach?
    Algorithm patterns
  8. 8.When can binary search be applied to something other than a sorted array?
    Algorithm patterns
  9. 9.What two properties must a problem have for dynamic programming to apply?
    Algorithm patterns
  10. 10.What is the strongest reason to write a test for a function you just wrote?
    Code quality and testing
  11. 11.Which is the clearest sign that a function should be split into smaller ones?
    Code quality and testing
  12. 12.What is the practical problem with catching an exception and doing nothing with it?
    Code quality and testing
  13. 13.A request returns 403. What does it mean?
    HTTP, databases and version control
  14. 14.What does adding a database index primarily trade away?
    HTTP, databases and version control
  15. 15.What is the difference between merge and rebase in Git?
    HTTP, databases and version control
  16. 16.What is the main weakness of answering a behavioural question with 'we decided to rewrite the service'?
    Behavioural answers
  17. 17.Amazon's Bias for Action principle argues that speed matters partly because of what?
    Behavioural answers
  18. 18.What makes a good answer to 'tell me about a failure'?
    Behavioural answers
18 questions left to answer.
Apparatus

Sources

Hiring loops change. Every claim above carries a retrieval date so you can judge how current it is.

  1. [1]Python Wiki, TimeComplexity · retrieved 2026-08-13
  2. [2]RFC 9110, HTTP Semantics, Section 9: Methods · retrieved 2026-08-13
  3. [3]Amazon, Leadership Principles · retrieved 2026-08-13
Keep preparing

Refresh your memory

Free learning paths covering the ground this loop tests, whatever your score. Each one ends with a shareable certificate.