Dataford
Interview QuestionsInterview GuidesExperiencesCoaching
New
Pricing
Get started
Dataford
Popular roles
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Browse
Browse All RolesEvery role hub, from analyst to MLBrowse All CompaniesCompany-specific interview loopsAll Interview GuidesThe full guide library
Top questions by role
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Top questions by skill
SQLPythonStatisticsMachine LearningA/B TestingSystem DesignGenerative AIProduct SenseMetricsBehavioral
Browse all questions →Try a mock interview
Experiences
Practice
Mock InterviewsTimed interview simulations with feedbackCoaching1:1 coaching with people at your target companiesSuccess PathYour 6-week structured planModulesCurated lessons by topicWebinarsTalks from ex-Big Tech data leadsPlaygroundA free-form scratch editor
Learn
BlogInterview strategy and career adviceTech Job Market ReportHiring trends across data and AI rolesFor UniversitiesDataford for career centersAbout DatafordWho we are and how we build
Pricing
Build my plan
Solve Problems with SQL
00:00
5 left

Solve Problems with SQL

MediumSQL · PostgreSQL

Problem

Describe a time you used SQL to solve a complex business problem for a gaming or digital product team.

For this exercise, demonstrate the analysis with the provided gaming product data. Return the latest available calendar month, including games with no activity or revenue in that month.

Output

  1. One row per game, with game_id, game_title, genre, active_players, play_minutes, revenue, revenue_rank, and latest_month
  2. Include every game, use zero for missing activity or revenue, and rank revenue within each genre with ties sharing a rank
  3. Order by genre, descending revenue, then game_title

Schema

games
ColumnTypeDescription
game_idPKINTUnique game identifier
game_titleVARCHAR(120)Game title
genreVARCHAR(40)Primary game genre
player_sessions
ColumnTypeDescription
session_idPKINTUnique gameplay session identifier
game_idINTGame played during the session
player_idINTPlayer associated with the session
session_dateDATEDate of the gameplay session
play_minutesINTMinutes played during the session
purchases
ColumnTypeDescription
purchase_idPKINTUnique purchase identifier
game_idINTGame associated with the purchase
player_idINTPlayer who made the purchase
purchase_dateDATEDate of the purchase
amountNUMERIC(10,2)Purchase revenue
Tablesgamesplayer_sessionspurchases
Interviewer

Your question is Solve Problems with SQL. Start with the requirements and the three tables in the Question tab.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.
CodePostgreSQL
Sign up free to run your codeLog inLn 1
Run your query to see results here.