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
44 practiced

Given a large collection of items, find the k most frequent ones. Compare maintaining a heap of size k as you scan against bucket-sort-by-frequency, and say which one you would pick when k is very small relative to the number of distinct items, versus when it is not.

HardTechnical
39 practiced

Tasks arrive over time, each with a processing time (and possibly a deadline), and must be assigned to one of several identical workers online, without knowing future arrivals. Propose a greedy assignment rule and argue, using an exchange argument, why greedy does not lose to the optimal offline schedule.

HardTechnical
35 practiced

In a graph of interconnected services (or modules, or servers), find every node whose removal would disconnect part of the network (articulation points), and every 'strongly connected' cluster where every node can reach every other node in the cluster. Explain how a single DFS pass with discovery times and low-link values gives you both answers in O(V+E).

HardTechnical
35 practiced

Given a list of meeting time intervals, find the minimum number of rooms (or servers) needed so that no two overlapping meetings share one. Explain why sorting start and end times separately (or a heap of active end times) gets you there, and how this differs from the plain merge-overlapping-intervals problem.

EasyTechnical
32 practiced

Given a sorted array and a target value, find two numbers that add up to the target using O(1) extra space. Explain why sorted order lets you avoid the hashmap you would otherwise need, and how you would adapt the same technique to intersect two sorted arrays.

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.