Open specification · retail-performance-investigation · v2Retail Performance Investigation
Sales are up and profit is down. Clean the data, find out why, and tell management what to do.
The brief
You have just joined Harbour & Hale, a UK homeware and lifestyle retailer with twenty stores across five regions. Sales grew in 2025, but profit fell, and the management team wants to understand why before the next board meeting.
You have two extracts from the warehouse. sales_transactions.csv has one row per line sold in 2024 and 2025: quantity, the unit price charged, the discount given (as a fraction, 0.10 = 10%), the unit cost at the time of sale, and whether the line was later returned (1) or not (0). product_inventory.csv maps each product to its category and supplier.
The extracts are as they came out of the system. A batch of transactions was posted twice, so some rows are exact copies of others. The till-training store, TEST-00, records test sales that must never be counted. About one row in a hundred has no region.
Definitions the finance team uses: net revenue is quantity × unit_price × (1 − discount_pct) on lines that were not returned. Gross profit is net revenue minus quantity × unit_cost on the same lines. Gross margin is gross profit ÷ net revenue.
Use whatever tools you would use at work: SQL, Python, a spreadsheet. Your data is generated for you alone, so your numbers will not match anyone else's.
The data
Every candidate gets their own copy, generated from their attempt's seed. Below is the first few rows from public example seed 20260101; a candidate's numbers will differ.
| transaction_id | date | store_id | region | product_id | quantity | unit_price | discount_pct | unit_cost | returned |
|---|---|---|---|---|---|---|---|---|---|
| T2024005235 | 2024-01-01 | S102 | London | P0634 | 3 | 21.72 | 0.02 | 11.85 | 0 |
| T2024014847 | 2024-01-01 | S502 | South West | P0755 | 3 | 58.75 | 0.05 | 33.5 | 0 |
| T2024013016 | 2024-01-01 | S404 | Scotland | P0951 | 2 | 32.73 | 0.08 | 17.83 | 0 |
| T2024021105 | 2024-01-01 | S403 | Scotland | P0219 | 4 | 28.03 | 0.03 | 16.12 | 0 |
| T2024002350 | 2024-01-01 | S204 | North West | P0645 | 2 | 52.24 | 0.04 | 29.66 | 0 |
| T2024015615 | 2024-01-01 | S301 | Midlands | P1195 | 2 | 12.26 | 0.02 | 6.91 | 0 |
| product_id | product_name | category | supplier | list_price | stock_on_hand |
|---|---|---|---|---|---|
| P0001 | Coastal Olive Oil | Grocery | Harlow Fresh | 58.31 | 139 |
| P0002 | Organic Storage Box | Home | Ashdown Living | 20.86 | 108 |
| P0003 | Premium Charger | Electronics | Quanta Devices | 13.51 | 74 |
| P0004 | Heritage Scarf | Apparel | Threadworks | 28.48 | 243 |
| P0005 | Urban Hand Cream | Beauty | Lumen Beauty | 26.09 | 83 |
| P0006 | Organic Coffee Beans | Grocery | Harlow Fresh | 54.64 | 219 |
The tasks
Weights are shares of the simulation score (total 13.5). Each task names the competencies it evidences and how strongly.
- 1. Find the double-posted rowsA number from your data · weight 1
How many extra duplicate rows does sales_transactions.csv contain? A duplicate is an exact copy of another row in every column. If a row appears twice, that is one extra row.
Tolerance: ±0 · confidence asked before reveal
Evidences: Data cleaning ×1
- 2. Net revenue for 2025A number from your data · weight 1.5
After removing duplicates and test transactions, what was total net revenue for calendar year 2025? Round to the nearest pound.
Tolerance: ±0.5%
Evidences: Data analysis ×1 · Data cleaning ×0.5 · SQL ×0.5
- 3. Gross margin, Q4 2025A number from your data · weight 1.5
What was the gross margin in Q4 2025 (October to December), using the same cleaning? Give a percentage to one decimal place.
Tolerance: ±0.2 points · confidence asked before reveal
Evidences: Data analysis ×1 · SQL ×0.5
- 4. Where the profit wentOne answer · weight 1.5
Which product category's gross profit fell the most, in pounds, between 2024 and 2025?
- ○Grocery
- ○Home
- ○Electronics
- ○Apparel
- ○Beauty
Evidences: Data analysis ×1 · SQL ×1
- 5. Why it wentOne answer · weight 1.5
What mainly explains that category's fall in profit?
- ○Heavier discounting
- ○Higher unit costs from suppliers
- ○More items being returned
- ○Fewer units sold
- ○Lower list prices
Evidences: Business analysis ×1 · Critical thinking ×0.6 · Data analysis ×0.5
- 6. The returns problemOne answer · weight 1
One region's return rate rose sharply in 2025 compared with 2024. Which one?
- ○London
- ○North West
- ○Midlands
- ○Scotland
- ○South West
Evidences: Data analysis ×1
- 7. The query behind itCode · weight 2
Write the SQL (PostgreSQL) you would use to produce gross profit by category by quarter, with the two files loaded as tables named sales_transactions and product_inventory. It should exclude duplicates, test transactions and returned lines.
Evidences: SQL ×1 · Data cleaning ×0.3
Rubric line Weight Full marks (4/4) looks like Joins 25% Transactions joined to products on product_id, with no fan-out that double counts lines. Cleaning 30% Exact duplicates removed (DISTINCT or ROW_NUMBER), the test store excluded, returned lines excluded. Aggregation 30% Quarter derived correctly from the date; profit computed per line as quantity × (unit_price × (1 − discount_pct) − unit_cost) before summing. Readability 15% Named CTEs or clear aliases, consistent formatting, nothing that does not need to be there. - 8. Design the management dashboardWritten · weight 1.5
Specify the management dashboard you would build: three to five visuals. For each one give the metric, the breakdown, the chart type, and the question it answers for the management team.
Evidences: Data visualisation ×1 · Business analysis ×0.3
Rubric line Weight Full marks (4/4) looks like Answers the question 35% Separates revenue from profit and margin, so the dashboard shows why profit fell, not just that sales rose. Right chart for the job 25% Trends over time as lines, comparisons as sorted bars, no pies for many categories, no truncated axes. Leads to the cause 25% Includes the breakdowns that expose the drivers: discount rate and unit cost by category, return rate by region. Specified clearly 15% Someone could build it from this without asking a follow-up question. - 9. Brief the management teamWritten · weight 2
Write to the management team. Say what is happening to profit and why, give the evidence with numbers from your analysis, say what they should do first, and what you would check next. They are not analysts.
Evidences: Communication ×1 · Business analysis ×1 · Critical thinking ×0.4
Rubric line Weight Full marks (4/4) looks like Correct diagnosis 30% Names the over-discounted category as the main driver, the supplier cost rise as the second, and the returns region as a smaller, separate issue. Evidence 25% Quotes figures that match the data: revenue growth, margin change, discount rates before and after. Actionable 25% Specific first actions in priority order, tied to the causes found. Right for the audience 20% Plain English, short, leads with the answer; caveats stated without burying the message.
The defence
After submitting, candidates answer these against the clock, typed live. Prompts quote the candidate's own submission where shown in brackets.
- D1. Explain your work5 min
This is the SQL you submitted: [the candidate's own answer to "The query behind it"] Walk through what it does, step by step. Then: a product sold in 2024 but not at all in 2025 — does it appear in your output for 2025, and should it?
Rubric line Weight Full marks (4/4) looks like Describes their own query accurately 60% The explanation matches what the submitted SQL actually does, including its cleaning steps. Handles the edge case 40% Correctly says whether the product appears (with an inner join and GROUP BY it does not) and whether a zero row would be wanted. - D2. Modify it5 min
The finance director now wants the same figures by region and by month, for 2025 only, and wants rows with a blank region shown as 'Unknown' instead of dropped. What exactly would you change? Write the changed lines or describe them precisely.
Rubric line Weight Full marks (4/4) looks like Grouping and filter 50% Groups by region and month (date_trunc or equivalent) and filters to 2025. Blank regions 50% Uses COALESCE/NULLIF or a CASE so blank or null regions become 'Unknown' rather than disappearing. - D3. Spot the error3 min
A colleague wrote this to compute gross profit by category. What is wrong with it?
WITH t AS ( SELECT DISTINCT * FROM sales_transactions WHERE store_id <> 'TEST-00' AND returned = 0 ) SELECT p.category, SUM(t.quantity * t.unit_price * (1 - t.discount_pct)) AS net_revenue, SUM(t.quantity * t.unit_price * (1 - t.discount_pct) - t.unit_cost) AS gross_profit FROM t JOIN product_inventory p ON p.product_id = t.product_id GROUP BY p.category;- ○unit_cost is not multiplied by quantity, so gross profit is overstated
- ○The discount should also be applied to unit_cost
- ○The JOIN must be a LEFT JOIN or whole categories will be lost
- ○SELECT DISTINCT * will also remove legitimate repeat purchases
- D4. Adapt it5 min
Management has decided to end the Home promotion. Using your own numbers, roughly how much 2025 gross profit did the extra discounting cost? Show how you would estimate it, and name one figure you would track weekly to confirm the fix is working.
Rubric line Weight Full marks (4/4) looks like Sound estimate 60% Estimates the cost as the rise in discount rate × the category's 2025 gross sales (or equivalent), in the right order of magnitude. Leading indicator 40% A weekly measure that would move first: discount rate or margin for the category, ideally alongside its unit sales.
How marks become a result: the method.