InterviewStack.io LogoInterviewStack.io

Advanced Algorithms and Problem Solving Questions

Comprehensive assessment of advanced algorithmic reasoning, design, and optimization for hard and composite problems. Covers advanced dynamic programming techniques including state compression and bitmask dynamic programming, combinatorial generation and backtracking, recursion and divide and conquer strategies, greedy algorithms with correctness proofs, and advanced graph algorithms such as breadth first search, depth first search, shortest path algorithms including Dijkstra and Bellman Ford, minimum spanning tree, network flow, strongly connected components, and topological sort. Also includes advanced tree and string algorithms such as suffix arrays and advanced hashing, bit manipulation and low level optimizations, algorithmic reductions and heuristics, and complexity analysis including amortized reasoning. Candidates should recognize applicable patterns, combine multiple data structures in a single solution, transform brute force approaches into optimized solutions, prove correctness and derive time and space complexity bounds, handle edge cases and invariants, and articulate trade offs and incremental optimization strategies. At senior levels expect mentoring on algorithmic choices, designing for tight constraints, and explaining engineering implications of algorithm selection.

EasyTechnical
20 practiced
Write a function (in your language of choice) that removes duplicates from a sorted array in-place and returns the new length. Your solution should run in O(n) time and use O(1) additional space. Explain boundary cases (empty array, all duplicates) and describe how the approach must change if the array is not sorted but you must perform deduplication on a memory-limited client.
HardTechnical
30 practiced
Propose a memory layout and search algorithm for a compressed prefix trie (radix tree) used in an in-memory key-value store where cache misses dominate latency. Consider node packing, inline labels, pointer elimination (indexing into contiguous arrays), SIMD-friendly comparisons, and path compression. Analyze trade-offs between lookup speed, update complexity, and memory overhead.
HardTechnical
16 practiced
Explain Johnson's algorithm for all-pairs shortest paths: compute node potentials with Bellman-Ford, reweight edges to non-negative values, then run Dijkstra from each source. Provide a correctness sketch showing reweighting preserves shortest-path order, discuss numerical stability and overflow issues, and analyze runtime on large sparse graphs.
MediumSystem Design
22 practiced
Design a server-side index to support fast arbitrary substring queries over 10GB of logs. Compare building a suffix array, suffix automaton, and an inverted index approach. For each, discuss construction time, memory footprint, query time, update/append strategies for continuous log ingestion, and pragmatic operational trade-offs.
MediumTechnical
22 practiced
You're building a server-side diff tool for code reviews. Design an algorithm to compute the Longest Common Subsequence (LCS) between two files up to 5000 lines. Discuss time/space trade-offs, improvements such as Hunt-Szymanski or bitset-based DP, and memory-efficient strategies (Hirschberg) to reconstruct diff hunks for UI rendering.

Unlock Full Question Bank

Get access to hundreds of Advanced Algorithms and Problem Solving interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.