PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep

Quick Overview

This question evaluates data manipulation and relational-query competencies, focusing on per-entity ranking, deterministic tie-breaking, and reshaping game-level records into team-centric perspectives.

  • Medium
  • Atlassian
  • Data Manipulation (SQL/Python)
  • Data Scientist

Rank each team’s top 3 scores in 2024

Company: Atlassian

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: Medium

Interview Round: Technical Screen

Using the same schema, compute each team’s top 3 highest-scoring games for season_year = 2024, treating each game from BOTH teams’ perspectives (i.e., if A vs B is one row, also consider B’s score in that game). Return columns: team_name, opponent_team_name, team_score, score_rank (1 = highest per team). Break ties deterministically by: team_score DESC, date DESC, game_id ASC. Schema: team(team_id INT PRIMARY KEY, team_name TEXT); game(game_id INT PRIMARY KEY, team_id INT, opponent_team_id INT, date DATE, season_year INT, team_score INT, opponent_team_score INT, game_type TEXT). Sample data: team +---------+------------------------------+ | team_id | team_name | +---------+------------------------------+ | 1 | UConn Huskies | | 2 | San Diego State Aztecs | | 3 | Alabama Crimson Tide | | 4 | Purdue Boilermakers | +---------+------------------------------+ game +---------+------------+-------------+---------+-------------------+------------+---------------------+---------------+ | game_id | date | season_year | team_id | opponent_team_id | team_score | opponent_team_score | game_type | +---------+------------+-------------+---------+-------------------+------------+---------------------+---------------+ | 1101 | 2024-01-15 | 2024 | 3 | 4 | 88 | 79 | REGULAR | | 1102 | 2024-02-01 | 2024 | 1 | 3 | 95 | 70 | REGULAR | | 1103 | 2024-02-20 | 2024 | 1 | 4 | 82 | 85 | REGULAR | | 1104 | 2024-03-03 | 2024 | 2 | 1 | 91 | 93 | REGULAR | | 1105 | 2024-03-10 | 2024 | 2 | 3 | 77 | 74 | REGULAR | +---------+------------+-------------+---------+-------------------+------------+---------------------+---------------+ Write a single SQL query (CTEs allowed) that produces the required columns with row_number-based ranking.

Quick Answer: This question evaluates data manipulation and relational-query competencies, focusing on per-entity ranking, deterministic tie-breaking, and reshaping game-level records into team-centric perspectives.

Last updated: Mar 29, 2026

Loading coding console...

PracHub

Master your tech interviews with 8,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.

Related Coding Questions

  • Label game performance by margin - Atlassian (Medium)
  • Find 2023 NCAA championship winner - Atlassian (Medium)
  • Identify Top-3 Users by Recent Total Spend - Atlassian (Medium)