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.

HardTechnical
0 practiced
Implement weighted interval scheduling in Python: given intervals with start, end, and weight, find a subset of non-overlapping intervals that maximizes total weight. Provide an O(n log n) DP by sorting intervals by end time, binary searching for previous compatible interval, and computing dp[j] = max(weight_j + dp[p(j)], dp[j-1]). Discuss how this applies to scheduling GPU jobs and memory trade-offs.
MediumTechnical
0 practiced
Implement both Lomuto and Hoare partition schemes in Python and explain differences using the two-pointer technique. Analyze average/worst-case behavior and number of swaps for each, explain how they behave with many duplicate elements, and discuss stability and pivot selection strategies to reduce worst-case depth in quicksort.
HardTechnical
0 practiced
Implement Levenshtein edit distance between two strings in Python with O(n*m) time and O(min(n,m)) space using rolling arrays. Explain how to reconstruct the edit sequence if needed and discuss performance considerations and optimizations (e.g., banded DP) for large vocabularies in NLP tasks like spell correction.
EasyTechnical
0 practiced
Implement in Python a function that returns the length of the longest substring without repeating characters for a given string s. Use a sliding-window approach with a hash map. Analyze time and space complexity and explain how you would modify the method to return the substring itself, how to handle Unicode code points, and how to adapt to a streaming input of characters.
HardTechnical
0 practiced
Explain Bellman-Ford algorithm for single-source shortest paths, implement it in Python to compute distances and detect negative cycles reachable from the source, analyze its time complexity, and discuss practical uses and limitations. Explain why Dijkstra is not appropriate for graphs with negative edge weights and relate negative cycles to reward loops in reinforcement learning.

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.