Core Data Structures, Algorithms, And Complexity
Asked of: Software Engineer
Last updated

What's being tested
You need to recognize the right data structure, algorithmic pattern, and complexity bound from constraints, then implement cleanly under interview pressure. Expect arrays/strings, trees, heaps, hash maps, graphs, and scheduling-style dependency problems where the interviewer probes both correctness and tradeoffs.
Patterns & templates
-
Sliding window over contiguous arrays/strings — fixed-size or dynamic expand/contract; usually
O(n)time,O(1)orO(k)space. -
Hash map indexing — precompute value-to-index maps for
O(1)lookup; watch duplicates, missing keys, and stable ordering assumptions. -
Binary tree reconstruction — postorder root is last; split inorder by root index; recurse right before left when consuming postorder backward.
-
Heap / priority queue for repeated best-choice selection —
O(log n)per insert/pop; use lazy deletion for changing multisets. -
Graph scheduling — model tests as a DAG, run topological sort with in-degree counts; detect cycles when processed nodes
< n. -
Complexity comparison — arrays give
O(1)indexing, linked lists giveO(1)splice with node pointer, hash tables averageO(1), treesO(log n)if balanced. -
Greedy load balancing — assign next ready task to earliest available executor using a min-heap; optimality may fail with heterogeneous runtimes.
Common pitfalls
Pitfall: For dynamic sliding windows, shrinking only once instead of
while invalidleaves illegal windows in the answer.
Pitfall: Tree reconstruction fails when you scan inorder every recursion; build an index map first to avoid accidental
O(n^2).
Pitfall: In scheduling problems, ignoring cycle detection produces a partial schedule that looks valid but silently drops blocked tasks.
Practice these
The practice cards below cover the canonical variants — solve all of them and time yourself.
Featured in interview prep guides
Practice questions
- Compute the Final Robot ScoreNVIDIA · Software Engineer · Technical Screen · easy
- Return all file paths via DFSNVIDIA · Software Engineer · Technical Screen · easy
- Implement a disk space manager with evictionNVIDIA · Software Engineer · Technical Screen · medium
- Implement encode/decode for list of stringsNVIDIA · Software Engineer · Technical Screen · easy
- Implement matrix transpose and KV storeNVIDIA · Software Engineer · Technical Screen · medium
- Find the nth prime numberNVIDIA · Software Engineer · Technical Screen · easy
- Compare arrays, linked lists, hash tables, treesNVIDIA · Software Engineer · Technical Screen · easy
- Implement simple VM manager with CRUD operationsNVIDIA · Software Engineer · Technical Screen · medium
- Find all unique triplets summing to zeroNVIDIA · Software Engineer · Onsite · medium
- Implement core graph algorithms for graphicsNVIDIA · Software Engineer · Take-home Project · Medium
- Design algorithms for test schedulingNVIDIA · Software Engineer · Take-home Project · Medium
- Apply sliding window techniquesNVIDIA · Software Engineer · Onsite · Medium
Related concepts
- Core Data Structures, Sorting, And ComplexityCoding & Algorithms
- Arrays, Strings, Hash Maps, And Frequency CountingCoding & Algorithms
- Algorithms, Data Structures, And Complexity AnalysisCoding & Algorithms
- Arrays, Strings, and HashingCoding & Algorithms
- Mutable Data Structures And O(1) DesignCoding & Algorithms
- Coding Algorithms And Data StructuresCoding & Algorithms