InterviewStack.io LogoInterviewStack.io

Algorithm Design and Analysis Questions

Covers algorithmic problem solving and analysis fundamentals required in technical interviews. Topics include common data structures, sorting and searching, recursion and divide and conquer, dynamic programming, greedy strategies, backtracking, graph algorithms such as breadth first search and depth first search, shortest path and topological sort, string algorithms, and techniques for deriving correct and efficient solutions. Candidates should demonstrate ability to reason about correctness, derive time and space complexity bounds using Big O notation, and discuss scalability and optimization trade offs for large inputs.

MediumTechnical
92 practiced
Explain Strassen's algorithm for matrix multiplication, derive its asymptotic complexity, and discuss constant-factor and numerical-stability trade-offs. For dense matrix multiplies in ML workloads, when would Strassen be beneficial vs classical or highly-optimized BLAS?
MediumTechnical
92 practiced
Approximation algorithms: explain the classic greedy algorithm for Set Cover, prove its approximation ratio of H_n (harmonic number), and discuss practical trade-offs when using greedy set cover for high-dimensional feature selection in ML. Include complexity of naive and optimized implementations.
EasyTechnical
99 practiced
Coding problem (Python): Implement a function that solves the Two-Sum problem: given an array of integers and a target integer, return indices of two numbers that add up to the target. The implementation should run in O(n) time and O(n) extra space. Explain how your code handles duplicates and multiple solutions.
MediumTechnical
102 practiced
Explain how to construct a suffix array for a string in O(n log n) time using the doubling algorithm. Outline the main steps, memory usage, and how to compute the LCP (longest common prefix) array. Compare suffix arrays to suffix trees and suffix automata for common NLP string-processing tasks.
MediumSystem Design
99 practiced
System-design + algorithms: you have a DAG of ML tasks (nodes) with dependencies (edges), each task has a duration and resource type (CPU or GPU). Design an algorithm to produce a valid schedule on W heterogeneous workers to minimize makespan. Explain how to detect cycles, how to incorporate resource constraints, and the complexity of your approach. Propose practical heuristics.

Unlock Full Question Bank

Get access to hundreds of Algorithm Design and Analysis interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.