Interview questions
Find a company or topic. Read the sources, then practice.
Loading the question library…
Find a company or topic. Read the sources, then practice.
Loading the question library…
Showing 1–9
Given numCourses and prerequisite pairs, return any ordering of courses that satisfies all prerequisites or an empty array if impossible — this is essentially computing…
Companies: Amazon, Anduril, Apple, Citadel +11
Breadth-First Search · Depth-First Search · Graph Theory · Topological Sort
Last reported Nov 2026
Given a functional directed graph (each node has at most one outgoing edge), return the length of the longest directed cycle or -1 if no…
Companies: Anduril
Breadth-First Search · Depth-First Search · Graph Theory · Kosaraju's Algorithm
Last reported Oct 2026
Given a DAG of course prerequisites where each course has a duration and any number of courses can run in parallel once prerequisites are satisfied…
Companies: Google, Meta, Modular, Salesforce +1
Array · Directed Acyclic Graph · Dynamic Programming · Graph Theory
Last reported Oct 2026
Given courses as nodes and prerequisite pairs as directed edges, determine whether the directed graph is acyclic — return true if a topological ordering exists…
Companies: Amazon, Anduril, Cloudflare, DoorDash +6
Breadth-First Search · Depth-First Search · Directed Acyclic Graph · Graph Theory
Last reported Oct 2026
Design a spreadsheet supporting set/get and sum operations where sum formulas can reference individual cells and rectangular ranges; the core challenge is maintaining a…
Companies: Airbnb, Discord
Array · Design · Graph Theory · Hash Table
Last reported Sep 2026
Given a sorted list of words in an unknown alphabet, infer the relative ordering of characters by deriving precedence constraints between first differing letters, then…
Companies: Amazon, Bloomberg, Google, Intuit +3
Array · Breadth-First Search · Depth-First Search · Directed Acyclic Graph
Last reported Aug 2026
Given recipes whose ingredients may include other recipes and an initial set of supplies, determine which recipes can be produced; the core challenge is dependency…
Companies: Amazon, Google, Tesla
Array · Directed Acyclic Graph · Graph Theory · Hash Table
Last reported Feb 2026
Given an undirected graph, return for every vertex the shortest distance to the nearest vertex that lies on any cycle. Key idea: identify cycle vertices…
Companies: Salesforce
Breadth-First Search · Depth-First Search · Graph Theory · Topological Sort
Given an acyclic directed graph of richer->poorer relations and a quietness score per person, compute for each person the quietest person among all people who…
Companies: Flipkart
Array · Depth-First Search · Directed Acyclic Graph · Graph Theory