Decoded
Patterns

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 efficiently.

Explore Pattern

Prefix Sum

Stores running sums so subarray sums can be found quickly.

Explore Pattern

Hashing

Uses a hash map or set to store and look up values quickly.

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.

Explore Pattern

Recursive & State Exploration

Backtracking

Explores possible choices and goes back when a path does not work.

Explore Pattern

Dynamic Programming

Solves problems by reusing results from smaller subproblems.

Explore Pattern

Hierarchical & Network Traversal

Trees (DFS/BFS)

Traverses tree nodes either depth first or level by level.

Explore Pattern

Graphs

Explores connections between nodes in a network.

Explore Pattern

Priority-Based Patterns

Heap / Priority Queue

Keeps track of the smallest or largest element efficiently.

Explore Pattern

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

© 2026 Decoded