Week 9 — HLD Foundations & Python OOP

intermediate hld python dsa

Goal: Start thinking at scale — system design foundations and Python OOP for the language round. This week flips your mindset from “how does this function work” to “how does this system work.”

Topics

DayFocusTopics
MonHLD IntroWhat Is System Design? · How to Approach System Design · Requirements Gathering
TueHLD EstimationBack-of-the-Envelope Estimation · Design Principles and Trade-offs
WedPython OOP BasicsClasses and Objects · Inheritance and MRO · @staticmethod vs @classmethod
ThuPython OOP AdvancedDunder Methods · Abstract Classes and Interfaces
FriDSA TreesTree Construction and Serialization · Lowest Common Ancestor

Key Concepts

  • The system design interview framework: requirements -> estimation -> high-level design -> deep dive
  • Back-of-envelope math — estimating QPS, storage, and bandwidth without a calculator
  • Python MRO (C3 linearization) — how Python decides which parent method to call
  • Dunder methods for operator overloading — making your objects behave like built-in types
  • @staticmethod vs @classmethod — when you need cls and when you don’t
  • Tree serialization patterns — preorder with null markers is the classic approach

Practice

  • Estimate QPS for a URL shortener (100M URLs/month, read-heavy, 100:1 read/write ratio)
  • Design a Python class hierarchy for a simple card game — use inheritance, dunder methods, and abstract classes
  • Implement tree serialization/deserialization using preorder traversal
  • Find the LCA of two nodes in a binary tree — both recursive and iterative

~12 topics · ~1.5-2 hrs/day · Focus: read the linked notes, then code each concept