Pair Matchmaking Queue Players With a Widening Skill Window

Last updated: November 29, 2026

Quick Overview

Players join a matchmaking queue at integer ticks with a skill rating; each player accepts an opponent whose rating differs by at most base + rate * (ticks waited). Simulate ticks up to a horizon and return the 1v1 matches formed and when.

PlayStation
Coding & Algorithms
Software Engineer
PlayStation
November 29, 2026
Software Engineer
Onsite
Coding & Algorithms
Medium

0

0

0 solved


Players join a matchmaking queue at integer ticks with a skill rating; each player accepts an opponent whose rating differs by at most base + rate * (ticks waited). Simulate ticks up to a horizon and return the 1v1 matches formed and when.

Online services for first-party multiplayer titles need matchmaking that trades match quality against wait time. The interviewer wants a correct simulation, a defensible greedy pairing rule, and discussion of fairness and how this scales beyond a toy queue.

What the Interviewer Expects
  • Model each player's window as a function of their own wait time
  • Require the pair to fit inside both players' windows (use the minimum)
  • Sort waiting players by skill and greedily pair neighbors each tick
  • Explain why adjacent pairing is a reasonable heuristic and where it is not optimal
  • Analyze per-tick cost and propose a better structure for large queues
Key Topics to Cover
Simulation
Greedy
Sorting
Matchmaking
Fairness
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
  • How would you extend this to parties of different sizes or 4v4 teams?
  • Greedy adjacent pairing can leave a player stranded; how would you detect and fix starvation?
  • How would you add a latency or region constraint alongside skill?
  • How would you shard the queue across servers without hurting match quality?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice DSA Problems
Sample Answer
Requirements

Each player is (id, arrival_tick, skill). At tick t a player who arrived at a has window base + rate * (t - a). Two players can match only if their skill gap fits in the smaller of their two windo...

High-Level Design

Each tick: add arrivals, sort waiting players by skill, then sweep left to right. If neighbors i and i+1 fit, match them and skip both; otherwise carry player i to the next tick. In a sorted list the ...


Submit Your Answer
Markdown supported

Related Questions