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.

EasyTechnical
33 practiced

Given a string containing only the bracket characters ( ) { } [ ], determine whether it is validly nested: every closing bracket matches the most recently opened bracket of the same type. Solve it in O(n) time and explain what data structure makes 'most recently opened' cheap to query.

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.

MediumTechnical
44 practiced

For each element in an array, find the next element to its right that is strictly greater than it (or determine none exists), in O(n) time. Then explain how the same monotonic-stack idea lets you compute the largest rectangular area under a histogram in one pass.

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

Here is a binary search that computes mid as (low + high) / 2. What can go wrong with this specific expression on very large arrays or in languages with fixed-width integers, and how would you rewrite it to avoid the problem?

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.