stratascratch
  • Interview Questions
    • Interview Loops
    • Analytical
    • Algorithm
    • ML Coding
    • Stats Coding
    • Visualization
    • Concept
  • Data Labs
    • Discover
    • Your Notebooks
  • Mock Interview
  • Learn
  • Blog
  • Pricing
  • About
Log in
  • Interview Questions

    • Interview Loops
    • Analytical
    • Algorithm
    • ML Coding
    • Stats Coding
    • Visualization
    • Concept
  • Data Labs

    • Discover
    • Your Notebooks
  • Mock Interview
  • Learn
  • Blog
  • Pricing
  • About
Log inSign up
Back to Mini Analyses
  1. Assignment
  2. Your Solution
  3. Solution
  4. Solutions from Users
  5. Discussion

Store Contribution Margin

You must be logged in to download the datasets

Starbucks: Compute each store's contribution margin and flag unprofitable stores.

Assignment

The finance team has exported the latest store financials for a profitability review, and wants a quick analysis before sharing the numbers with regional managers.

Deliverables

  • The contribution margin for each store, both as an amount and as a share of that store's revenue.
  • Overall profitability across the stores.
  • A short closing report for the finance team: your recommendation for any store that is not profitable, plus anything they should double-check before relying on the numbers.

Note: Contribution margin is what's left of a store's revenue after the costs that rise and fall with sales, before the costs that stay the same whether the store is busy or quiet. It shows how much each store contributes toward covering those fixed costs.

Data Description

starbucks_store_financials.csv has one row per store:

  • store_id
  • location
  • region
  • revenue
  • variable_costs - costs that scale with sales
  • fixed_costs - costs that don't depend on sales

Practicalities

You can solve this in Python, SQL, or a mix of both — StrataScratch notebooks support both languages in the same notebook.

Assume this data comes directly from the finance system and hasn't been cleaned, so review it carefully before relying on the numbers. When something looks off, work out what it is and decide how to handle it; when a definition or a final decision is genuinely ambiguous, choose a reasonable option and explain why. There's often more than one valid way to compute a result, so explain the approach you take and the reasoning behind your choices.

What's assessed: your results, and how clearly you explain what you see in the data and justify the choices you make.

This question is part of an interview loop

See the full interview round by round, with questions for each stage.

E-commerce & retail · Analytics Engineer