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.

EasyTechnical
71 practiced
Explain what sorting stability means. Provide an example where a stable sort is required in an ML preprocessing pipeline (e.g., stable sort by score then by timestamp). Give two algorithms that are stable and two that are not, and explain how to make an unstable algorithm stable if needed.
MediumTechnical
89 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
62 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).
HardTechnical
75 practiced
Design an algorithm for adaptive sliding windows to detect anomalies in time series where the anomaly threshold and window length should adapt to seasonal variance. Outline statistical criteria, update rules, and how to control for false positives in a production anomaly detection system for ML monitoring.
HardTechnical
105 practiced
Design algorithms for compressing model parameter arrays to reduce storage and network transfer: discuss pruning (sparse representations), quantization (8-bit, 4-bit), and entropy coding (e.g., Huffman). For each approach outline algorithmic steps, impact on inference accuracy, and how you'd evaluate trade-offs in production.

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.