Coding Interviews were HARD, until I learned these Patterns
coding-interviewsalgorithmsdata-structuresleetcode
Abstraction: 15 essential algorithmic patterns for solving coding interview problems
Key points:
- 15 core patterns cover the vast majority of LeetCode/FAANG interview problems: Two Pointers, Prefix Sum, Sliding Window, Fast & Slow Pointers (Floyd's cycle detection), In-place Linked List Reversal, Monotonic Stack, Top K Elements (heaps), Overlapping Intervals, Modified Binary Search, Tree Traversals, DFS, BFS, Matrix Traversal, Backtracking, and Dynamic Programming
- Two Pointers: avoids nested loops for pair/sum problems on sorted arrays or linked lists
- Sliding Window: maintains a variable-size contiguous subarray window for substring/subarray problems
- Fast & Slow Pointers (tortoise & hare): detects cycles in linked lists and finds middle elements
- Dynamic Programming: breaks problems into optimal subproblems; covers classics like Climbing Stairs (70) and Longest Increasing Subsequence (300)
- Recommended resources: Grokking the Coding Interview (DesignGurus), Algomonster, Educative-99 (99 curated problems vs. 2800 LeetCode)
Connections: Leetcode · Algorithms · Data Structures · Interview Preparation
Source: https://dev.to/somadevtoo/coding-interviews-was-hard-until-i-learned-these-patterns-2ji7