Welcome to DSAlgoPatterns, a structured, heuristical collection of Data Structures and Algorithms (DSA) problems.
This repository has evolved from a simple collection of problems into a tier-based, pedagogical learning system. We don't just show you "what to code"; we teach you "how to think".
We believe that grinding hundreds of random LeetCode problems is inefficient. To truly master DSA, you need to understand the underlying heuristics (the "why") and see the evolution of a solution from Brute Force to optimal.
Every major pattern directory (e.g., Sliding Window, Two Pointers, 1-D DP) now contains a comprehensive pedagogical README.md that explicitly teaches:
- What is it? (The high-level theory).
- How to Identify it? (The specific clues in a problem description).
- What is the Core Optimization? (Why it beats brute force).
- Progression Guide (How to naturally scale your understanding).
Every single problem folder has been structurally moved into one of three distinct progression tiers to prevent beginners from tackling hard constraints too early:
_must_do/(Core Mechanics): The gateway problems. These teach the absolute bare minimum mechanics of the pattern (e.g., pureTwo SumorDaily Temperatures)._practice/(Variations): Moderate problems that take the core mechanic and twist it slightly, requiring you to adapt._advanced/(Hard Constraints): The final bosses. These often combine two different patterns (e.g., Sliding Window + Two Heaps) or apply severe mathematical constraints.
For select foundational problems, you will find a brute_force.md alongside the standard optimal codes (solution.cpp, solution.py). This forces you to understand the
The recommended sequence for traversing this masterclass:
- Review the Heuristics: Read the
PATTERN_CATALOG.mdmatrix. Memorize the signals that point to specific patterns. - Follow the Roadmap: Check
LEARNING_PATH.mdto see the recommended order of patterns (Tiers 1 through 4). - Dive into a Pattern:
- Open a pattern folder (e.g.,
Arrays & Hashing). - Read its local
README.md. - Solve all
_must_doproblems first. - Advance to
_practice, then eventually_advanced.
- Open a pattern folder (e.g.,
- Mock Interviews: Once confident, use the materials in
interview_prep/to simulate 45-minute timed sessions based on top company frequencies (Google, Meta, etc.).
This repository serves as the underlying data engine for CodeDynamics. If you prefer an interactive experience, boot up the CodeDynamics frontend (npm run dev) to visually explore the Problem Decision Tree, the Tiered Roadmap, and track your progress in real-time via LocalStorage.
Happy Coding! Let's crack DSA, one pattern at a time! 🚀