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
87 practiced
Explain time and space complexity for common Python list operations including indexing, append, pop, insert at beginning, remove by value, slicing, iteration, and concatenation. Include best, average and worst case where applicable and discuss amortized analysis for append and cases when operations trigger copies.
HardTechnical
120 practiced
Convert recursive in-order traversal of a binary tree into an iterative Python generator using an explicit stack that yields node values lazily. Provide code for the traversal, discuss time and space complexity, mention tail-recursion elimination considerations and when you would prefer iterative traversal over recursion in production code with deep trees.
MediumTechnical
72 practiced
Implement topological sort using Kahn's algorithm in Python. Given number of nodes and adjacency list return one valid ordering or an empty list if a cycle exists. Explain how indegree is used, analyze time and space complexity, and describe how you would produce a lexicographically smallest topological order if node labels are comparable.
HardTechnical
80 practiced
Implement Karatsuba multiplication in Python to multiply two large integers represented as strings using a divide-and-conquer approach. Explain the recurrence T(n) = 3T(n/2) + O(n) and analyze time complexity compared to O(n^2) grade-school multiplication. Discuss base-case thresholds, handling carries and signs, and when FFT-based multiplication should be considered instead.
MediumTechnical
85 practiced
Implement randomized quicksort in Java for an array of integers using in-place partitioning. Choose pivot randomly to avoid worst-case behavior on already sorted inputs. Analyze average and worst-case time and space complexity, and explain how tail recursion elimination or recursion on smaller partition first can reduce stack depth.

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.