Goal: “It does not matter how slowly you go as long as you do not stop.” — This is a BIG week — we’re closing out both DSA Pass 1 and Python. After this, DSA switches to practice mode and you’ll never have a week without coding problems again.
Topics
| Day | Track | Focus | Topics |
|---|---|---|---|
| Mon | A — DSA | Dynamic Programming | 1D DP Patterns · 2D DP Patterns · Knapsack Patterns · Interval and String DP · DP on Trees and Graphs |
| Tue | B — Python | Advanced OOP & Types | Metaclasses · slots · Type Hints |
| Wed | A — DSA | Greedy & Patterns | Greedy Algorithms · Backtracking · Intervals · Binary Search on Answer · Common Interview Patterns |
| Thu | B — Python | Modern Python | Walrus Operator and Modern Features · Duck Typing and Protocols · Modules, Packages, and Imports |
| Fri | B — Python | Best Practices & Wrap-up | Pythonic Code and PEP8 · File Handling · Design Patterns · Common Output Questions |
Key Concepts
- DP is all about finding overlapping subproblems and optimal substructure. If we can break a problem into smaller versions of itself AND the subproblems repeat, DP is our friend. Start with recursion, add memoization, then convert to tabulation.
- Greedy works when the local optimal choice leads to the global optimal — but we need to prove it (or at least intuit it). Activity selection and fractional knapsack are classic examples.
- Backtracking is brute force with pruning. We explore choices, and the moment we realize a path won’t work, we back up. N-Queens and Sudoku are the poster children.
- Metaclasses are “classes of classes” — rarely used in production but interviewers love asking about them. Know that
typeis the default metaclass and__new__vs__init__at the meta level. __slots__saves memory by preventing__dict__creation on instances. Great for when we have millions of objects with a fixed set of attributes.
Practice
- Solve 1 knapsack variant (0/1 knapsack or unbounded knapsack)
- Solve 1 greedy problem (e.g., activity selection, jump game)
- Solve 1 backtracking problem (N-Queens or generate parentheses)
- Try 3 Python output questions — predict the output before running
- Write a class using
__slots__and compare memory usage with a regular class
~20 topics · ~2 hrs/day · Milestone week: DSA Pass 1 ✓ · Python ✓