OpenAI

Verified interview challenge

Count machines and recover a cluster topology

Coordinate machines that know only their neighbours to produce a cluster-wide result.

Unlock with Full Access

The challenge

Machines form a rooted tree, but each knows only itself, its parent and its children. Implement the message handler that lets the root count the machines, then extend it to produce the topology.

Messages arrive asynchronously and may reach their destinations in any order. There is no shared state to inspect and no synchronous call to a neighbour, so each machine must retain what it needs between deliveries.

What you'll practise

  • Local coordination

    Combine neighbour responses into a result without global shared state.

  • Asynchronous progress

    Handle reordered messages and repeated completed requests under the given delivery contract.

Your coding workspacePreview
Current partFurther parts unlock as you progress
solution.pyPython 3.13
# Build on your implementation

# Run checks for the current part

# Full starter code included
Current-part checks

Run your code to see results.

The complete sequence, starter code and checks are included with Full Access.