Skip to content

nirajkvinit/StructWeave-Algorithms

Repository files navigation

StructWeave

Weaving robust data structures with elegant algorithms — one carefully crafted solution at a time.

StructWeave

StructWeave is an algorithm course and coding interview preparation resource featuring data structures and algorithms practice problems. Designed for steady, deliberate improvement, the focus is on solutions that are correct, readable, and educational — the kind that actually stick.

The repository emphasizes understanding over memorization. Master DSA practice through pattern recognition — learn 17 patterns that solve 90% of interview problems. This is a space for building quiet competence rather than flashy brilliance.


Features — Algorithm Practice Problems

  • Collection of Practice Problems — Organized by difficulty (20 foundation, 270 easy, 575 medium, 117 hard)
  • Foundation Tier — 20 computational thinking problems for building mathematical intuition (Choose to repeat - Math is not hard!)
  • 17 Pattern Guides — Master the core patterns that solve 90% of interview problems
  • Multiple Solution Approaches — From brute force to optimal, with complexity analysis
  • 3-Tier Hint System — Nudge → Direction → Skeleton (learn without spoilers)
  • Spaced Repetition Support — Built-in review schedules and practice checklists
  • Beginner-Friendly Prerequisites — Big-O notation, debugging strategies, computational thinking
  • 5 Detailed Walkthroughs — Step-by-step problem solving demonstrations
  • Self-Assessment System — Entry assessment + 4 phase assessments to track progress
  • No Platform Lock-in — Pure markdown, works anywhere, forever

What You'll Learn

  • Algorithm patterns that solve 90% of coding interview problems
  • Data structure fundamentals — arrays, trees, graphs, heaps, and more
  • Problem-solving strategies for technical interviews
  • Complexity analysis — Big-O notation, time/space tradeoffs
  • Deliberate practice techniques backed by cognitive science research

Quick Start

Find Your Starting Point

Complete beginner?     → Start with prerequisites/
New to algorithms?     → Try problems/foundation/ for computational thinking
Know basics?           → Take assessments/entry-assessment.md
Interview prep?        → Follow tracks/roadmap.md
Just refreshing?       → Jump to strategies/patterns/

5-Minute First Problem

  1. Read Two Pointers Pattern (3 min)
  2. Open E006 Container With Most Water
  3. Try solving it — use the collapsible hints if stuck
  4. Check the complexity analysis table when done

Recommended First Problems

Problem Pattern Why Start Here
F001 Multiples of 3 or 5 Math Modulo, loops, inclusion-exclusion
E001 Two Sum Hash Map Classic, teaches complement search
E014 Valid Parentheses Stack Fundamental data structure
M002 Longest Substring Sliding Window Core interview pattern

The 17 Patterns

These patterns solve the vast majority of algorithm problems:

Pattern When to Use Guide
Two Pointers Sorted arrays, pair finding two-pointers.md
Sliding Window Contiguous subarrays/substrings sliding-window.md
Binary Search Sorted data, monotonic functions binary-search.md
Prefix Sum Range sum queries prefix-sum.md
Monotonic Stack Next greater/smaller element monotonic-stack.md
Cyclic Sort Numbers 1-n, missing/duplicate cyclic-sort.md
Merge Intervals Overlapping ranges merge-intervals.md
Two Heaps Median, balanced partitions two-heaps.md
K-way Merge Merge K sorted sequences k-way-merge.md
Top K Elements Kth largest/smallest heaps.md
Graph BFS/DFS Traversal, shortest path graph-traversal.md
Topological Sort Dependencies, ordering topological-sort.md
Backtracking All combinations/permutations backtracking.md
Dynamic Programming Optimal substructure dynamic-programming.md
Greedy Local optimal → global optimal greedy.md
Divide & Conquer Split, solve, combine divide-and-conquer.md
Bitwise XOR Find unique elements bitwise-xor.md

See the Pattern Decision Guide for a flowchart on choosing the right pattern.


Learning Paths — Interview Preparation Tracks

Competency Roadmap

