In the last 15 years, I have interviewed 800+ Software Engineers across Google, Paytm, Amazon & various startups. Here are the most actionable tips I can give you on how to approach solving coding problems in Interviews (My DMs are always flooded with this particular question) 1. Use a Heap for K Elements - When finding the top K largest or smallest elements, heaps are your best tool. - They efficiently handle priority-based problems with O(log K) operations. - Example: Find the 3 largest numbers in an array. 2. Binary Search or Two Pointers for Sorted Inputs - Sorted arrays often point to Binary Search or Two Pointer techniques. - These methods drastically reduce time complexity to O(log n) or O(n). - Example: Find two numbers in a sorted array that add up to a target. 3. Backtracking - Use Backtracking to explore all combinations or permutations. - They’re great for generating subsets or solving puzzles. - Example: Generate all possible subsets of a given set. 4. BFS or DFS for Trees and Graphs - Trees and graphs are often solved using BFS for shortest paths or DFS for traversals. - BFS is best for level-order traversal, while DFS is useful for exploring paths. - Example: Find the shortest path in a graph. 5. Convert Recursion to Iteration with a Stack - Recursive algorithms can be converted to iterative ones using a stack. - This approach provides more control over memory and avoids stack overflow. - Example: Iterative in-order traversal of a binary tree. 6. Optimize Arrays with HashMaps or Sorting - Replace nested loops with HashMaps for O(n) solutions or sorting for O(n log n). - HashMaps are perfect for lookups, while sorting simplifies comparisons. - Example: Find duplicates in an array. 7. Use Dynamic Programming for Optimization Problems - DP breaks problems into smaller overlapping sub-problems for optimization. - It's often used for maximization, minimization, or counting paths. - Example: Solve the 0/1 knapsack problem. 8. HashMap or Trie for Common Substrings - Use HashMaps or Tries for substring searches and prefix matching. - They efficiently handle string patterns and reduce redundant checks. - Example: Find the longest common prefix among multiple strings. 9. Trie for String Search and Manipulation - Tries store strings in a tree-like structure, enabling fast lookups. - They’re ideal for autocomplete or spell-check features. - Example: Implement an autocomplete system. 10. Fast and Slow Pointers for Linked Lists - Use two pointers moving at different speeds to detect cycles or find midpoints. - This approach avoids extra memory usage and works in O(n) time. - Example: Detect if a linked list has a loop. 💡 Save this for your next interview prep!
Problem Solving with Algorithms and Complexity Analysis
Explore top LinkedIn content from expert professionals.
-
-
There are over 3500+ questions on Leetcode and many people are not able to see how DSA patterns keep overlapping even after solving 200-300+ problems. With this pattern recognition cheatsheet you will be able to solve more than 80% of the problems: Think of it as: 1. Identify input type 2. Ask 2 to 3 questions 3. Land on a small set of likely approaches ● Arrays / Strings - Ask first: is it sorted or can I sort it cheaply. - Sorted → Binary Search, Two Pointers, Prefix Sums. - Not sorted → look at intent of the question. ➸ Optimization (max, min, count ways, min cost) - Choices depend on previous choices → Dynamic Programming. - Choices mostly independent with a clear local rule → Greedy, but be ready to justify. ➸Feasibility or existence questions - “Can we do this”, “Is there a solution” → Backtracking, DFS with pruning, or Binary Search on the answer. ➸ String heavy problems - Prefix or suffix logic → Trie, prefix function, rolling hash. - Complex edits, parentheses, next greater element → Stack or Monotonic Stack, sometimes Deque. ➸ Frequent lookups, duplicates, uniqueness - Use Hash Map, Hash Set, or counting array. ➸ Window that grows and shrinks - “Longest subarray”, “smallest substring that” → Sliding Window with Two Pointers, Deque, or a counting map. ➸ Frequent min or max with updates - Use Heap or Monotonic Queue. - Many range queries on big arrays → Segment Tree or Fenwick Tree. ● Graphs - First clarify: directed or undirected, weighted or unweighted, how input is given. ➸ Pathfinding and traversals - Shortest path or fewest steps, unweighted → BFS. - Weighted positive edges → Dijkstra. - Explore all nodes, count components, basic connectivity → DFS, BFS, or Union Find. ➸ Order and dependencies - Course schedule, build order, prerequisites → Topological sort with DFS or Kahn algorithm. - Cycle detection directed → DFS with visited and recursion stack. - Cycle detection undirected → DFS or Union Find. ➸ Global optimisation on graph - Connect all nodes with minimum cost → Minimum Spanning Tree, Kruskal or Prim. - Critical links, bridges, articulation points → Tarjan style algorithms. ● Trees (often binary trees) ➸ Traversals and depths - Level wise questions, distance from root, LCA via parent depth → BFS or DFS with depth. - Combine results from children, like height, path sum, balanced or not → Postorder DFS. ➸ Ordering or special properties - Binary Search Tree hints → Use BST property, inorder, or binary search style traversal. - Many range queries or updates on an array or tree like structure → Segment Tree or Fenwick Tree. ● Linked Lists ➸ Cycle detection - Use fast and slow pointers. ➸ Reversals and structural edits - Reverse list or sublist → Track prev, curr, next. - Insert or delete near head → Use a dummy node to simplify edge cases. ➸ Position based tasks - Find middle, kth from end, intersection → Fast and slow pointers, or length difference trick.
-
7-Step Framework to Answer 90% of Coding Problems (Based on My Experience at Walmart, Samsung, & Microsoft) 1. Clarify the Problem - Understand the input and output requirements. - Ask about edge cases and constraints (e.g., data size, negative values). - Confirm expected time and space complexity. 2. Break It Down - Identify the core problem type (e.g., sorting, searching, graph traversal). - Divide the problem into smaller, manageable subproblems. - Discuss a brute-force approach first, then optimize step by step. 3. Choose the Right Data Structure - Arrays or Lists for sequential data. - HashMaps for fast lookups. - Stacks/Queues for order-sensitive operations. - Trees/Graphs for hierarchical or connected data. 4. Plan the Algorithm - Write down the pseudocode or flow in plain language. - Choose between iterative or recursive solutions based on the problem. - Think about sorting, traversals (DFS/BFS), or divide-and-conquer strategies. 5. Write the Code - Start with a clean and simple implementation. - Focus on edge cases (e.g., empty arrays, single elements, negative numbers). - Add comments to explain your logic as you write. 6. Test and Debug - Use sample inputs to validate your solution. - Cover edge cases, stress-test with large inputs, and compare outputs. - Optimize if it doesn’t meet the constraints (e.g., reduce nested loops). 7. Optimize and Explain - Discuss improvements: - Can time complexity be reduced (e.g., O(n^2) → O(n log n))? - Can space usage be minimized (e.g., avoid extra arrays)? - Clearly explain your solution and why it works for all cases. Practice this framework consistently with a variety of problems. The more you apply it, the easier it becomes to adapt it for any interview challenge. Consistency + Structured Thinking = Success in Coding Interviews. 🚀 Note: This approach works well for most problems but may not be ideal for every type of problem, so feel free to adapt it according to the specific nuances of the interview question.
-
Time Complexity Cheatsheet for Every Engineer When you write an algorithm, its speed and efficiency depend on how well you understand time and space complexity. That’s why mastering Big O notation is a crucial skill for every developer, especially when optimizing performance and preparing for technical interviews. Here’s a quick breakdown 👇 - Time Complexity tells you how your algorithm’s runtime grows as the input size increases. - Space Complexity measures how much additional memory is required during execution. This cheatsheet summarizes the most common algorithms and their complexities, from searching and sorting to graph traversal and dynamic programming. 🔹 Searching Algorithms • Linear Search: O(n) — Simple, but slow for large datasets. • Binary Search: O(log n) — Fast but requires sorted data. 🔹 Sorting Algorithms • Bubble / Selection / Insertion Sort: O(n²) — Easy to understand but inefficient. • Merge / Quick / Heap Sort: O(n log n) — Efficient, scalable sorting approaches. • Counting / Radix / Bucket Sort: O(n + k) — Great for limited integer or uniform data. 🔹 Data Structures • Hash Tables: O(1) average for search, insert, delete — collisions can degrade to O(n). • Binary Search Trees (BST): O(log n) on average, O(n) if unbalanced. • Balanced BST (AVL/Red-Black): Guarantees O(log n) operations. • Stack / Queue: Constant time for push, pop, enqueue, dequeue. 🔹 Graph & DP Algorithms • Graph Traversal (BFS/DFS): O(V + E) — V = vertices, E = edges. • Dijkstra’s Algorithm: O(V²) or O(E + V log V) — optimized with priority queues. • Dynamic Programming: O(n²) to O(2ⁿ) — depends on problem type and overlap. Pro Tip: Don’t just memorize complexities - understand the trade-offs. Each algorithm shines in specific scenarios: • Small datasets? Use simpler sorts. • Large systems? Focus on O(log n) or O(n log n). • Real-time systems? Optimize for space and constant-time operations. Mastering these fundamentals will not only make you a better coder — it will make you a better problem solver. Follow Gaurav Mehta for more tech insights and updates.
-
I solved 700+ Leetcode problems during college while preparing for placements. In the last 5 years, I’ve taught DSA to 2000+ students, and the biggest lesson? You don’t need to solve hundreds of problems. You just need to master these 8 patterns that cover 80% of all Leetcode problems. Here’s your roadmap 👇 1. Sliding Window = When you need to find subarrays or substrings in a linear DS (like arrays or strings) that meet a certain condition _ Used in problems like: longest subarray, max sum of k-length window, etc. 2. Two Pointers = For sorted arrays/strings where you move 2 pointers to meet a condition _ Used in: pair sums, palindrome checks, merging sorted arrays 3. Modified Binary Search = Classic binary search but adapted for rotated arrays, infinite search space, or conditions beyond equality _ Used in: search in rotated array, peak element, kth element in sorted matrix 4. Subset/Backtracking = When you need to generate all combinations or permutations _ Used in: subsets, combinations, permutations, N-Queens 5. Top-K Elements = When you need to find the k smallest/largest items efficiently _ Always think heaps/priority queues here 6. DFS/BFS on Trees = To explore all nodes in a tree—depth-first (recursion) or level-by-level (queues) _ Used in: max depth, level order traversal, path sums 7. Topological Sort = Used in Directed Acyclic Graphs when there's dependency (prerequisite) between nodes _ Common in: course scheduling, task ordering 8. Dynamic Programming = The final boss. For overlapping subproblems with optimal substructure _ Used in: knapsack, DP on strings, grid paths, longest subsequences Save this post. Don’t chase problem counts. Master patterns → practice problems within each → build real intuition. Here is my DSA Sheet, go and start learning: https://lnkd.in/ggZVrwfs
-
During my Meta DSA rounds, I used arrays. During my Google DSA rounds, I used arrays. During my Amazon DSA rounds, I used arrays. At each company I interviewed, especially in the DSA rounds, I've used two pointers a lot. When you get used to it, you unlock solutions to dozens of common problems. Here's everything you need to know about two pointers: ↳ What It Is: Two pointers is a technique where you maintain two references to positions in a data structure, usually an array or string. You move these pointers based on specific conditions to solve the problem efficiently. It transforms O(n²) brute force solutions into O(n) linear time. ↳ When To Use It – You're working with sorted arrays or strings. – The problem asks about pairs, triplets, or subarrays. – You need to find elements that meet certain conditions. – You're dealing with palindromes or string reversal. – You need to remove duplicates or partition data. ↳ Core Patterns 1. Opposite Ends (Converging) Start one pointer at the beginning, one at the end. Move them toward each other based on conditions. Perfect for: Two Sum (sorted), container with most water, valid palindrome. Example: Finding pairs that sum to a target in a sorted array. 2. Same Direction (Fast and Slow) Both pointers start at the same position. One moves faster than the other. Perfect for: Removing duplicates, detecting cycles, finding middle element. Example: Remove duplicates from sorted array in place. 3. Sliding Window One pointer marks the window start, the other marks the end. Expand or contract the window based on conditions. Perfect for: Longest substring problems, maximum sum subarrays, minimum window. Example: Longest substring without repeating characters. 4. Partition (Dutch National Flag) Use multiple pointers to partition data into sections. Common in sorting and array rearrangement problems. Perfect for: Sort colors, move zeros, partition arrays. Example: Move all zeros to the end while maintaining order. ↳ Practice Problems (Easiest to Hardest) Beginner: - Valid Palindrome - Remove Duplicates from Sorted Array - Move Zeroes - Reverse String Intermediate: - Two Sum II (sorted array) - Container With Most Water - 3Sum - Sort Colors Advanced: - Trapping Rain Water - Minimum Window Substring - Longest Substring Without Repeating Characters - Subarray Product Less Than K
-
🐍 𝟏𝟐𝟖 𝐀𝐥𝐠𝐨𝐫𝐢𝐭𝐡𝐦𝐬. 𝐎𝐧𝐞 𝐁𝐨𝐨𝐤. 𝐄𝐧𝐝𝐥𝐞𝐬𝐬 𝐋𝐞𝐚𝐫𝐧𝐢𝐧𝐠. I've been exploring Competitive Programming in Python by Christoph Dürr and Jill-Jênn Vie, and it's one of the most practical resources I've come across for improving problem-solving and algorithmic thinking. Whether you're preparing for coding interviews, participating in programming contests, or simply aiming to write more efficient code, this book offers tremendous value. 💡 What makes it stand out? ✅ 128 algorithms organized by topic — Graphs, Trees, Strings, Dynamic Programming, Geometry, and more ✅ Clean Python implementations that are easy to understand and apply ✅ Real-world applications connecting algorithms to practical challenges ✅ A structured learning approach covering: Definition → Complexity → Applications → Implementation → Variants ✅ Coverage of both foundational and advanced concepts, including: • Dijkstra's Algorithm • Knuth-Morris-Pratt (KMP) • Bellman-Ford • Fenwick Trees • Gale-Shapley Algorithm • Network Flow Algorithms One takeaway that really resonated with me: "Designing the right algorithm is only half the challenge. Implementing it efficiently is the other half." That mindset shift can make a huge difference when solving problems under time pressure. 🎯 Currently exploring: • Graph Algorithms • Shortest Path Problems • Knuth-Morris-Pratt (KMP) If you're serious about strengthening your coding and problem-solving skills, this book is definitely worth checking out. What's your favorite algorithm or data structure? Share it below 👇 #Python #CompetitiveProgramming #Algorithms #DataStructures #CodingInterview #SoftwareEngineering #Programming #TechCareer #Learning #ProblemSolving
-
𝗗𝗦𝗔 𝗣𝗮𝘁𝘁𝗲𝗿𝗻𝘀 𝘁𝗼 𝗖𝗿𝗮𝗰𝗸 𝟵𝟬% 𝗼𝗳 𝗜𝗻𝘁𝗲𝗿𝘃𝗶𝗲𝘄 𝗤𝘂𝗲𝘀𝘁𝗶𝗼𝗻𝘀 Most interview problems are not new problems. They’re the same patterns in disguise. Master the following patterns and you will stop memorizing solutions and start recognizing problems: ✅ 𝗦𝗹𝗶𝗱𝗶𝗻𝗴 𝗪𝗶𝗻𝗱𝗼𝘄 When the problem asks for longest / shortest / subarray / substring → Think dynamic window + constraints Examples: 𝘓𝘰𝘯𝘨𝘦𝘴𝘵 𝘴𝘶𝘣𝘴𝘵𝘳𝘪𝘯𝘨, 𝘢𝘯𝘢𝘨𝘳𝘢𝘮𝘴, 𝘸𝘪𝘯𝘥𝘰𝘸 𝘮𝘢𝘹 ✅ 𝗧𝘄𝗼 𝗣𝗼𝗶𝗻𝘁𝗲𝗿𝘀 / 𝗙𝗮𝘀𝘁–𝗦𝗹𝗼𝘄 When you see sorted arrays, palindromes, cycles → Move pointers smartly instead of nested loops Examples: 3𝘚𝘶𝘮, 𝘭𝘪𝘯𝘬𝘦𝘥 𝘭𝘪𝘴𝘵 𝘤𝘺𝘤𝘭𝘦, 𝘥𝘶𝘱𝘭𝘪𝘤𝘢𝘵𝘦 𝘯𝘶𝘮𝘣𝘦𝘳 ✅ 𝗣𝗿𝗲𝗳𝗶𝘅 𝗦𝘂𝗺 When you see range queries or subarray sums → Precompute once, query in O(1) Examples: 𝘚𝘶𝘣𝘢𝘳𝘳𝘢𝘺 𝘴𝘶𝘮 = 𝘒, 𝘱𝘪𝘷𝘰𝘵 𝘪𝘯𝘥𝘦𝘹 ✅ 𝗠𝗼𝗻𝗼𝘁𝗼𝗻𝗶𝗰 𝗦𝘁𝗮𝗰𝗸 / 𝗤𝘂𝗲𝘂𝗲 When you see next greater/smaller or window max → Maintain increasing/decreasing order Examples: 𝘋𝘢𝘪𝘭𝘺 𝘵𝘦𝘮𝘱𝘦𝘳𝘢𝘵𝘶𝘳𝘦𝘴, 𝘩𝘪𝘴𝘵𝘰𝘨𝘳𝘢𝘮 𝘢𝘳𝘦𝘢 ✅ 𝗛𝗮𝘀𝗵𝗶𝗻𝗴 (𝗙𝗿𝗲𝗾𝘂𝗲𝗻𝗰𝘆 𝗠𝗮𝗽 / 𝗦𝗲𝘁) When you need counts, uniqueness, fast lookup → HashMap > brute force Examples: Two Sum, group anagrams, top K elements ✅ 𝗕𝗶𝗻𝗮𝗿𝘆 𝗦𝗲𝗮𝗿𝗰𝗵 Not just on arrays — but on answers → “Find minimum / maximum / boundary” Examples: 𝘙𝘰𝘵𝘢𝘵𝘦𝘥 𝘢𝘳𝘳𝘢𝘺𝘴, 𝘒𝘰𝘬𝘰 𝘦𝘢𝘵𝘪𝘯𝘨 𝘣𝘢𝘯𝘢𝘯𝘢𝘴 ✅ 𝗛𝗲𝗮𝗽 (𝗣𝗿𝗶𝗼𝗿𝗶𝘁𝘆 𝗤𝘂𝗲𝘂𝗲) When you need top K or streaming data → Always keep extremes accessible Examples: 𝘒𝘵𝘩 𝘭𝘢𝘳𝘨𝘦𝘴𝘵, 𝘮𝘦𝘥𝘪𝘢𝘯 𝘧𝘳𝘰𝘮 𝘴𝘵𝘳𝘦𝘢𝘮 ✅ 𝗗𝗙𝗦 / 𝗕𝗙𝗦 When the problem involves trees, graphs, grids → DFS = explore paths, BFS = shortest distance Examples: 𝘐𝘴𝘭𝘢𝘯𝘥𝘴, 𝘸𝘰𝘳𝘥 𝘭𝘢𝘥𝘥𝘦𝘳, 𝘵𝘳𝘦𝘦 𝘵𝘳𝘢𝘷𝘦𝘳𝘴𝘢𝘭𝘴 ✅ 𝗜𝗻𝘁𝗲𝗿𝘃𝗮𝗹𝘀 When you see meetings, time ranges, overlaps → Sort + merge Examples: 𝘔𝘦𝘳𝘨𝘦 𝘪𝘯𝘵𝘦𝘳𝘷𝘢𝘭𝘴, 𝘮𝘦𝘦𝘵𝘪𝘯𝘨 𝘳𝘰𝘰𝘮𝘴 ✅ 𝗕𝗮𝗰𝗸𝘁𝗿𝗮𝗰𝗸𝗶𝗻𝗴 When you need all possible combinations → Choose → explore → undo Examples: 𝘚𝘶𝘣𝘴𝘦𝘵𝘴, 𝘱𝘦𝘳𝘮𝘶𝘵𝘢𝘵𝘪𝘰𝘯𝘴, 𝘕-𝘘𝘶𝘦𝘦𝘯𝘴 ✅ 𝗗𝘆𝗻𝗮𝗺𝗶𝗰 𝗣𝗿𝗼𝗴𝗿𝗮𝗺𝗺𝗶𝗻𝗴 (𝗠𝗲𝗺𝗼𝗶𝘀𝗮𝘁𝗶𝗼𝗻 + 𝗧𝗮𝗯𝘂𝗹𝗮𝘁𝗶𝗼𝗻) When subproblems repeat → Store results instead of recomputing Examples: 𝘊𝘰𝘪𝘯 𝘤𝘩𝘢𝘯𝘨𝘦, 𝘓𝘐𝘚, 𝘬𝘯𝘢𝘱𝘴𝘢𝘤𝘬 ✅ 𝗧𝗿𝗶𝗲 When you deal with prefixes or dictionaries → Character-by-character search Examples: 𝘞𝘰𝘳𝘥 𝘴𝘦𝘢𝘳𝘤𝘩, 𝘢𝘶𝘵𝘰𝘤𝘰𝘮𝘱𝘭𝘦𝘵𝘦 Get the complete Patterns Roadmap here: https://lnkd.in/gnXy4XNn If you can map a question to a pattern in the first 2 minutes, you’re already ahead of 90% of candidates. 📌 Save & repost this for your network if you find this useful :) I also share DSA roadmaps, pattern-based practice lists, and interview strategies in my free newsletter https://lnkd.in/gSN9buQ7
-
Most people think being good at DSA means solving as many problems as you can. 300 problems. 500 problems. Grinding every day. But that's not what actually makes it click. The truth is — solving the right problems, mapped to the right patterns, makes everything easier. Once you can recognize which pattern a problem belongs to, the solution almost writes itself. Here are the 15 patterns that changed how I approach DSA, with 3 classic problems for each : → Two Pointers — shrink the search space from both ends LC 167. Two Sum II LC 15. 3Sum LC 11. Container With Most Water → Sliding Window — track a moving subarray instead of recomputing LC 3. Longest Substring Without Repeating Characters LC 76. Minimum Window Substring LC 209. Minimum Size Subarray Sum → Binary Search — cut the search space in half every time LC 704. Binary Search LC 33. Search in Rotated Sorted Array LC 153. Find Minimum in Rotated Sorted Array → Frequency Counting — hash maps to count occurrences fast LC 242. Valid Anagram LC 49. Group Anagrams LC 347. Top K Frequent Elements → Matrix Traversal — move through 2D space in a defined order LC 54. Spiral Matrix LC 48. Rotate Image LC 73. Set Matrix Zeroes → Monotonic Stack — track next greater/smaller element in O(n) LC 496. Next Greater Element I LC 739. Daily Temperatures LC 84. Largest Rectangle in Histogram → Prefix Sum — precompute running totals to answer range queries instantly LC 560. Subarray Sum Equals K LC 303. Range Sum Query - Immutable LC 238. Product of Array Except Self → Overlapping Intervals — sort, then merge what overlaps LC 56. Merge Intervals LC 57. Insert Interval LC 435. Non-overlapping Intervals → Greedy — pick the locally best option at each step LC 322. Coin Change LC 55. Jump Game LC 121. Best Time to Buy and Sell Stock → Top K Elements — heaps to track the "best K" without sorting everything LC 215. Kth Largest Element in an Array LC 23. Merge k Sorted Lists LC 373. Find K Pairs with Smallest Sums → Backtracking — explore, hit a wall, undo, try again LC 46. Permutations LC 78. Subsets LC 39. Combination Sum → Binary Tree Traversal — inorder, preorder, postorder, level order LC 102. Binary Tree Level Order Traversal LC 94. Binary Tree Inorder Traversal LC 105. Construct Binary Tree from Preorder and Inorder Traversal → Depth-First Search — go deep before you go wide LC 200. Number of Islands LC 133. Clone Graph LC 543. Diameter of Binary Tree → Breadth-First Search — explore level by level LC 127. Word Ladder LC 994. Rotting Oranges LC 542. 01 Matrix → Dynamic Programming — break it down, remember what you've solved LC 70. Climbing Stairs LC 322. Coin Change LC 300. Longest Increasing Subsequence You don't need to solve 300 problems. You need to know which of these 15 buckets each problem falls into. Save this. You'll need it before your next interview. Which pattern do you struggle with the most? Drop it in the comments 👇 #DSA #CodingInterview #LeetCode
-
In 2021, I failed my leetcode interviews at Amazon. Today, I conduct technical interviews at AWS. Back then, leetcode felt overwhelming. I remember staring at problems for hours wondering if I’d ever get it. I jumped between arrays, graphs and dynamic programming — hoping something would click. But it didn’t. And solving 3500+ leetcode problems felt impossible. Then I realised something that changed everything: It’s not about solving thousands of problems. It’s about learning the patterns behind them. Once I focused on the core DSA patterns everything started to make sense. Here are the patterns that cover most interview questions: 1. Two Pointers ↳ Used for sorted arrays & strings (pair sum, removing duplicates, merging in place). 2. Fast & Slow Pointers ↳ Cycle detection, middle of linked list, detecting starting point of cycle. 3. Sliding Window ↳ Longest / shortest subarray or substring under constraints (k-distinct, frequency limits). 4. Prefix Sum ↳ Subarray sums, range queries, difference arrays. 5. Monotonic Stack / Queue ↳ Next greatest element, stock span, daily temperatures, sliding window max 6. Merge Intervals ↳ Overlapping intervals, meeting rooms, merging ranges. 7. Sorting + Sweep Line ↳ Event processing, scheduling, interval counting, greedy decisions. 8. Divide & Conquer ↳ Merge sort, quicksort, finding medians, recursive splitting. 9. Binary Search (All Variants) ↳ Sorted arrays, rotated arrays, “search on answer” for thresholds or minima. 10. Greedy Algorithms ↳ Activity selection, gas station, optimal scheduling & choice making. 11. Linked List Techniques ↳ Reversal, merging, reordering 12. Heaps & Top-K ↳ Priority queues, top-k elements, streaming median, smallest/largest k. 13. Hashmaps & Frequency Counting ↳ Anagrams, duplicates, sliding window character maps. 14. Dynamic Programming ↳ 1D/2D DP, subsequences, knapsack, DP on strings. 15. Backtracking / Recursive Search ↳ Permutations, subsets, combinations, N-Queens, search trees. 16. Graph Traversals (BFS & DFS) ↳ Connected components, islands, shortest path (unweighted), cycle detection. 17. Topological Sort (DAG Ordering) ↳ Course schedule, dependency resolution, task ordering. 18. Binary Tree Traversals (DFS/BFS) ↳ Preorder, inorder, postorder, level order traversal patterns. 19. Tree Path Problems ↳ Root-to-leaf sums, path sum, DFS with backtracking. 20. Trie (Prefix Tree) ↳ Autocomplete, prefix matching, dictionary search, word problems. Once you understand these patterns, leetcode starts to make a lot more sense. If you’re starting today: → Learn core DSA: arrays, hashmaps, stacks, queues, linked lists, graphs and trees. → Tackle one pattern at a time. Do 2–4 problems per pattern. → Create a study plan & revisit old problems as you learn new ones. → When ready, take on Blind75 questions. Save this for your next interview. Follow Abdirahman Jama for more practical software engineering tips. #softwareengineering
Explore categories
- Hospitality & Tourism
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Healthcare
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Career
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning