Week 2 — Python Basics & DSA Arrays

beginner python dsa

Goal: “Every expert was once a beginner.” — We’re picking up Python for real this week. Meanwhile, DSA shifts into hash maps and sorting — the bread and butter of coding interviews.

Topics

DayTrackFocusTopics
MonA — DSAHash Maps & Prefix SumsHash Maps and Sets · Prefix Sum and Difference Arrays · Matrix Problems
TueB — PythonData Types & BasicsVariables and Data Types · Mutable vs Immutable · Strings and String Methods
WedA — DSASorting & Linear StructuresSorting Algorithms · Linked Lists · Stacks · Monotonic Stack
ThuB — PythonCollections & ComprehensionsLists, Tuples, and Sets · Dictionaries · Comprehensions · Type Conversion and Truthiness
FriB — PythonFunctionsFunctions and Arguments · Lambda Functions · map, filter, reduce, zip

Key Concepts

  • Python mutability is crucial — lists are mutable, tuples and strings are not. This trips people up in interviews when they try to modify a string in-place.
  • Hash maps are the backbone of 30%+ of interview problems. If we see “find a pair,” “count occurrences,” or “group by,” our first instinct should be reaching for a hash map.
  • Prefix sums turn O(n) range queries into O(1) — a simple idea with huge payoff.
  • Sorting algorithms — we don’t need to memorize all of them, but we should know merge sort (stable, O(n log n) guaranteed) and quick sort (average O(n log n), in-place).
  • Monotonic stacks are a niche but powerful pattern for “next greater element” style problems.

Practice

  • Solve 2 hash map problems (e.g., two sum, group anagrams)
  • Implement merge sort from scratch in Python — this doubles as Python practice
  • Write Python list comprehensions for 3 different transformations (filter + map, flatten 2D list, dict comprehension)
  • Solve 1 monotonic stack problem (e.g., next greater element)

~17 topics · ~2 hrs/day · Dual-track: DSA arrays + Python fundamentals