Decoded
PatternsComplexity

Patterns

Learn how to choose the right approach and understand what the problem is asking.

Core Array & Subarray Patterns

Sliding Window

Uses a moving window to work with contiguous parts of an array or string.

Explore Pattern

Two Pointers

Uses two indices to scan or compare elements in an array or string efficiently.

Explore Pattern

Prefix Sum

Pre-computes cumulative sums to find the sum of any subarray in constant time.

Explore Pattern

Hashing

Uses a hash map or set to store and retrieve values in average O(1) time.

Explore Pattern

Searching & Decision Making

Binary Search

Searches by repeatedly cutting the search space in half.

Explore Pattern

Greedy

Builds the solution step by step by always choosing the best option available at each moment.

Explore Pattern

Recursive & State Exploration

Backtracking

Explores all possible choices recursively and 'backtracks' when a choice leads to a dead end.

Explore Pattern

Dynamic Programming

Solves complex problems by breaking them down into smaller, overlapping subproblems and storing their results.

Explore Pattern

Hierarchical & Network Traversal

Trees (DFS/BFS)

Traverses tree structures either by going deep first (DFS) or level by level (BFS).

Explore Pattern

Graphs

Represents relationships between nodes and explores them using traversal techniques like DFS or BFS.

Explore Pattern

Priority-Based Patterns

Heap / Priority Queue

Maintains elements in a specific order, so the smallest or largest value can be accessed quickly.

Explore Pattern

✨ Built with curiosity, creativity & love — by Sreya Satheesh ❤️

© 2026 Decoded