The OpenAI New Grad SWE assessment contained three algorithmic problems covering functional-graph traversal, constrained path counting, and a round-based simulation. The questions became progressively more involved, with the third problem requiring careful handling of left-to-right conflict resolution when neighboring microorganisms could eat one another.
Interview Details
Question 1 — Simple Network
The first problem described a directed network where every node has at most one outgoing edge. Implement: compute(start_node_id, from_ids, to_ids). from_ids and to_ids have the same length and describe directed edges: from_ids[i] -> to_ids[i]. Starting from start_node_id, repeatedly follow the outgoing edge until reaching a node with no outgoing edge. Return that final node ID.
The traversal is: 23 -> 67 -> 91 -> 56 so the result is: 56. Node IDs are not guaranteed to be consecutive or ordered. If traversal enters a cycle, return the ID of the last node visited immediately before following an edge that would close the loop. A node never points directly to itself. Constraints included: 1 < node_id < 5000
Question 2 — Count Shopping Paths
The second problem modeled a town containing four types of stores:
0 = Bookshop
1 = School shop
2 = Sports store
3 = Stationery store
0 = Bookshop
1 = School shop
2 = Sports store
3 = Stationery store
The town is represented by:
shops
roads
shops
roads
shops[i] gives the
Unlock Full Details
Create a free account to unlock this interview experience report.