# Video Game Matchmaking — SQL Interview Question

Aced (formerly Exponent) publishes a public search API over its indexed pages; the guide is at https://www.aced.io/agents/agent-access.

Source: https://www.aced.io/questions/3074/video-game-matchmaking
Source observed: 2026-11-04T23:34:28.908Z
Last checked: 2026-11-04T23:34:28.908+00:00
Indexed: 2026-11-06T16:33:48.406+00:00

---

# Video Game Matchmaking

We provide interview preparation through Aced (formerly Exponent). This medium-difficulty question is categorized under [Coding](https://www.aced.io/questions?type=coding) and [SQL](https://www.aced.io/questions?type=sql).

## Problem

Electronic Arts makes popular online games with multiplayer “matchmaking.” For a special event, EA wants every player to play against every other player exactly once. Each player has a skill and experience level.

You are given a `players` table with these columns:

| Column | Type | Meaning |
|---|---|---|
| `player_name` | string | The player's username. |
| `level` | integer | The player's skill level; higher numbers indicate greater skill. |

Write a SQL query that:

- Generates every possible matchup between distinct players exactly once.
- Calculates the level disparity between the two players in each matchup.
- Excludes matchups where the players are more than 5 levels apart.
- Sorts the returned matches in ascending order of `level_disparity`.

Return these columns:

| Column | Contents |
|---|---|
| `player1` | A player name. |
| `player2` | A player name. |
| `level_disparity` | The difference in level between the two players. |

The player-name columns must be populated from `players.player_name`. The question requires each unordered pairing once, rather than both player orders.

## Practice controls

The question interface includes separate **Question**, **Solution**, and **Community** tabs, plus two expandable hints. The rendered page shows one interview occurrence, marked as coding, and reports it was last asked 3 years ago. No community answers are currently contributed. Running code requires [signing up](https://www.aced.io/signup?src=lesson); detailed company statistics require an [upgrade](https://www.aced.io/upgrade?src=questions).

## Aced interview preparation

Our available preparation areas include Product Management, Forward Deployed, Engineering Management, Software Engineering, System Design, Data Science, Machine Learning, Data Engineering, AI Engineering, Investment Banking, Generative AI, Security Engineer, TPM, Solutions Architect, UX / Product Design, and BizOps & Strategy. We also offer question collections, practice, interview coaching, resume review, salary negotiation, job referrals, resources, and related services.

- [All questions](https://www.aced.io/questions)
- [Courses](https://www.aced.io/courses?src=nav)
- [Practice](https://www.aced.io/practice?src=nav)
- [Coaching](https://www.aced.io/coaching?src=nav)
- [Pricing](https://www.aced.io/upgrade?src=nav)

## Question metadata

- Difficulty: Medium
- Categories: Coding; SQL
- Interview occurrence: 1
- Community answers: none contributed

---

[Read this page’s summary](https://www.aced.io/agents/api/public/v1/page-tldr?url=https%3A%2F%2Fwww.aced.io%2Fquestions%2F3074%2Fvideo-game-matchmaking&trace=t_679ff9ab98f3)

## Ask a follow-up about this page

Need a more specific answer? Ask the exact question you have. It returns a fresh, cited answer from Aced (formerly Exponent)’s knowledge base. No account or API key required.

Open this URL with your own question, URL-encoded. Include your question in q. All research inputs are optional; no account or setup.

`GET https://www.aced.io/agents/agent/faq?q={question}&trace=t_679ff9ab98f3`

[Tool guide and examples](https://www.aced.io/agents/agent-access) · [OpenAPI](https://www.aced.io/agents/api/public/v1/openapi.json) · [Page TLDR form](https://www.aced.io/agents/agent-tools/page-tldr?url=https%3A%2F%2Fwww.aced.io%2Fquestions%2F3074%2Fvideo-game-matchmaking). Opening a form does not execute a tool.