Algorithmic Problem-Solving and Data Structure Selection Questions

The higher-order meta-skill of attacking an unfamiliar problem: recognizing problem archetypes and mapping them to known techniques, decomposing under constraints, and choosing, composing, or designing the right data structures to meet specified operation costs (LRU cache, min-stack, ordered maps, disjoint-set/union-find). Covers reasoning about trade-offs between competing structures and approaches, working through medium-to-hard problems methodically, handling problem variations, and communicating an approach before coding. The connective-tissue topic that ties the individual structure and algorithm topics together, rather than any single structure or algorithm.

HardTechnical
32 practiced

Given an unsorted array of integers, find the smallest positive integer that is missing from it, in O(n) time and O(1) extra space. Explain the cyclic-sort trick of placing each value at its 'home' index as you scan, and why that gives you O(1) space instead of a hash set.

MediumTechnical
40 practiced

Rotate an array to the right by k steps in-place, using O(1) extra space (k may exceed the array's length). Explain your approach, and how the same in-place three-reversal trick generalizes: reversing a string in place, or rotating a 2D matrix in place.

EasyTechnical
58 practiced

Reverse a singly linked list in place and return the new head, in O(n) time and O(1) extra space. Walk through both the iterative and the recursive version, and note what the recursive one costs you that the iterative one does not.

MediumTechnical
42 practiced

Implement a prefix-tree structure that supports insert(word), search(word), and startsWith(prefix). Then explain why this beats a plain hash set of words when the workload is dominated by prefix queries rather than exact-match lookups.

EasyTechnical
32 practiced

Given a string, find the index of the first character that does not repeat anywhere else in it, or report that none exists. Do it in O(n) time, and discuss how a streaming variant (characters arriving one at a time, asked at any point) would change your approach.

Unlock Full Question Bank

Get access to all Algorithmic Problem-Solving and Data Structure Selection interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.