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:
- Problem Statement - Clear, realistic scenario
- Hints - Collapsible hints to guide without giving away the answer
- Step-by-Step Solution - Detailed walkthrough with explanations
- Key Takeaways - Concept reinforcement
- Common Mistakes - What to avoid
๐ How to Use These Exercises
For Self-Study
- Read the problem carefully
- Try solving it yourself (time yourself!)
- Check the hint if stuck
- Compare your solution to the step-by-step answer
- Note concepts you need to review
For Interview Prep
- Set a timer (15-20 minutes for SQL, 30-45 for case studies)
- Write your solution on paper or in an editor
- Explain your reasoning out loud
- Check the solution for alternative approaches
- Practice until you can solve similar problems fluently
For Team Learning
- Work through problems together
- Discuss different approaches
- Debate tradeoffs
- 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 |
๐ Related Resources
- Statistics & Probability Fundamentals
- SQL & Data Manipulation
- Python Programming
- A/B Testing & Experimentation
- SQL Interview Problems
- Technical Skills
๐ก 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.