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.

EasyTechnical
0 practiced
Describe how you'd use a priority queue to schedule alert notifications in a BI system where alerts have different priorities and deadlines. Explain algorithmic complexity for insertion and extraction, how to handle priority updates (decrease-key), and how to persist pending alerts efficiently to survive restarts.
HardTechnical
0 practiced
You're computing cohort retention by joining a large events table with user attributes and a precomputed dimension table. Describe algorithmic considerations for join order, selecting hash vs sort-merge join, partitioning and broadcast joins, and query rewrite strategies to minimize data shuffled and scanned. Provide a plan for distributed execution in Spark.
HardTechnical
0 practiced
Given a directed weighted graph representing latencies between services in a data pipeline, describe algorithmic choices for computing the least-latency path from service S to all others. Explain when to use Dijkstra vs Bellman-Ford, implement Dijkstra in Python using a heap, and discuss how to scale to graphs with hundreds of millions of edges.
MediumTechnical
0 practiced
Write an ANSI SQL query to compute weekly retention for cohorts where cohort_week is the user's first activity week. Given events(user_id, occurred_at DATE), return columns: cohort_week, week_offset, retained_users, cohort_size, retention_rate. Explain performance considerations for large datasets and how you might precompute or materialize results for fast dashboards.
MediumTechnical
0 practiced
You have daily metrics and want to flag anomalies where a day's value deviates beyond 3 standard deviations from the rolling 30-day mean. Describe an efficient algorithm to compute rolling mean and standard deviation for each day in O(n), implement a Python function that returns anomaly dates, and discuss how you'd adapt for multiple metrics and missing/null values.

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.