Track Duration For Who Start Here
Beginner 10-12 weeks Complete beginners, bootcamp grads Prerequisites
Foundation 2-3 weeks Build computational thinking first Foundation Problems
Interview Prep 8-10 weeks Experienced devs preparing for interviews Entry Assessment
Refresher 4 weeks Rusty engineers getting back in shape Pattern Guides
Maintenance 3-5 hrs/week Staying sharp long-term Mixed Practice

See tracks/roadmap.md for the complete 4-phase learning path.


Philosophy — Learn Algorithms Effectively

The Three Pillars

  1. First Principles Thinking Understand why patterns work, not just how. Every pattern guide explains the fundamental constraint it addresses.

  2. Pattern-First Learning Pattern recognition beats problem memorization. Learn 17 patterns well, and you can solve hundreds of problems.

  3. Science-Backed Practice Spaced repetition, active recall, deliberate practice. Each problem includes review checklists based on cognitive research.

Guiding Principles

  • Clarity over cleverness — One-liners that no one understands help no one
  • Understanding over speed — Quiet competence beats flashy tricks
  • "Good enough" first — Correct and readable before optimized
  • Progress over perfection — Steady improvement, one problem at a time

Why Regular DSA Practice Works

"Be so good they can't ignore you." — Steve Martin

Stacked Learning

It's Not Talent. It's Practice

Research consistently shows that deliberate practice, not innate talent, separates world-class performers from everyone else. What looks like natural ability is usually the result of years of focused, intentional effort.

Book Core Insight
Peak (Ericsson & Pool) Deliberate practice builds mental representations that enable expertise
Talent Is Overrated (Colvin) Excellence comes from continually identifying and improving weak points
Grit (Duckworth) Passion + perseverance beats talent every time
So Good They Can't Ignore You (Newport) Career capital comes from stretching beyond your current abilities

What Deliberate Practice Actually Means

It's not mindless repetition. It's structured, uncomfortable growth:

  1. Work at the edge of ability — Comfort zone → Learning zone → Panic zone. Growth happens in the learning zone.
  2. Get immediate feedback — Know whether your approach works before moving on
  3. Focus on weaknesses — Not just what you're already good at
  4. Repeat with intention — Each attempt should be a conscious effort to improve

"If you're not uncomfortable, you're probably stuck at an 'acceptable level.'" — Cal Newport

Why Regular Practice Matters

Your brain physically changes through practice. Neuroscience research shows mathematical practice increases grey matter density in regions critical for reasoning. This isn't metaphor—it's measurable brain architecture.

30 minutes daily beats 4 hours weekly. Consistency builds neural pathways. Sporadic cramming doesn't.

The Four Pillars of Grit

Angela Duckworth's research identifies what sustains long-term practice:

  • Interest — You can't persevere at something you don't care about
  • Practice — Deliberate, focused improvement (not just showing up)
  • Purpose — Connecting your work to something larger than yourself
  • Hope — Believing you can improve, even when progress feels slow

Start Where You Are

The problems you struggle with are the most valuable. Don't skip them—schedule them for more reviews. Like kintsugi (金継ぎ), where broken pottery is repaired with gold, your struggles become your strength.

See the Practice Guide for structured approaches to deliberate practice.


Contributing

Contributions are welcome! See CONTRIBUTING.md for guidelines.

Ways to help:

  • Improve problem explanations for clarity
  • Add alternative solution approaches
  • Fix typos and broken links
  • Find logical errors in problems description
  • Enhance pattern guides with examples
  • Add practice drills

Important: All content must be original or properly paraphrased. No direct copying from any platform.


License

MIT License — Use freely.


Acknowledgments

This repository synthesizes wisdom from:

  • Classic algorithm textbooks (CLRS, Skiena)
  • Research on deliberate practice and spaced repetition
  • The open-source algorithm education community
  • Algorithmic problems and discussions found across the internet

This is a free, open-source educational resource. The problems here are inspired by common algorithmic challenges discussed in textbooks, forums, and online communities over decades. The intent is purely educational — to provide a structured framework for learning, nothing more.

If you find this useful, pay it forward. Teach someone else.


StructWeave — Interlacing data structures with algorithmic insight.
Practice problems · Clean implementations · Progressive difficulty
One carefully woven solution at a time.

About

Data Structure & Algorithm Practice Problems for coding interviews

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published