Phase 1: Environment Setup (Rule Zero)
Disable Copilot, Cursor, and LSP auto-complete in your editor before starting. Work strictly inside a basic terminal (vim, nano, or VS Code with all extensions turned off).
AI Tier Rules Enforced Across All Days:
- Tier 0 (No AI / No Docs / Blank Editor): First attempt at all daily coding tasks and system design write-ups.
- Tier 1 (AI as Code Reviewer Only): Paste your working code into AI only after completion for architecture/performance feedback.
- Tier 2 (AI as Tutor): Ask AI to explain specific concepts (e.g., "Explain memory layout of
OrderedDictvsdictin CPython") — never ask it to generate code.
Phase 2: The 7-Day Plan (Async Task Engine Project)
Day 1: Python Data Model & Custom Structures
- Focus: Dunder methods, custom iterators, and memory.
- Tier 0 Daily Task (3 hrs): Build
PriorityTaskandTaskBufferfrom scratch. - Implement
__gt__,__eq__,__repr__, and__len__. - Make
TaskBufferan iterator and context manager (__iter__,__next__,__enter__,__exit__). - Fix the
chunked_streambug from your diagnostic: handle non-indexable iterables (e.g., generators/streams) usingitertools.islice. - System Design (20 min write-up, Tier 0): Caching Strategies. Write down the trade-offs between Cache-Aside, Write-Through, and Write-Behind. Compare LRU vs. LFU eviction.
- Recall Check: N/A (Day 1).
Day 2: Advanced Iterators, Generators & Pipeline Processing
- Focus: Generator pipelines, memory-efficient streams.
- Tier 0 Daily Task (3 hrs): Build a streaming file parser
log_event_stream(file_path)that reads massive log files, filters error events, and yields structuredTaskobjects using generator expressions. - System Design (20 min write-up, Tier 0): Message Queues. Compare RabbitMQ (AMQP/broker-based) vs. Kafka (distributed log-based). Explain how at-least-once delivery causes duplicate processing and how to make consumers idempotent.
- Recall Check (15 min, Tier 0): Re-implement
chunked_streamfrom memory without looking at Day 1's code.
Day 3: Decorators, Closures & Metadata
- Focus: Function wrapping, stateful decorators, metadata preservation.
- Tier 0 Daily Task (3 hrs): Write the
@retry_with_backoffdecorator from scratch. - Must accept
retries,initial_delay,backoff_factor, andallowed_exceptions. - Must preserve inner function signature using
functools.wraps. - Build a stateful
@rate_limit(max_calls, period)decorator. - System Design (20 min write-up, Tier 0): Rate Limiting Algorithms. Explain Token Bucket vs. Sliding Window Log. Calculate memory requirements for rate-limiting 1 million active users in Redis.
- Recall Check (15 min, Tier 0): Write a context manager
Timerusing__enter__and__exit__that measures block execution time.
Day 4: Asyncio & Non-Blocking I/O
- Focus:
asyncioevent loop, tasks, concurrency primitives. - Tier 0 Daily Task (3 hrs): Convert the task engine execution core to
asyncio. - Build
AsyncTaskRunnerusingasyncio.Queue. - Process tasks concurrently using worker loops (
asyncio.create_task). - Handle task failure gracefully with
asyncio.gather(..., return_exceptions=True). - System Design (20 min write-up, Tier 0): Databases & Indexing. Explain B-Tree vs. Hash indexes. Walk through what happens under the hood during a execution of a
SELECTquery with aWHEREon a non-indexed column versus an indexed column. - Recall Check (15 min, Tier 0): Write a stateful decorator that tracks total call count and execution time across function invocations.
Day 5: Multi-threading, Multiprocessing & Locking
- Focus: GIL bypass, thread safety, IPC (Inter-Process Communication).
- Tier 0 Daily Task (3 hrs): Build a CPU-bound worker pool for heavy task execution.
- Use
concurrent.futures.ProcessPoolExecutorfor heavy compute payloads. - Implement a thread-safe
ThreadSafeMetricstracker usingthreading.Lockto monitor completed/failed jobs across threads. - System Design (20 min write-up, Tier 0): Consistency & CAP Theorem. Walk through CP vs. AP systems. Explain dynamic split-brain scenarios and how quorum mechanisms ($R + W > N$) prevent stale reads.
- Recall Check (15 min, Tier 0): Write an
asyncproducer-consumer loop withasyncio.Queuefrom scratch in under 20 lines.
Day 6: Standard Library Deep Dive & Packaging
- Focus:
dataclasses,typing,pathlib,structlogsetup,pyproject.toml. - Tier 0 Daily Task (3 hrs): Package the task engine into a standard Python project.
- Write clean
dataclassstate schemas with strict type hints (Generic[T],Callable,Optional). - Add a CLI entry point using
argparseorsys.argvto launch workers. - Create a minimal, working
pyproject.tomlfile manually without scaffolding tools. - System Design (20 min write-up, Tier 0): Observability & Failure Modes. Define metrics vs. logs vs. traces. Explain how to prevent cascading failures using the Circuit Breaker pattern.
- Recall Check (15 min, Tier 0): Re-implement your thread-safe metrics collector using
threading.Lock.
Day 7: Testing & Memory Profiling
- Focus:
pytestfixtures, mocking async code,tracemalloc. - Tier 0 Daily Task (3 hrs): Write a full test suite for your Async Task Engine.
- Use
pytestandpytest-asynciowithout external assistance. - Write fixtures for the task queue and worker pools.
- Profile memory consumption of streaming tasks using Python's built-in
tracemallocmodule. - System Design (20 min write-up, Tier 0): Back-of-the-Envelope Calculation. Calculate required database storage, bandwidth, and cache RAM for a system processing 5,000 write queries per second with 1 KB payload sizes retained for 30 days.
- Recall Check (15 min, Tier 0): Write
@retry_with_backofffrom scratch in under 10 minutes.
Phase 3: Weekly Verification Checkpoint
At the end of Day 7, take this timed 2-Hour Final Benchmark in a plain text file without documentation:
Task | Pass Criteria |
1. Async Engine | Write an async batch producer/consumer queue that processes 1,000 items with max concurrency of 10 in < 30 lines. |
2. Decorator | Write a parameterized decorator with exception catching and exponential delay from memory in < 15 lines. |
3. System Design | Diagram and describe a distributed rate-limiting architecture handling 50k RPS on a whiteboard/paper in 15 minutes. |
Phase 4: Long-Term Habits (Post-Plan)
- The 15-Minute Rule: When stuck on a bug or syntax issue, force yourself to debug manually using
pdb/breakpoint()or print statements for 15 minutes before reaching for AI or search. - Drafting Tier 0 First: Write core logic, complex data structures, and function signatures manually. Use AI only to generate boilerplate, write tests for existing code, or generate documentation.
- Weekly Unassisted Kata: Spend 30 minutes every Friday solving a medium algorithmic/data-structure problem in a plain terminal editor with Copilot disabled.