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
Window Functions for Top Assets
00:00
5 left

Window Functions for Top Assets

MediumSQL · PostgreSQL

Problem

Write a SQL query using window functions to find the top-performing energy assets in each region at Shell.

Use the provided asset and production data. Treat total production during 2025 as the performance measure and include only active assets.

Output

  1. One row per top-performing asset, with ties included
  2. Columns: region, asset_id, asset_name, total_production_mwh, and performance_rank
  3. Return rank 1 assets only, ordered by region and asset_id

Schema

energy_assets
ColumnTypeDescription
asset_idPKINTUnique energy asset identifier
asset_nameVARCHAR(100)Display name of the energy asset
regionVARCHAR(100)Geographic operating region
statusVARCHAR(20)Operational status of the asset
asset_production
ColumnTypeDescription
production_idPKINTUnique production measurement identifier
asset_idINTReferenced energy asset
production_dateDATEDate of the production measurement
production_mwhNUMERIC(14,2)Energy produced in megawatt-hours
Tablesenergy_assetsasset_production
Interviewer

Your question is Window Functions for Top Assets. Start with the requirements and the two 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.