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.

MediumTechnical
40 practiced

You are given a static m x n matrix where every row and every column is individually sorted, and you must answer many 'does value x exist' queries against it as fast as possible. Walk through the preprocessing, space, and query-time trade-offs available (from no preprocessing at all up to full O(1) query time), and pick one given a stated memory budget.

MediumTechnical
63 practiced

Find the k-th largest element in an unsorted array. A full sort gets you there in O(n log n); explain how quickselect (partition-based, like quicksort but recursing into only one side) gets the expected time down to O(n), and when you would reach for a heap of size k instead.

MediumTechnical
45 practiced

A hash table doubles its bucket array whenever the load factor exceeds 0.75. Walk through the amortized cost of a sequence of n inserts under this policy, and explain what changes if the table must also shrink (say, halving) when occupancy drops below some threshold after deletions.

MediumTechnical
39 practiced

Given an array containing only three distinct values, sort it in-place in a single pass using constant extra space (the Dutch National Flag problem). Then explain how the same three-way in-place partitioning idea generalizes to partitioning a list by an arbitrary predicate while keeping relative order stable.

HardTechnical
44 practiced

Given an array and a window size k, return the maximum value in every window of size k as it slides across the array, in O(n) total time (not O(n*k)). Explain what a monotonic deque gives you here that a plain heap-per-window would not.

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.