Exercises: Step-by-Step Problem Solving

Master data science concepts through hands-on practice. Each exercise includes detailed step-by-step solutions explaining not just what to do, but why.


๐ŸŽฏ Choose Your Level

### ๐ŸŒฑ [Beginner Exercises](/exercises/beginner/) **Perfect for:** Those new to data science or refreshing fundamentals - **Statistics:** Mean vs median, standard deviation, basic probability - **SQL:** SELECT, WHERE, GROUP BY, simple JOINs - **Python:** Loading data, filtering, basic aggregations **Time:** 2-3 hours | **Prerequisites:** None --- ### ๐Ÿš€ [Intermediate Exercises](/exercises/intermediate/) **Perfect for:** Building interview-ready skills - **Statistics:** Hypothesis testing, Bayes' theorem, Simpson's paradox - **SQL:** Window functions, cohort analysis, self-joins - **Python:** Multi-step analysis, complex aggregations **Time:** 3-4 hours | **Prerequisites:** Beginner concepts --- ### ๐Ÿง  [Advanced Exercises](/exercises/advanced/) **Perfect for:** Senior/Staff level preparation - **Statistics:** Difference-in-differences, network effects, causal inference - **SQL:** Recursive CTEs, sessionization, deduplication at scale - **System Design:** Analytics architecture, technology tradeoffs **Time:** 4-6 hours | **Prerequisites:** Intermediate concepts

๐Ÿ“š Whatโ€™s in Each Exercise?

Every exercise follows a consistent structure:

  1. Problem Statement - Clear, realistic scenario
  2. Hints - Collapsible hints to guide without giving away the answer
  3. Step-by-Step Solution - Detailed walkthrough with explanations
  4. Key Takeaways - Concept reinforcement
  5. Common Mistakes - What to avoid

๐ŸŽ“ How to Use These Exercises

For Self-Study

  1. Read the problem carefully
  2. Try solving it yourself (time yourself!)
  3. Check the hint if stuck
  4. Compare your solution to the step-by-step answer
  5. Note concepts you need to review

For Interview Prep

  1. Set a timer (15-20 minutes for SQL, 30-45 for case studies)
  2. Write your solution on paper or in an editor
  3. Explain your reasoning out loud
  4. Check the solution for alternative approaches
  5. Practice until you can solve similar problems fluently

For Team Learning

  1. Work through problems together
  2. Discuss different approaches
  3. Debate tradeoffs
  4. Build shared mental models

๐Ÿ“Š Topic Coverage Matrix

Topic Beginner Intermediate Advanced
Descriptive Stats โœ… Mean, median, SD ย  ย 
Probability โœ… Basic โœ… Bayesโ€™ theorem ย 
Hypothesis Testing ย  โœ… Z-tests โœ… Multiple testing
Causal Inference ย  โœ… Simpsonโ€™s paradox โœ… DiD, PSM
SQL Basics โœ… SELECT, WHERE ย  ย 
Aggregations โœ… GROUP BY ย  ย 
JOINs โœ… Simple โœ… Self-joins โœ… Complex patterns
Window Functions ย  โœ… ROW_NUMBER, LAG โœ… Advanced frames
Recursive CTEs ย  ย  โœ… Hierarchies
Python/Pandas โœ… Basics โœ… Multi-step โœ… Optimization
System Design ย  ย  โœ… Architecture


๐Ÿ’ก Pro Tips

Quality over quantity: Itโ€™s better to deeply understand 5 problems than to rush through 20.

Explain out loud: Practice verbalizing your thought process - this is what interviewers want to hear.

Review mistakes: Your errors are your best teachers. Keep a log of concepts you got wrong.

Time yourself: Interview problems have time pressure. Practice under realistic conditions.

Varies All Levels