← IMC Interview Insights

IMC·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Jul 2026

Summary

IMC quant engineer interview, one of those sessions that tests whether you actually think or just pattern-match to memorized answers. This question looked like a simple true/false but had a real gotcha buried in it.

Questions Asked (1)

Q1

True or false: the time complexity of binary search on a linked list is O(n log n). Explain your reasoning.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

I said true and walked through the math: binary search runs log n iterations, each random access on a linked list costs O(n), so you get O(n log n).

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying that the statement is false, then explain that binary search requires random access to achieve O(log n), which a linked list does not provide. Describe how the lack of random access forces a linear scan to find the middle element, resulting in O(n) time complexity for the search itself, and note that the O(n log n) figure might arise from a flawed analysis that incorrectly assumes O(log n) iterations each taking O(n) time.

Pro tip: Demonstrate deeper understanding by contrasting with array-based binary search and mentioning that while the search is O(n), the overall algorithm (if you include finding the middle each time) is still O(n), not O(n log n). This shows you can analyze algorithmic trade-offs precisely.

1. Clarify the statement

State whether the statement is true or false. Here, it is false.

2. Explain binary search requirements

Binary search relies on random access to the middle element in O(1) time, which arrays provide but linked lists do not.

3. Analyze linked list access

In a linked list, finding the middle element requires traversing from the head, taking O(n) time.

4. Derive the correct complexity

Even if you could halve the search space each time, each halving step costs O(n) to find the new middle, leading to O(n) overall (not O(n log n)).

5. Address the misconception

Explain why O(n log n) is incorrect: it would imply O(log n) iterations each costing O(n), but the total work across iterations is O(n) because the traversal distances decrease geometrically.

Key Points to Mention

  • Binary search requires random access to achieve O(log n) time.
  • Linked lists only allow sequential access, so finding the middle element takes O(n) time.
  • The correct time complexity for binary search on a linked list is O(n), not O(n log n).
  • The O(n log n) misconception arises from assuming O(log n) iterations each with O(n) cost, but the total traversal cost is O(n) due to decreasing distances.
  • Alternative approaches like skip lists or balanced trees can achieve O(log n) search but are not plain linked lists.
  • In practice, binary search on a linked list is inefficient and rarely used; other data structures are preferred.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.