InterviewStack.io LogoInterviewStack.io

Fundamental Algorithms and Techniques Questions

Covers core algorithmic concepts and problem solving patterns commonly assessed in technical interviews. Topics include searching algorithms such as binary search; sorting algorithms such as merge sort and quick sort; graph traversal methods such as breadth first search and depth first search; recursion and divide and conquer techniques; greedy heuristics; and dynamic programming including memoization and tabulation. Also includes implementation patterns such as two pointers, sliding window, prefix sums, and divide and conquer composition, as well as practical considerations like in place versus out of place implementations, stability for sorting, recursion stack and memory usage, and amortized analysis. Candidates should be able to implement these algorithms correctly, explain correctness and trade offs, analyze time and space complexity using Big O notation for best case average case and worst case, select appropriate approaches given input constraints, combine patterns to solve composite problems, and optimize or refactor solutions while handling edge cases.

MediumTechnical
0 practiced
Solve N-Queens using backtracking: place N queens on an N×N board so that no two attack each other. Implement a backtracking algorithm and discuss pruning techniques to speed up search. Explain how backtracking patterns relate to constrained combinatorial searches in ML (e.g., hyperparameter grid searches with constraints).
MediumTechnical
0 practiced
Design and implement Kahn's algorithm (topological sort) in Python for a directed acyclic graph (DAG) represented as adjacency lists. Explain how you'd detect cycles and how topological sort is useful in ML data pipelines (e.g., scheduling preprocessing tasks with dependencies).
MediumTechnical
0 practiced
You are given a list of meeting time intervals represented as [start, end]. Merge all overlapping intervals and return the resulting list sorted by start time. Implement in Python and analyze complexity. Discuss how this applies to merging labeled time windows or annotation overlaps in ML preprocessing.
HardTechnical
0 practiced
Large graph cycle detection with limited memory: propose a streaming/external-memory algorithm to detect if a directed graph (edges arrive as a stream) contains a cycle. Discuss trade-offs between one-pass algorithms with probabilistic guarantees vs multi-pass deterministic approaches and applicability in validating huge dependency graphs in ML platforms.
EasyTechnical
0 practiced
Implement binary search in Python: given a sorted list of integers nums and an integer target, return the index of target or -1 if not found. Also explain time and space complexity (best/average/worst) and how you'd modify the algorithm to:1) return the first and last index when duplicates exist,2) find the insertion index (lower_bound), and3) perform binary search on a monotonic boolean predicate (e.g., smallest x such that f(x) == True) used in ML calibration tasks. Example: nums = [1,2,2,3,4], target=2 → first=1, last=2.

Unlock Full Question Bank

Get access to hundreds of Fundamental Algorithms and Techniques interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.