Practice · For the long game

Sharpen on real
interview-quality questions.

Bite-sized SQL and Python challenges, each with hidden test cases that change the data — so the lazy answer doesn't fly.

All challenges
Highest-paying customer per month
A payments table records every payment made.
SQL
Two Sum
Given a list of integers and a target, find the two distinct indices whose values sum to the target.
Python
Fizzbuzz
> Read an integer n from stdin.
Python
Monthly Active Users
Given events(user_id INT, ts TEXT) where ts is ISO date, return (month TEXT, mau INT) for each month present in the data — month as YYYY-MM, sorted ascending by
SQL
Second Highest Salary Per Department
Given employees(employee_id INT, name TEXT, department TEXT, salary INT), return the second highest distinct salary within each department.
SQL
Friend Recommendations by Mutual Friends
Given friendships(user_a INT, user_b INT) where each row means user_a and user_b are friends (the relationship is stored once, always with user_a < user_b), ret
SQL
LRU Cache
Design a data structure that follows the constraints of a Least Recently Used (LRU) cache.
Python
Top 3 Most-Watched Genres per Country — Netflix
Netflix tracks every viewing session in a table called viewing_sessions: viewing_sessions ( session_id BIGINT PRIMARY KEY, user_id BIGINT, title_id
SQL
Detecting Binge-Watch Streaks — Netflix
Using the same viewing_sessions table, a "binge streak" is defined as 3 or more consecutive days where a user watched at least 2 hours total.
SQL
Sliding Window: Trending Titles Detector — Netflix
Netflix's trending algorithm needs to detect titles whose hourly view count exceeds 2x their trailing 24-hour average at any point.
Python
Guest Booking Funnel Conversion by Market — Airbnb
Airbnb tracks the guest booking funnel in a table called funnel_events: funnel_events ( event_id BIGINT PRIMARY KEY, user_id BIGINT, session_id VA
SQL
Host Superhost Qualification Logic — Airbnb
Airbnb's Superhost program evaluates hosts quarterly.
SQL
Search Ranking Feature: Host Response Probability — Airbnb
Airbnb's search ranking uses a feature called "host_response_probability" — the estimated likelihood that a host will accept a booking request, given historica
Python
API Usage Analytics: Token Cost Attribution — OpenAI
OpenAI tracks every API request in a table called api_requests: api_requests ( request_id UUID PRIMARY KEY, org_id VARCHAR(64), model VARCHAR(50),
SQLMedium
Detecting Model Regression: Eval Score Anomalies — OpenAI
OpenAI runs continuous evaluation suites against deployed models.
SQLHard
Token-Efficient Prompt Caching System — OpenAI
OpenAI's API serves requests where many users send prompts with identical system message prefixes (e.g., the same "You are a helpful assistant..." followed by
PythonMedium
Discovering Weekly Listener Engagement — Spotify
Spotify tracks every listening session in a table called listening_events: listening_events ( event_id BIGINT PRIMARY KEY, user_id BIGINT, track_i
SQLMedium
A/B Testing Impact: Analyzing Cohort Retention — Spotify
Spotify runs A/B tests on audio algorithm features.
SQLHard
Real-Time Feature Computation: Sliding Window User Stats — Spotify
Spotify's real-time recommendation engine needs live user statistics for personalization: - Genres listened to in the last 7 days - Top 3 artists (by stream cou
PythonMedium
Top Cities by Surge-Adjusted Demand — Uber
Uber tracks every trip in a table called trips: trips ( trip_id BIGINT PRIMARY KEY, driver_id BIGINT, rider_id BIGINT, city_code VARCHAR(3),
SQLMedium
Driver Availability Windows: Long Online Sessions — Uber
Uber tracks driver online/offline events in dispatch_events: dispatch_events ( event_id BIGINT PRIMARY KEY, driver_id BIGINT, city_code VARCHAR(3)
SQLHard
Real-Time Demand Anomaly Detection — Uber
Uber's demand signal (ride requests per minute per city) tells you when to trigger surge pricing and alert operations teams.
PythonMedium
Daily Payment Success Rate by Merchant — Stripe
Stripe tracks all payment attempts in a table called charges: charges ( charge_id TEXT PRIMARY KEY, merchant_id INTEGER, amount INTEGER, -- i
SQLMedium
Revenue Recognition by Payout Cycle — Stripe
Stripe settles merchant funds via periodic payouts.
SQLHard
Merchant Fraud Signal Computation — Stripe
Stripe computes fraud signals in real-time for every merchant.
PythonMedium
Feed Ranking Model Performance: Engagement & Calibration — Meta
Meta's feed ranking system makes billions of predictions daily.
SQLMedium
Feature Store Latency Degradation Detection — Meta
Meta's feature store serves user embeddings and computed features (engagement history, content preferences, social graph features) to the feed ranking model i
SQLHard
Embedding Batch Deduplication System — Meta
Meta's ads ranking system ingests millions of ad embeddings daily from external advertisers.
PythonMedium
Top 3 Event Types by Query Volume per Workspace — Databricks
Databricks tracks cluster and job execution events in a table called cluster_events: cluster_events ( event_id BIGINT PRIMARY KEY, workspace_id BIGINT
SQLMedium
Detecting Job-Run Failure Streaks — Databricks
Using the job_runs table, a "failure streak" is defined as 2 or more consecutive days where a job failed at least once per day.
SQLHard
Query Performance Anomaly Detector — Databricks
Databricks' performance monitoring system needs to detect queries that exceed a slow-query threshold within a rolling window of the last 100 queries per cluste
PythonMedium
YouTube Engagement Cohort Analysis — Google
Google YouTube tracks every watch session in a table called watch_sessions: watch_sessions ( session_id BIGINT PRIMARY KEY, user_id BIGINT, video_
SQLMedium
Multi-Touch Ads Attribution Modeling — Google
Google Ads tracks user journeys through multiple ad interactions before a conversion.
SQLHard
YouTube Event Sessionization — Google
YouTube's analytics backend processes raw events (play, pause, seek, like, comment) and reconstructs them into sessions for cohort analysis.
PythonMedium
Fleet Daily Telemetry & Intervention Analytics — Tesla
Tesla's fleet safety team tracks every vehicle's autopilot engagement and human interventions in real-time.
SQLMedium
Autopilot Engagement Gaps & Session Continuity — Tesla
Tesla's data engine needs to analyze autopilot engagement patterns by finding consecutive engagement segments and the gaps between them.
SQLHard
Sensor Stream Processor: Windowing & Deduplication — Tesla
Tesla vehicles stream sensor data (camera, lidar, radar) to edge devices and to the cloud at high frequency (100+ Hz).
PythonMedium
Top Trading Pairs by Volume per Asset Class — Coinbase
Coinbase tracks every trade in a table called trades: trades ( trade_id BIGINT PRIMARY KEY, user_id BIGINT, base_asset VARCHAR(20), quote_asse
SQLMedium
Detecting Suspicious Trading Patterns via Wallet Velocity — Coinbase
Using the same trades table, a "high-velocity suspicious pattern" is defined as: a single wallet that executed 10+ trades in a single 1-hour window AND the tota
SQLHard
Sliding Window: Anomaly Detector for Suspicious Transactions — Coinbase
Coinbase's compliance monitoring needs to detect suspicious transaction patterns in real-time using a sliding-window approach.
PythonMedium
Query SCD2 Customer Revenue as-of Date
Given the pre-built star schema below, write a SQL query that computes total revenue by customer segment as it was on 2026-02-15.
SQLMedium
Month-over-Month Cohort Revenue with SCD2
Given the same star schema (dim_date, dim_customer with SCD2, dim_product, fact_orders), compute Month-over-Month (MoM) revenue cohort analysis.
SQLHard
Sliding Window: Top-K Frequent Keys in Event Stream
You are building a real-time analytics system that must detect the top-K most-frequently-appearing keys (e.g., user IDs, events, or topics) within a rolling tim
PythonMedium
Heap-Based Merge: K Sorted Partitions with Memory Budget
In a distributed data system, you have K pre-sorted partition files that must be merged into a single sorted stream.
PythonHard
Graph DP: DAG Table Dependencies & Minimal Recompute Set
In a data warehouse, tables form a directed acyclic graph (DAG) of dependencies.
PythonHard
Running Total of Daily Signups
A product team tracks signups per day in a table called daily_signups: daily_signups ( signup_date TEXT, -- 'YYYY-MM-DD', unique signups INTEGER )
SQLEasy
Second-Highest Order Amount
An e-commerce platform stores orders in a table called orders: orders ( order_id INTEGER PRIMARY KEY, customer_id INTEGER, amount INTEGER ) Writ
SQLEasy
Find Duplicate Email Registrations
A signup service stores registrations in a table called users: users ( user_id INTEGER PRIMARY KEY, email TEXT ) Data-quality check: some emails wer
SQLEasy
Orphaned Orders — Anti-Join
After a botched customer-table migration, some orders reference customers that no longer exist: customers ( customer_id INTEGER PRIMARY KEY, name TEXT
SQLEasy
Order Value Buckets
A payments team wants a histogram of order sizes from the orders table: orders ( order_id INTEGER PRIMARY KEY, amount INTEGER ) Bucket each order:
SQLEasy
Latest Reading per Device — Deduplication
An IoT ingestion pipeline lands raw sensor data in device_readings — devices report repeatedly, and replays can duplicate timestamps: device_readings ( re
SQLMedium
Month-over-Month Revenue Growth
Finance keeps a pre-aggregated monthly revenue table: monthly_revenue ( month TEXT, -- 'YYYY-MM', unique revenue INTEGER ) Write a SQL query
SQLMedium
Category Revenue Share
A marketplace stores every sold line item in order_items: order_items ( item_id INTEGER PRIMARY KEY, category TEXT, amount INTEGER ) Write a SQL
SQLMedium
First and Last Marketing Touch per User
Growth wants first-touch vs last-touch attribution from the raw touch log: marketing_touches ( touch_id INTEGER PRIMARY KEY, -- monotonically increasing
SQLMedium
Average Days Between Orders
A retention analyst wants to know how frequently repeat customers order: orders ( order_id INTEGER PRIMARY KEY, customer_id INTEGER, order_date TE
SQLMedium
Top Spender per Category (with Ties)
Loyalty wants to reward the biggest spender in every product category: purchases ( purchase_id INTEGER PRIMARY KEY, customer_id INTEGER, category
SQLMedium
3-Day Rolling Average of Page Views
A dashboard shows page views with a smoothing window.
SQLMedium
Ticket Status Pivot by Month
Support tickets are tagged with a month and a status: support_tickets ( ticket_id INTEGER PRIMARY KEY, month TEXT, -- 'YYYY-MM' status TEXT
SQLMedium
Median API Latency per Endpoint
An observability pipeline stores one row per API request: api_latencies ( request_id INTEGER PRIMARY KEY, endpoint TEXT, latency_ms INTEGER ) SQ
SQLHard
Missing Order Dates — Recursive Date Spine
An ops team suspects the order ingestion job silently dropped some days during the first week of June 2024.
SQLHard
Log Level Counter with Malformed Lines
A log shipper emits lines of the form: <timestamp> <LEVEL> <message> where LEVEL is one of DEBUG, INFO, WARN, ERROR (uppercase) and <message> is one or more w
PythonEasy
Revenue Rollup by Region
You receive raw sales records as comma-separated "region,amount" pairs.
PythonEasy
Moving Average over a Metric Stream
Compute the k-value moving average over a stream of integer metric readings.
PythonEasy
Exponential Backoff Schedule
A job scheduler retries failed tasks with capped exponential backoff.
PythonEasy
Email Address Normalization
A CRM has duplicate contacts because emails were stored inconsistently.
PythonEasy
Top-N Words Excluding Stopwords
Build a tiny keyword extractor.
PythonEasy
Merge Overlapping Maintenance Windows
Ops teams schedule maintenance windows as [start, end] intervals (inclusive integer timestamps).
PythonMedium
Config Bracket Validator
A pipeline config parser needs a pre-flight check: are the brackets in each config line balanced?
PythonMedium
Backfill Date-Range Chunking
A backfill orchestrator splits a date range into fixed-size chunks so each chunk can run as its own job.
PythonMedium
Detect Late Events in a Stream
Events should arrive in timestamp order, but the network reorders some.
PythonMedium
Table Schema Diff
A migration tool compares two versions of a table schema.
PythonMedium
Flatten Nested JSON to Dotted Paths
An ETL step flattens nested JSON objects into dotted key paths for a columnar store.
PythonMedium
Sliding-Window Rate Limiter
Implement a per-client sliding-window rate limiter.
PythonMedium
Peak Concurrent Jobs — Sweep Line
A cluster scheduler needs to know the peak number of simultaneously running jobs and when that peak was FIRST reached.
PythonHard
Median Latency Across Two Sorted Shards
Two storage shards each return their latency samples ALREADY SORTED ascending.
PythonHard
Email Domain Signup Counts
A users table stores one row per registered user: users ( user_id INTEGER, email TEXT -- always contains exactly one '@' ) Write a SQL query
SQLEasy
Plans with at Least 3 Active Subscribers
A billing system tracks subscriptions: subscriptions ( sub_id INTEGER, plan TEXT, status TEXT -- 'active' or 'canceled' ) Write a SQL que
SQLEasy
Net Revenue with NULL Discounts
An orders table records gross amounts and optional discounts: orders ( order_id INTEGER, category TEXT, gross_amount INTEGER, discount
SQLEasy
Combine Two Event Sources
Web and mobile clients log user activity into two separate tables with the same shape: web_events ( user_id INTEGER, event_date TEXT -- 'YYYY-M
SQLEasy
Employees Above Department Average
An employees table: employees ( emp_id INTEGER, name TEXT, department TEXT, salary INTEGER ) Write a SQL query that returns ev
SQLMedium
Employees Earning More Than Their Manager
An employees table where each row may reference its manager in the same table: employees ( emp_id INTEGER, name TEXT, salary INTEGER
SQLMedium
Favorite Category per User
A purchases table: purchases ( purchase_id INTEGER, user_id INTEGER, category TEXT ) For each user, find their most frequently purchased
SQLMedium
Users Active on Both Platforms
A logins table records every login with its platform: logins ( login_id INTEGER, user_id INTEGER, platform TEXT -- always 'web' or 'mobile'
SQLMedium
Order Value Quartiles
An orders table: orders ( order_id INTEGER, -- unique amount INTEGER ) Assign each order to a quartile from 1 (highest amounts) to 4 (lowest amo
SQLMedium
Checkout Funnel Conversion
An events table tracks a three-step checkout funnel: events ( user_id INTEGER, event TEXT -- 'view', 'cart', or 'purchase' ) Count the DISTIN
SQLMedium
Longest Daily Login Streak
A logins table records at most one row per user per day: logins ( user_id INTEGER, login_date TEXT -- 'YYYY-MM-DD', unique per user ) For eac
SQLHard
Sessionize Click Events
An events table of raw click timestamps: events ( user_id INTEGER, event_ts TEXT -- 'YYYY-MM-DD HH:MM:SS' ) Sessionize each user's events: a ne
SQLHard
Customers Who Bought Every Featured Product
Two tables: purchases ( user_id INTEGER, product_id INTEGER -- a user can buy the same product multiple times ) featured_products ( produ
SQLHard
Detect Overlapping Room Bookings
A bookings table for meeting rooms: bookings ( booking_id INTEGER, -- unique room_id INTEGER, start_ts TEXT, -- 'YYYY-MM-DD HH:MM'
SQLHard
Monthly Cohort Week-1 Retention
Two tables: users ( user_id INTEGER, signup_date TEXT -- 'YYYY-MM-DD' ) activity ( user_id INTEGER, activity_date TEXT --
SQLHard
Deduplicate Lines Preserving Order
A data feed emits records as lines of text, and downstream consumers must see each distinct record exactly once, in the order it FIRST appeared.
PythonEasy
Run-Length Encoding
Compress a string with run-length encoding: replace every run of consecutive identical characters with the character followed by the run length.
PythonEasy
Parse Duration Strings
A job scheduler stores timeouts as compact duration strings like 2h15m30s, 45m, or 90s.
PythonEasy
Sum a Named CSV Column
You receive a small CSV export (no quoted fields, no embedded commas) and must total one of its integer columns, identified by name.
PythonEasy
Validate IPv4 Addresses
An ingestion pipeline needs to filter malformed IP addresses.
PythonMedium
Sort Semantic Versions
A registry stores package versions as MAJOR.MINOR.PATCH strings (three non-negative integers).
PythonMedium
Parse a Query String
Parse a URL query string of the form key=value&key=value&...
PythonMedium
Fixed-Width Histogram Bins
Build a histogram of non-negative integer values using fixed-width bins [0,w), [w,2w), [2w,3w), ...
PythonMedium
Sessionize a Click Stream
Raw click events arrive as (user, timestamp) pairs in ARBITRARY order.
PythonMedium
Find Coverage Gaps in a Time Window
An on-call schedule must cover a window [window_start, window_end).
PythonMedium
Render a Placeholder Template
A notification service renders message templates containing placeholders of the form {{name}} (no spaces inside the braces; names are word characters).
PythonMedium
Match Times Against a Cron Spec
A simplified cron spec has two fields separated by a space: minute then hour.
PythonHard
Task Dependency Order — Topological Sort
A pipeline scheduler receives dependency pairs "A B" meaning task A must run BEFORE task B.
PythonHard
LRU Cache Simulation
Simulate a least-recently-used (LRU) cache with a fixed capacity processing a sequence of operations: PUT <key> <value> insert or update the key; both a PUT
PythonHard
P95 Latency per Endpoint
Compute the 95th-percentile latency per endpoint using the NEAREST-RANK method: sort the endpoint's latencies ascending and take the value at 1-based rank ceil(
PythonHard
Find Insertion Point in a Sorted List
You're given a sorted list of integers and a target value.
PythonEasy
Longest Substring Without Repeating Characters
Given a single line of text, find the length of the longest contiguous substring that contains no repeated characters.
PythonMedium
Evaluate Reverse Polish Notation
Evaluate an arithmetic expression given in Reverse Polish Notation (postfix).
PythonMedium
Round-Robin CPU Scheduler Simulation
Simulate round-robin CPU scheduling for a set of processes, all arriving at time 0 in the given order.
PythonHard
Rotate a Matrix 90 Degrees Clockwise
Given a square matrix, rotate it 90 degrees clockwise, in place logically.
PythonEasy
Spiral Traversal of a Matrix
Given a matrix, return all its elements in spiral order (starting top-left, clockwise).
PythonMedium
Shortest Path in an Unweighted Grid
Given a grid of 0 (open) and 1 (wall) cells, find the length of the shortest path from a start cell to an end cell, moving up/down/left/right one cell at a time
PythonMedium
Count Connected Components in a Friendship Graph
Given n users (numbered 0..n-1) and a list of friendship edges, count how many separate friend groups (connected components) exist.
PythonMedium
Autocomplete Prefix Matches
Given a dictionary of words and a prefix, return every word that starts with that prefix.
PythonEasy
Detect a Cycle in an Undirected Graph
Given an undirected graph with n nodes (0..n-1) and a list of edges, determine whether it contains a cycle.
PythonMedium
Longest Common Subsequence Length
Given two strings, find the length of their longest common subsequence (characters in the same relative order, not necessarily contiguous).
PythonMedium
Minimum Coins to Make Change
Given a list of coin denominations and a target amount, find the minimum number of coins needed to make exactly that amount (unlimited supply of each coin).
PythonMedium
Edit Distance Between Two Strings
Given two strings, find the minimum number of single-character insertions, deletions, or substitutions to turn the first string into the second.
PythonHard
Generate Valid Parenthesis Combinations
Given n pairs of parentheses, print every combination of well-formed parentheses.
PythonMedium
Word Break — Can a String Be Segmented?
Given a string and a dictionary of words, determine whether the string can be segmented into a space-separated sequence of one or more dictionary words.
PythonMedium
Kth Largest Element in a Data Stream
Numbers arrive one at a time in a stream.
PythonMedium
Group Anagrams
Given a list of words, group the ones that are anagrams of each other.
PythonMedium
Count Set Bits Across a Range
Given two integers L and R (inclusive), find the total number of 1 bits across the binary representations of every integer from L to R.
PythonEasy
Caesar Cipher Encode/Decode
Implement a Caesar cipher.
PythonEasy
Longest Palindromic Substring
Given a string, find its longest palindromic substring.
PythonMedium
Sieve of Eratosthenes
Given N, find every prime number less than or equal to N.
PythonEasy
GCD and LCM of a List of Numbers
Given a list of positive integers, compute their greatest common divisor and least common multiple.
PythonEasy
Conway's Game of Life — One Step
Given a board of 0 (dead) and 1 (alive) cells, compute the next generation using Conway's rules: a live cell with 2 or 3 live neighbors survives; a dead cell wi
PythonMedium
Parking Lot Slot Allocation Simulation
A parking lot has n numbered slots (1..n).
PythonMedium
Simple Arithmetic Expression Evaluator
Evaluate a space-separated arithmetic expression using standard operator precedence ( and / before + and -), left to right within the same precedence.
PythonMedium
Parse and Reformat a Basic INI Config
Parse a simplified INI-style config: [section] headers, key = value lines, blank lines, and comment lines starting with ; (ignored).
PythonMedium
Word Wrap Text to a Fixed Line Width
Given a maximum line width and a block of text, wrap it into lines using a greedy algorithm: add words to the current line as long as it (plus a single separati
PythonEasy
Line Diff — Added and Removed Between Two Text Versions
Compare two text versions and report which lines were removed (present in version A but not B) and which were added (present in B but not A), treating each vers
PythonMedium
Min-Stack with O(1) Minimum Retrieval
Implement a stack that supports retrieving the minimum element in O(1) time, in addition to normal push/pop.
PythonMedium
Currency Rounding — Distribute a Total Evenly to the Cent
Split a total amount of cents evenly among n recipients so the amounts sum exactly to the total.
PythonEasy
Products Sold in Both Q1 and Q2
A sales table has columns product TEXT, sale_date TEXT (YYYY-MM-DD).
SQLMedium
Customers Who Never Made a Return
An orders table has customer TEXT.
SQLEasy
Comma-Separated Tags per Product
A product_tags table has product TEXT, tag TEXT (one row per product/tag pair).
SQLEasy
Detect Price Increases Between Consecutive Updates
A price_history table has product TEXT, effective_date TEXT, price REAL — one row per price change per product.
SQLMedium
Split Employees into Salary Quartiles
An employees table has name TEXT, salary INTEGER.
SQLMedium
Employees Who Have Never Been a Manager
An employees table has id INTEGER, name TEXT, manager_id INTEGER (nullable, references another employee's id).
SQLEasy
Customers With No Orders Since a Cutoff Date
A customers table has id INTEGER, name TEXT.
SQLMedium
Total Component Count in a Multi-Level Bill of Materials
A components table has parent TEXT, child TEXT, quantity INTEGER — each row means one unit of parent requires quantity units of child (which may itself be a par
SQLHard
Employee Reporting Chain Depth
An employees table has id INTEGER, name TEXT, manager_id INTEGER (NULL for the top of the org).
SQLMedium
First Purchase Channel per Customer
A purchases table has customer TEXT, purchase_date TEXT, channel TEXT.
SQLMedium
Daily Leaderboard Rank Changes
A scores table has player TEXT, day INTEGER, score INTEGER.
SQLHard
Group Consecutive Same-Price Days into Ranges
A price_log table has day_num INTEGER, price INTEGER — one row per day, days numbered consecutively starting at 1 with no gaps.
SQLHard
Products Frequently Bought Together
An order_items table has order_id INTEGER, product TEXT (one row per product in an order).
SQLMedium
Percentage of Total Revenue by Product
A product_revenue table has product TEXT, revenue REAL.
SQLMedium
Categories With More Than Two Distinct Suppliers
A products table has product TEXT, category TEXT, supplier TEXT.
SQLEasy
Feature Flag Rollout Status Summary
A feature_flags table has feature TEXT, environment TEXT, enabled INTEGER (0 or 1).
SQLMedium
Subscription Renewals Falling on a Weekend
A subscriptions table has customer TEXT, renewal_date TEXT (YYYY-MM-DD).
SQLEasy
Corporate vs. Free Email Domain Signups
A signups table has email TEXT.
SQLEasy
Weekly New vs. Returning Customer Orders
A orders table has customer_id INTEGER, order_date TEXT.
SQLHard
Days Since Previous Purchase per Customer
An orders table has customer TEXT, order_date TEXT.
SQLMedium
Employees With No Completed Training
An employees table has id INTEGER, name TEXT.
SQLEasy
Order Status Counts per Day
An orders table has order_date TEXT, status TEXT (one of placed, shipped, delivered, cancelled).
SQLMedium
Percentile Rank of Each Student's Score
A students table has name TEXT, score INTEGER.
SQLMedium
Revenue by Product Category and Region
A products table has product_id INTEGER, product_name TEXT, category TEXT.
SQLMedium
Each Order's Percentage of That Day's Total
An orders table has order_id INTEGER, order_date TEXT, amount REAL.
SQLMedium
Find Missing SKU Numbers in a Sequence
A skus table has sku_number INTEGER.
SQLHard
Count Direct Reports per Manager
An employees table has id INTEGER, name TEXT, manager_id INTEGER.
SQLEasy
Split Comma-Separated Skill Tags into Rows
A profiles table has user_name TEXT, skills TEXT — a comma-separated list with no trailing comma (e.g.
SQLHard
Second Most Recent Login per User
A logins table has user_name TEXT, login_time TEXT.
SQLMedium
Customer Lifetime Value Tiering
A customers table has name TEXT, lifetime_value REAL.
SQLEasy
Analytics Engineer Interview — Data Modeling
Design a data model for a realistic Analytics Engineer Interview scenario.
Data modelMedium
Analytics Engineer Interview — Data Architecture
You're the analytics engineer at a mid-size direct-to-consumer subscription brand (~500K active subscribers).
ArchitectureMedium
AI Engineer Interview — Data Modeling
Design a data model for a realistic AI Engineer Interview scenario.
Data modelMedium
AI Engineer Interview — Data Architecture
You're the AI engineer building an internal RAG-based support assistant that customer support agents use to answer questions by searching product docs and past
ArchitectureMedium
Data Engineer Interview — Data Modeling
Design a data model for a realistic Data Engineer Interview scenario.
Data modelMedium
Data Engineer Interview — Data Architecture
You're the data engineer at a 200-store retail chain.
ArchitectureMedium
test-data-model-ride-sharing
Design a data model for a ride-sharing marketplace that needs analytics on trips, drivers, riders, surge pricing, and cancellations over time.
Data modelMedium
test-architecture-clickstream-pipeline
Propose an end-to-end data architecture for ingesting and serving web/app clickstream events (~50M events/day) for both near-real-time dashboards and daily batc
ArchitectureHard
Netflix Content Catalog Dimensional Model
Design a dimensional data model for Netflix's content catalog and viewing analytics.
Data modelMedium
Real-Time Viewing Event Pipeline — Netflix
Design a data architecture for Netflix's real-time viewing event pipeline.
ArchitectureHard
Airbnb Marketplace Metrics Dimensional Model
Design a dimensional data model that powers Airbnb's core marketplace health metrics.
Data modelHard
Airbnb Experimentation Platform Data Architecture
Design the data architecture for Airbnb's experimentation (A/B testing) platform that supports 1,000+ concurrent experiments across web, iOS, and Android.
ArchitectureHard
LLM Inference Observability Data Model — OpenAI
Design a dimensional data model for OpenAI's LLM inference observability platform.
Data modelHard
RAG Evaluation Pipeline Architecture — OpenAI
Design the data architecture for an end-to-end RAG (Retrieval-Augmented Generation) evaluation and monitoring system at OpenAI scale.
ArchitectureHard
Spotify Recommendation Engine Data Model
Design a dimensional data model for Spotify's recommendation engine and listening analytics.
Data modelHard
Real-Time Music Recommendation Pipeline — Spotify
Design a data architecture for Spotify's real-time music recommendation pipeline.
ArchitectureHard
Uber Marketplace Dimensional Model
Design a dimensional data model for Uber's trip marketplace and real-time supply/demand analytics.
Data modelHard
Real-Time Dispatch Optimization Pipeline — Uber
Design a data architecture for Uber's real-time dispatch optimization pipeline.
ArchitectureHard
Stripe Global Payments Dimensional Model
Design a dimensional data model that powers Stripe's core merchant analytics.
Data modelHard
Stripe Real-Time Fraud Detection & Metrics Pipeline
Design the data architecture for Stripe's real-time fraud detection and metrics pipeline that processes billions of API requests per day with <500ms latency for
ArchitectureHard
Feed Ranking Events Data Model — Meta
Design a dimensional data model for Meta's feed ranking system.
Data modelHard
Real-Time Content Integrity ML Pipeline — Meta
Design the data architecture for Meta's content integrity (anti-abuse) ML pipeline that screens content in real-time before it reaches users' feeds.
ArchitectureHard
Databricks Workspace Usage & Billing Dimensional Model
Design a dimensional data model for Databricks workspace usage and billing analytics.
Data modelHard
Multi-Tenant Query Telemetry Pipeline — Databricks
Design a data architecture for Databricks' multi-tenant query telemetry pipeline.
ArchitectureHard
YouTube Engagement & Ads Attribution Dimensional Model — Google
Design a dimensional data model that powers Google's core YouTube engagement and ads attribution analytics.
Data modelHard
Google Experimentation Platform Architecture at Billions Scale
Design the data architecture for Google's internal experimentation (A/B testing) platform serving Search, YouTube, Ads, and other products.
ArchitectureHard
Fleet Sensor Fusion & Auto-Labeling Data Model — Tesla
Design a dimensional data model for Tesla's fleet-scale auto-labeling pipeline.
Data modelHard
Fleet Data Engine: Trigger → Clip → Label → Train Pipeline — Tesla
Design the end-to-end data architecture for Tesla's fleet data engine that powers autonomous driving model training on Dojo.
ArchitectureHard
Coinbase Trades & Wallets Dimensional Model
Design a dimensional data model for Coinbase's trading analytics and wallet tracking.
Data modelHard
Multi-Chain Real-Time ETL & Compliance Pipeline — Coinbase
Design a data architecture for Coinbase's real-time, multi-chain blockchain ETL and compliance monitoring system.
ArchitectureHard
E-Commerce Order Star Schema
Design a dimensional data model for an e-commerce platform's order analytics.
Data modelMedium
Subscription Service with SCD Type 2
Design a dimensional model for a subscription streaming service (e.g., music, video).
Data modelMedium
Two-Sided Marketplace with Bridge Tables
Design a dimensional model for a two-sided marketplace (e.g., Airbnb, Uber, DoorDash).
Data modelHard
Petabyte-Scale Event Fact Design
Design a dimensional model for a high-volume event warehouse (e.g., user interactions, sensor telemetry, ad impressions).
Data modelHard
Batch ELT Warehouse for Mid-Size SaaS
Design a batch ELT (Extract, Load, Transform) data warehouse for a mid-size SaaS company serving 500 enterprise customers across 20 countries.
ArchitectureMedium
Real-Time Clickstream Pipeline: 200K Events/sec
Design a real-time clickstream data pipeline for a global e-commerce platform.
ArchitectureHard
Experimentation & Metrics Platform
Design a full experimentation and metrics platform for a rapidly-growing product company running 50+ concurrent A/B tests.
ArchitectureHard
ML Feature Platform: Offline + Online Serving
Design an ML feature platform supporting both offline training and online inference serving for a recommender system.
ArchitectureHard
500TB Hive-to-Iceberg Migration: Zero Downtime War Story
Design a migration plan for moving a 500TB Hive/HDFS data warehouse to an Iceberg lakehouse with ZERO DOWNTIME for 2000+ downstream jobs.
ArchitectureHard