xAI

Verified interview challenge

Aggregate active time in live audio spaces

Turn audio-space events into completed listening time and a live ranking of active spaces.

Unlock with Full Access

The challenge

Process creation, join and leave events for live audio spaces. First calculate time from completed user sessions, then maintain a live ranking of spaces by active users.

Historical participation and current occupancy describe different things. Extend your implementation so closing a session contributes to elapsed time while each new event also updates the view of who is active now.

What you'll practise

  • Session accounting

    Pair state transitions correctly when calculating completed activity.

  • Live ranking

    Maintain the current view as users join and leave spaces.

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.