← Optiver Interview Insights

Optiver·Software Engineer·Technical Phone Screen·Intermediate

IntermediatePrefer not to say
Apr 2026

Summary

Optiver software engineer interview that leaned hard into CS fundamentals. The data structures question was basically a full oral exam on its own, covering everything from arrays to graphs with complexity analysis and real-world tradeoffs.

Questions Asked (1)

Q1

Walk through the common data structures (arrays, linked lists, stacks, queues, hash tables, BSTs, heaps, graphs) and for each one: give average and worst-case time and space complexities for search, insert, delete, and iteration; describe the key invariants; and give an example where it shines and one where it falls apart.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

This question is a monster.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by grouping the data structures into families (linear, hash-based, tree-based, heap, graph) to show a structured mental model. For each, state the key invariant first, then derive complexities from that invariant, and finally give a concrete example where it excels and one where it fails. Keep the answer comparative and tie trade-offs back to real-world engineering decisions.

Pro tip: Don't just recite Big-O tables—explain *why* each complexity follows from the structure's invariant, and mention practical constants like cache locality and pointer-chasing overhead, which matter enormously in latency-sensitive trading systems like Optiver's.

1. Group and sequence the structures

Organize the eight structures into logical families: linear (array, linked list, stack, queue), hash-based (hash table), tree-based (BST, heap), and graph. This shows you can chunk information rather than listing facts randomly.

2. State the invariant before complexities

For each structure, first state its defining invariant (e.g., array: contiguous memory; BST: left < node < right; heap: parent ≤ children). Then derive search/insert/delete/iteration complexities from that invariant, noting average vs. worst case where they differ.

3. Give a shining example and a failure example

For each structure, provide one scenario where it is the ideal choice and one where it breaks down. Make examples concrete and tied to real systems (e.g., arrays for cache-friendly numeric loops, linked lists for frequent middle insertions with known nodes).

4. Highlight trade-offs and practical considerations

Emphasize space complexity, cache behavior, pointer overhead, and worst-case guarantees. For example, hash tables have O(1) average but O(n) worst-case and poor iteration order; balanced BSTs guarantee O(log n) but with higher constants.

5. Summarize with a decision framework

Conclude by mapping common engineering needs (fast lookup, ordered iteration, priority access, modeling relationships) to the appropriate structure, showing you can choose the right tool for the job.

Key Points to Mention

  • Array: O(1) random access, O(n) insert/delete in middle; invariant is contiguous memory; shines in cache-friendly iteration, fails with frequent resizing or middle insertions.
  • Linked list: O(1) insert/delete given a node reference, O(n) search; invariant is nodes linked by pointers; shines in LRU caches and frequent splicing, fails with poor cache locality and no random access.
  • Hash table: O(1) average search/insert/delete, O(n) worst-case due to collisions; invariant is key hashing to buckets; shines in symbol tables and caches, fails with ordered traversal or adversarial keys.
  • BST (balanced): O(log n) search/insert/delete, O(n) worst-case if unbalanced; invariant is left < node < right; shines in ordered data and range queries, fails with sorted insertions unless self-balancing.
  • Heap: O(1) find-min/max, O(log n) insert/delete, O(n) search; invariant is heap property; shines in priority queues and scheduling, fails when you need arbitrary search or ordered iteration.
  • Graph: representations (adjacency list vs. matrix) trade space for speed; BFS/DFS O(V+E); shines in modeling networks and dependencies, fails with dense graphs using adjacency lists or when simple linear structures suffice.

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