Goal: “The only way out is through.” — Month 1 ends with the hardest DSA topics so far (graphs and DP) and the deepest Python concepts (GIL, async, concurrency). We push through together.
Topics
| Day | Track | Focus | Topics |
|---|---|---|---|
| Mon | A — DSA | Tries & Graphs | Tries · Graph Representations · BFS and DFS · Topological Sort |
| Tue | B — Python | Scope & Memory | LEGB Scope Rule · Shallow vs Deep Copy · Garbage Collection |
| Wed | A — DSA | Shortest Paths & DP | Shortest Path Algorithms · Union Find · Advanced Graph Problems · DP Fundamentals |
| Thu | B — Python | Error Handling & Context | Global Interpreter Lock · Exception Handling · Custom Exceptions · Context Managers |
| Fri | B — Python | Concurrency | Threading vs Multiprocessing · asyncio and async/await · Concurrent Futures |
Key Concepts
- BFS = shortest path in unweighted graphs (think “ripple outward”), DFS = exploring all paths (think “go deep, then backtrack”). Know when to use which.
- Topological sort only works on DAGs (directed acyclic graphs) — it’s the go-to for dependency resolution problems.
- DP is just recursion + memoization. If we can write the brute-force recursive solution first, we can convert it to DP by caching subproblems.
- The GIL means Python threads don’t truly run in parallel for CPU-bound work — use
multiprocessingfor CPU tasks,threadingfor I/O tasks. - Context managers (
withstatement) handle cleanup automatically — no more forgetting to close files or release locks. asynciois single-threaded concurrency. It’s great for I/O-bound tasks like API calls, but won’t speed up CPU-heavy computation.
Practice
- Implement BFS and DFS on an adjacency list — print the traversal order for both
- Solve 1 topological sort problem (e.g., course schedule)
- Write a context manager using both the class approach (
__enter__/__exit__) and the@contextmanagerdecorator - Solve a basic DP problem (climbing stairs or fibonacci with memoization, then convert to tabulation)
~18 topics · ~2 hrs/day · Dual-track: DSA graphs + Python advanced