Topic
SQL & Data interview problems
Joins, window functions, aggregation and data cleaning in Python. 239 original problems, each with hidden test cases you can run in the browser.
27 easy200 medium12 hard
Showing 181–210 of 239 results
Write SQL to classify users as US-based using profile and IP data, then identify the top forums by post volume and distinct contributors over a rolling 30-day window.
Model answersqlaggregationjoinswindow-functionsWrite SQL queries to rank vendors by net revenue globally and by city/state, then design and implement data quality checks on a transaction table.
Model answersqlwindow-functionsdata-qualityaggregationJoin three logistics tables to rank states by completed jobs, compute daily average rates, and build a running cumulative count using window functions.
Model answerwindow-functionsaggregationjoinscteWrite SQL to calculate daily conversion metrics and per-user order summaries over a week, handling event deduplication and missing days.
Model answerwindow-functionsaggregationdeduplicationdate-rangesParse a string of price-timestamp ticks, bucket them into fixed-width time windows, compute OHLC stats, and forward-fill any empty windows.
Model answertime-seriesaggregationdata-manipulationpythonTests data deduplication, self-joins, metric definition, and grouped aggregation over access logs with user metadata.
Auto-gradeddata-manipulationaggregationjoinsdeduplicationTests group-by aggregation over a list of transaction records to compute per-category monthly revenue, count, and average order value.
Auto-gradedgroup-by aggregationdata cleaningdictionariesTests window-function thinking, tie-breaking logic, and grouped aggregation by finding users whose very first recorded action each day was opening the app.
Auto-gradedsimulationhash-mapsortingAggregating shipment quality metrics by carrier and time period, computing period-over-period changes, and ranking routes by defect frequency.
Auto-gradedaggregationjoinswindow-functionsdata-analysisBuild a client that fetches all pages of team records, handles retries and rate limits, then returns the top n teams sorted by wins descending and name ascending.
Model answerpaginationapierror-handlingsortingBuild a robust script that authenticates against a paginated REST API, handles rate limits and bad records, and produces serialized output plus top-k category aggregates.
Model answerpythonrest-apipaginationdata-pipelineClassify users as engaged based on activity frequency and device diversity, then compute the engaged-user rate per region.
Auto-gradeddata-manipulationaggregationfilteringMerge two DataFrames on a shared key, then aggregate transaction amounts by region to produce a sorted summary of total and average spend.
Model answerpandasgroupbymergeaggregationTests data joining, deduplication, cohort segmentation, conditional aggregation, and percentage calculations across multiple tables.
Auto-gradeddata-manipulationaggregationcohort-analysisCalculate what fraction of users whose earliest appointment was cancelled never scheduled another confirmed or returned appointment afterward.
Model answersqlwindow-functionsctecohort-analysisCalculate daily hours worked per employee from timestamp-based clock events, handling midnight transitions and data anomalies.
Model answersqlwindow-functionstime-seriesdata-qualityTests aggregating trip data across two tables, guarding against division by zero, and ranking results with a deterministic tie-break.
Auto-gradedaggregationfilteringsortingClean and aggregate edit logs to compute daily percentages of documents edited by owners versus anonymous users.
Model answerdata-cleaningaggregationjoinspandasCompute pixel-level signal metrics aggregated to advertiser-day grain, then correlate data quality scores with conversion and revenue performance.
Model answersqlaggregationjoinsweighted-averagesCompute an overall survey response rate and compare average notification ratings across user tenure cohorts using SQL joins, aggregation, and bucketing.
Model answersqlaggregationcohort-analysisjoinsTests grouping, filtering categorical records, and correctly handling ties when aggregating a frequency count across multiple keys.
Auto-gradedaggregationgroupingfilteringdictionariesTests SQL/Python analytics skills: filtering soft-deleted records, distinct-count aggregation, linear-interpolation percentiles, time-windowed grouping, and tie-breaking sort logic.
Auto-gradedsqlaggregationpercentilesTests join, filter, and conditional aggregation logic to compute per-region metrics with threshold filtering and safe division.
Auto-gradedaggregationjoinsconditional-logicdata-analysisUse window functions to detect consecutive-day activity streaks, compute rolling DAU and revenue metrics, and identify post-order inactivity gaps across three related tables.
Model answerwindow-functionsgap-and-islandrolling-aggregatesdate-arithmeticWrite six targeted SQL queries spanning window functions, event anomalies, time-based filtering, and promo uplift analysis on a realistic food delivery dataset.
Model answerwindow-functionsaggregationjoinstime-seriesWrite a single SQL query that computes cost, CTR, and conversion metrics per ad group, then returns only those with CTR below the unweighted average.
Model answersqlctewindow-functionsnull-handlingBuild a pandas pipeline that aggregates raw sales records, flags per-product outliers using IQR or Z-score, then plots the distribution before and after cleaning.
Model answerpandasoutlier-detectiondata-cleaningmatplotlibProcess user activity logs to build sessions, compute conversion metrics by segment, construct a deduplicated funnel, and identify high-performing segments with confidence intervals.
Model answerpandasdata-analysissessionizationmetricsTests data aggregation, join logic, net-revenue calculation accounting for returns, and ranking with tie-breaking.
Auto-gradedaggregationjoinsrankingwindow-functionsTests ability to implement window-style running totals by computing each row's cumulative spend within its department, ordered by date then transaction ID.
Auto-gradedwindow functionsrunning totalsdata processing