CredolayOpen specification · retail-performance-investigation · v2

Retail Performance Investigation

Sales are up and profit is down. Clean the data, find out why, and tell management what to do.

Data AnalystIntermediate90 minutes9 tasks + 4-question defenceModes: Independent, AI-assisted
§ 1

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.

§ 2

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.

sales_transactions.csv25,238 rows
transaction_iddatestore_idregionproduct_idquantityunit_pricediscount_pctunit_costreturned
T20240052352024-01-01S102LondonP0634321.720.0211.850
T20240148472024-01-01S502South WestP0755358.750.0533.50
T20240130162024-01-01S404ScotlandP0951232.730.0817.830
T20240211052024-01-01S403ScotlandP0219428.030.0316.120
T20240023502024-01-01S204North WestP0645252.240.0429.660
T20240156152024-01-01S301MidlandsP1195212.260.026.910
product_inventory.csv1,200 rows
product_idproduct_namecategorysupplierlist_pricestock_on_hand
P0001Coastal Olive OilGroceryHarlow Fresh58.31139
P0002Organic Storage BoxHomeAshdown Living20.86108
P0003Premium ChargerElectronicsQuanta Devices13.5174
P0004Heritage ScarfApparelThreadworks28.48243
P0005Urban Hand CreamBeautyLumen Beauty26.0983
P0006Organic Coffee BeansGroceryHarlow Fresh54.64219
§ 3

The tasks

Weights are shares of the simulation score (total 13.5). Each task names the competencies it evidences and how strongly.

  1. 1. Find the double-posted rows
    A 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. 2. Net revenue for 2025
    A 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. 3. Gross margin, Q4 2025
    A 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. 4. Where the profit went
    One 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. 5. Why it went
    One 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. 6. The returns problem
    One 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. 7. The query behind it
    Code · 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 lineWeightFull marks (4/4) looks like
    Joins25%Transactions joined to products on product_id, with no fan-out that double counts lines.
    Cleaning30%Exact duplicates removed (DISTINCT or ROW_NUMBER), the test store excluded, returned lines excluded.
    Aggregation30%Quarter derived correctly from the date; profit computed per line as quantity × (unit_price × (1 − discount_pct) − unit_cost) before summing.
    Readability15%Named CTEs or clear aliases, consistent formatting, nothing that does not need to be there.
  8. 8. Design the management dashboard
    Written · 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 lineWeightFull marks (4/4) looks like
    Answers the question35%Separates revenue from profit and margin, so the dashboard shows why profit fell, not just that sales rose.
    Right chart for the job25%Trends over time as lines, comparisons as sorted bars, no pies for many categories, no truncated axes.
    Leads to the cause25%Includes the breakdowns that expose the drivers: discount rate and unit cost by category, return rate by region.
    Specified clearly15%Someone could build it from this without asking a follow-up question.
  9. 9. Brief the management team
    Written · 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 lineWeightFull marks (4/4) looks like
    Correct diagnosis30%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.
    Evidence25%Quotes figures that match the data: revenue growth, margin change, discount rates before and after.
    Actionable25%Specific first actions in priority order, tied to the causes found.
    Right for the audience20%Plain English, short, leads with the answer; caveats stated without burying the message.
§ 4

The defence

After submitting, candidates answer these against the clock, typed live. Prompts quote the candidate's own submission where shown in brackets.

  1. D1. Explain your work
    5 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 lineWeightFull marks (4/4) looks like
    Describes their own query accurately60%The explanation matches what the submitted SQL actually does, including its cleaning steps.
    Handles the edge case40%Correctly says whether the product appears (with an inner join and GROUP BY it does not) and whether a zero row would be wanted.
  2. D2. Modify it
    5 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 lineWeightFull marks (4/4) looks like
    Grouping and filter50%Groups by region and month (date_trunc or equivalent) and filters to 2025.
    Blank regions50%Uses COALESCE/NULLIF or a CASE so blank or null regions become 'Unknown' rather than disappearing.
  3. D3. Spot the error
    3 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
  4. D4. Adapt it
    5 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 lineWeightFull marks (4/4) looks like
    Sound estimate60%Estimates the cost as the rise in discount rate × the category's 2025 gross sales (or equivalent), in the right order of magnitude.
    Leading indicator40%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.