Week 7 — Python Foundations & Indexing

beginner python dbms dsa

Goal: Blow through Python fundamentals quickly (it’s revision, not new ground) and spend the real energy on DBMS indexing — that’s the meaty part this week.

Topics

DayFocusTopics
MonPython BasicsVariables and Data Types · Mutable vs Immutable · Strings and String Methods
TuePython CollectionsLists, Tuples, and Sets · Dictionaries · Comprehensions
WedPython Odds & Ends + Indexing IntroType Conversion and Truthiness · How Indexes Work · B-Tree and B+ Tree
ThuIndexing Deep DiveTypes of Indexes · EXPLAIN and Query Plans · Query Optimization
FriDSA DesignData Structure Design Problems

Key Concepts

  • Mutable vs immutable tradeoffs — why tuples exist alongside lists, and when to reach for each
  • List comprehension patterns — filtering, mapping, and nested comprehensions in one line
  • B-tree vs B+ tree structure — leaf-level linking and why B+ trees dominate in databases
  • Reading EXPLAIN output — spotting sequential scans, understanding cost estimates
  • Index selection strategies — covering indexes, composite indexes, and when NOT to index

Practice

  • Solve 3 problems using list comprehensions (flatten a 2D list, filter + transform, nested grouping)
  • Run EXPLAIN on 3 queries in PostgreSQL and identify missing indexes — add them and compare plans
  • Design a data structure that supports insert, delete, and getRandom in O(1)

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