Dataford
Popular roles
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Trending in AI
Hot
Agentic AI EngineerForward-Deployed EngineerGenAI EngineerAI Architect
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
ExperiencesCoaching
New
Practice
Mock InterviewsTimed interview simulations with feedbackSuccess 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
Start free
Analyzing Complex Datasets
00:00
5 left

Analyzing Complex Datasets

MediumSQL · PostgreSQL

Problem

Describe a complex dataset you worked with and the insights you derived from it.

Use the supplied relational dataset to demonstrate a concise, reproducible analysis of completed orders during 2025. Produce monthly category-level metrics and identify the highest-revenue category within each month.

Output

  1. One row per month and category, including month_start, category, revenue, order_count, customer_count, avg_item_value, and revenue_rank.
  2. Include completed orders from 2025 only, excluding records that cannot be associated with a customer.
  3. Sort by month_start ascending, then revenue_rank ascending, then category ascending.

Schema

customers
ColumnTypeDescription
customer_idPKINTUnique customer identifier
customer_nameVARCHAR(100)Customer's full name
segmentVARCHAR(30)Customer segment
orders
ColumnTypeDescription
order_idPKINTUnique order identifier
customer_idINTCustomer who placed the order
order_dateDATEDate the order was placed
statusVARCHAR(20)Order processing status
order_items
ColumnTypeDescription
order_item_idPKINTUnique order item identifier
order_idINTOrder containing the item
categoryVARCHAR(50)Item category
quantityINTNumber of units purchased
unit_priceDECIMAL(10,2)Price per unit
Tablescustomersordersorder_items
Interviewer

Whenever you're ready, walk me through your approach or go straight to the code. The requirements and the three tables are in the Question tab.

Sign up free to run or submit. Log in
CodePostgreSQL
Sign up free to run your code. Your draft is saved.Run with a free accountLog inLn 1
Run your query to see results here.