You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Location: Backend API Estimated Time: 6 hours Difficulty: Medium
Description
Implement a matchmaking service that pairs players for head-to-head puzzle challenges based on their skill rating. Players join a queue, the system finds the closest-rated opponent within a configurable ELO range, and creates a match session. Queue wait time expands the ELO window every 30 seconds to prevent indefinite waits.
Tasks
MatchmakingQueue entity: playerId, puzzleType, rating, joinedAt, status (waiting/matched/cancelled)
POST /matchmaking/join — player joins queue with preferred puzzle type
DELETE /matchmaking/leave — player leaves queue
GET /matchmaking/status — returns current queue position and estimated wait
Background job runs every 10 seconds: scans queue, pairs players within ELO range (starts at ±50, expands ±25 every 30s)
On match found: creates GameSession with both players; emits WebSocket event match_found to both
GET /matchmaking/history — player's past match results and opponents
Graceful handling: if opponent disconnects before game starts, re-queue the waiting player
Tests: queue join, pairing algorithm, ELO expansion, re-queue on disconnect, concurrent queue safety
Location: Backend API
Estimated Time: 6 hours
Difficulty: Medium
Description
Implement a matchmaking service that pairs players for head-to-head puzzle challenges based on their skill rating. Players join a queue, the system finds the closest-rated opponent within a configurable ELO range, and creates a match session. Queue wait time expands the ELO window every 30 seconds to prevent indefinite waits.
Tasks
MatchmakingQueueentity:playerId,puzzleType,rating,joinedAt,status(waiting/matched/cancelled)POST /matchmaking/join— player joins queue with preferred puzzle typeDELETE /matchmaking/leave— player leaves queueGET /matchmaking/status— returns current queue position and estimated waitGameSessionwith both players; emits WebSocket eventmatch_foundto bothGET /matchmaking/history— player's past match results and opponentsAcceptance Criteria