I failed 30+ coding interviews until I understood and applied these concepts. I’ve applied and interviewed at every MAANG company as well as countless startups across Malaysia, India and the USA. I’ve had many rejections but each has taught me something great about how tech hiring works. Here’s what I wish someone had told me earlier: Let me break it down for you 👇 1️⃣ Arrays & Patterns → Learn how to move pointers with intention: Two Pointers, Sliding Window, Prefix Sums. → Add Binary Search + Sorting, and you can solve 30% of Leetcode. 2️⃣ Recursion & Decision Trees → If you're scared of recursion, you haven’t seen it as a decision tree. This one shift helped me unlock: ✅ Backtracking ✅ Binary Tree Traversals ✅ DP States ✅ Even Subset & Combination problems See the tree. Build the logic. Code will follow. 3️⃣ Graphs → 90% of graph questions are DFS or BFS. → The real twist? Whether it’s on a matrix or an adjacency list. Master: ✅ Cycle Detection ✅ Shortest Path ✅ Connected Components Graphs only feel scary when you don’t code them enough. 4️⃣ HashMaps The hidden hero of 100+ problems. → Use for frequencies, fast lookups, and avoiding O(N²) traps. → Ask yourself in slow problems: “Can I precompute with a HashMap?” Interviewers LOVE clean hashmap tricks. Show them, don’t just tell them. 5️⃣ Heaps → Top K problems? Min-Heap. → Frequent Elements? Max-Heap. → Sliding Window Median? You’ll need two heaps. 6️⃣ Dynamic Programming Yes, it's hard. But no, you don’t need to do 100+ DP problems. Start with: ✅ LCS ✅ 0/1 Knapsack ✅ LIS ✅ Partition Equal Subset Master 1D → 2D transitions and memo → tabulation. That’s 90% of the game. You don’t need quantity, you need clarity. → 80 solid problems solved deeply > 300 solved mindlessly → Debug out loud, talk through your approach, focus on patterns And above all? Don’t let rejection stop you. Let it refine you. You've got this If you’re in the grind right now, I see you. You're closer than you think.
Patterns for Solving Coding Problems
Explore top LinkedIn content from expert professionals.
Summary
Mastering coding interviews requires a focus on identifying recurring patterns in problems rather than brute-force practice. Patterns like sliding windows, recursion, dynamic programming, and graph traversal form the foundation of most coding challenges, making it easier to tackle seemingly complex questions by applying structured problem-solving techniques.
- Focus on common patterns: Study key coding patterns like two pointers, sliding windows, recursion, and graphs to recognize similarities in different problems and solve them efficiently.
- Practice deliberately: Reinforce your skills by solving problems multiple times over a set schedule to turn problem-solving techniques into second nature.
- Analyze and learn: Break down each solution, understand why it works, and build a mental library of approaches for future reference.
-
-
I spent 2+ years grinding Leetcode and learning DSA & problem-solving as a CSE student at BITS Pilani. If I had to start again from 0, this is exactly how I’d do it to get hired as a Software Engineer in 2025: 1️⃣ 𝗺𝗮𝘀𝘁𝗲𝗿 𝗰𝗼𝗿𝗲 𝗮𝗹𝗴𝗼𝗿𝗶𝘁𝗵𝗺𝘀 𝗯𝗲𝗳𝗼𝗿𝗲 𝗮𝗻𝘆𝘁𝗵𝗶𝗻𝗴 𝗲𝗹𝘀𝗲 ○ Before touching random Leetcode problems, I’d master core algorithms like: Binary Search, DFS, BFS, Sliding Window, Two Pointers, Recursion, Backtracking, and Dynamic Programming. ○ The goal isn’t just to “understand” these but to be able to implement them from scratch without hesitation. ○ I’d write each algorithm at least 5-10 times from memory until it becomes second nature. 2️⃣ 𝗳𝗼𝗰𝘂𝘀 𝗼𝗻 𝗽𝗿𝗼𝗯𝗹𝗲𝗺 𝗽𝗮𝘁𝘁𝗲𝗿𝗻𝘀, 𝗻𝗼𝘁 𝗷𝘂𝘀𝘁 𝘀𝗼𝗹𝘃𝗶𝗻𝗴 𝗽𝗿𝗼𝗯𝗹𝗲𝗺𝘀 ○The biggest mistake people make is solving hundreds of random problems without recognizing patterns. ○ 90% of interview problems fall into ~20 coding patterns. ○ Instead of solving 1000+ questions, I’d focus on understanding: ►How problems within a pattern are similar. ►What small variations make them different. ►Which techniques help optimize them. 3️⃣ 𝗿𝗲𝗽𝗲𝗮𝘁 𝗽𝗿𝗼𝗯𝗹𝗲𝗺𝘀 𝗶𝗻𝘀𝘁𝗲𝗮𝗱 𝗼𝗳 𝗷𝘂𝘀𝘁 𝗺𝗼𝘃𝗶𝗻𝗴 𝗼𝗻 ○ Just because I solved a problem once doesn’t mean I’ll remember it. ○ I’d follow this reinforcement schedule for problems I struggled with: Solve it today, solve it again in 1 week and finally solve it again in 1 month. ○This is how I’d make sure I actually retain what I learn. 4️⃣ 𝘀𝘁𝘂𝗱𝘆 𝘀𝗼𝗹𝘂𝘁𝗶𝗼𝗻𝘀 𝘁𝗵𝗲 𝗿𝗶𝗴𝗵𝘁 𝘄𝗮𝘆 ○ When I can’t solve a problem, I’d first struggle with it for at least 30 minutes before looking at the solution. ○ Then, I’d: ► Write out the solution from memory after understanding. ► Explain why it works in simple words ► (if I can’t explain it, I don’t truly understand it). ► Look at alternative solutions to compare trade-offs. 5️⃣ 𝗯𝘂𝗶𝗹𝗱 𝗮 𝘀𝘁𝗿𝘂𝗰𝘁𝘂𝗿𝗲𝗱 𝗽𝗿𝗼𝗯𝗹𝗲𝗺 𝗹𝗶𝘀𝘁 (𝗻𝗼𝘁 𝗷𝘂𝘀𝘁 𝗿𝗮𝗻𝗱𝗼𝗺 𝗴𝗿𝗶𝗻𝗱𝗶𝗻𝗴) ○ Instead of jumping between random problems, I’d follow a structured roadmap like: ► First 50-60 easy problems → Get comfortable with implementation. ► Next 80-100 medium problems → Focus on pattern recognition & optimization. ► Last 30-40 hard problems → Only after mastering the fundamentals. ○ 150-200 well-selected problems are enough to crack most interviews. 6️⃣ 𝘀𝘁𝗮𝗿𝘁 𝗺𝗼𝗰𝗸 𝗶𝗻𝘁𝗲𝗿𝘃𝗶𝗲𝘄𝘀 𝗲𝗮𝗿𝗹𝘆 (𝗲𝘃𝗲𝗻 𝘄𝗵𝗲𝗻 𝗜 𝗳𝗲𝗹𝘁 𝘂𝗻𝗽𝗿𝗲𝗽𝗮𝗿𝗲𝗱) ○ Simulating real interviews early helps with time pressure & communication skills. ○ I’d start setting strict 30-45 min timers on problems to simulate interview conditions. ○ I’d practice explaining my thought process out loud, since half of the interview is about communication. (Bonus tip in the comments) ↓
-
I solved 400+ LeetCode problems consistently. Still got stuck in interviews midway. Why? Because I didn’t study patterns, I studied just problems. If you're grinding for tech interviews at FAANG or top startups, don’t just brute-force your way through LeetCode. I wasted months before realizing this truth: every top company tests a repeatable set of patterns. Here’s what helped me actually get better and get tech interviews: ✅ Salesforce = hashmap, heap, string manipulation, and recursion. Expect edge cases and real-world data constraints. I used this company-tagged problem list to spot repeated trends. ✅ Google = loves recursion and trees. Think: backtracking, permutations, and k-ary structures. This LeetCode list helped me master their common types. ✅ Amazon = sliding windows, greedy, and 2 pointers. They test for speed and optimization. Use this Grokking course to drill patterns like sliding window and merge intervals until they’re second nature. ✅ Meta = graphs and BFS/DFS variants. Trust me, you can’t fake graph intuition. NeetCode’s graph sheet was a game-changer for me. ✅ Uber = dynamic programming, interval scheduling, and graphs. They care about your ability to model real-world systems. Practice problems involving route planning, time optimization, and caching logic. The Lesson I learned here? The ultimate shortcut is knowing which coding patterns to master for which company. Check out my DSA Handbook here: https://lnkd.in/eyu9rBn3 Save this post so you’re not solving random LeetCode problems before your next big interview. Tag a friend who’s deep into the coding interview prep mode. Follow Tharun Kumar Reddy Polu for targeted, real-world strategies to land top tech roles. #LeetCode #FAANG #DSA #TechInterviewTips #SoftwareEngineering #Mentorship
-
After giving & conducting 100+ coding interviews over the past 12+ years at startups and MAANG+ companies, I’ve realized one thing: —Interviews aren’t about who writes the most code. —they’re about who thinks in the most structured way. Here are 30 key insights I’ve learned from sitting on both sides of the table - as an interviewee striving to prove my skills and as an interviewer evaluating candidates: - Communicate trade-offs clearly - Test your code with multiple cases - Start with a brute force, then improve - Clarify edge cases & constraints early - Know when to trade-off time vs. space - Explain time & space complexity upfront - Know when to use BFS vs. DFS in graphs - Optimize only after correctness is ensured - Don’t overcomplicate: simple solutions win - Think out loud & show your thought process - Handle errors & unexpected inputs gracefully - Use stack for problems with nested structures - Understand system design even at junior levels - Recognize patterns (many problems are variations) - Cache results for repeated calculations (Memoization) - Understand when to use heaps & priority queues - Confidence matters(believe in your approach) - Master sliding window for subarray questions - Use binary search for optimization problems - Use modular functions for better readability - Know when recursion vs. iteration is better - Use meaningful variable & function names - Write clean, readable, and modular code - Divide & conquer for large problem sets - Refactor before finalizing your solution Understand the problem before coding - Use two pointers for array problems - Use hash maps for quick lookups - Know how to debug efficiently At the end of the day, coding interviews aren’t about memorization, they’re about structured thinking. Which lesson do you wish you knew earlier?
-
🎯 400 LeetCode problems solved - but this isn't your typical "grinding problems" post. Like training a machine learning model, I approached algorithmic problem-solving with a focus on data quality and diversity. Just as ML models need varied, high-quality data points to generalize well, I found that solving diverse problems across different patterns and domains builds better problem-solving intuition. My systematic approach: Pre-coding Analysis (Link to sample doc in comments) • Document multiple potential approaches • Analyze time & space complexity for each approach • Think through tradeoffs before writing any code • Consider edge cases and constraints Practice Execution • Used stopwatch to measure performance • Aimed to solve while explaining clearly within: - Easy: 10 minutes - Medium: 15 minutes - Hard: 25 minutes • Focus on thinking aloud - crucial for interviews Deep Dive Process • Rigorous complexity analysis • Explore optimization opportunities • Document learnings and patterns • Regular mock interviews on Pramp The goal wasn't to solve all 3000+ problems, but to build a robust "model" that could generalize to new problems effectively. Each solved problem is like a new training data point, helping my brain recognize patterns and edge cases. Key learning: The magic happens in the pre-coding analysis. Writing down different approaches and analyzing tradeoffs before coding helped me: - Build stronger problem-solving intuition - Communicate my thought process clearly - Make better engineering decisions - Save time during actual coding I'll share a sample doc in the comments. It's been crucial for building a systematic approach to problem-solving. To those on this journey: Keep your head down, document your thinking, and remember - you're not just solving problems, you're building a framework for approaching any technical challenge.
-
6 things about learning DSA & problem solving I know now after spending 13+ years as a Software engineer, I wish I knew in my 20s: [1] Problem-solving isn’t memorization. It’s pattern recognition. - You don’t need to invent solutions from scratch. - The best developers quickly recognize patterns by connecting new problems to old ones. - Tip: Train your mind to spot familiar structures in new questions. [2] Develop Your "Fast Brain" - Our brain has two modes: Fast (intuitive) and Slow (analytical). - Your fast brain quickly points you in the right direction (e.g., "This feels like a binary search!"). - Tip: Solve varied problems repeatedly so your intuition instantly kicks in during interviews. [3] Verify Solutions With Your "Slow Brain" - Your fast brain isn't always right. - Use your analytical brain to logically verify solutions step-by-step. - Tip: Always pause and double-check your intuition—don’t rush. [3] Build Your Personal "Pattern Library" - Problems aren’t random, they follow common patterns. - Examples: Sliding Window, Two-Pointers, Backtracking. - Tip: After each problem, note down the core components and approach, building your own mental library. [4] Just Solving Problems Isn’t Enough - Simply solving problems without analyzing them won’t build intuition. - Tip: Break problems down, identify core components, and deeply understand why certain solutions work. [5] Intuition Comes from Deliberate Practice - Memorizing solutions won't help in new situations. - Repeated, intentional practice of problems, especially challenging ones, trains your intuition to "see" solutions quickly. - Tip: Practice intentionally, focusing on identifying patterns rather than just solving fast. [6] Accept That Mastery Takes Time - You won’t build intuition overnight. Be patient. - Regular, thoughtful practice compounds, your skill improves gradually. - Tip: Trust the process and keep practicing consistently. If you feel stuck right now, remember: Every great engineer you admire once struggled with the basics too. Keep practicing, keep growing, you'll get there. – P.S: If you're preparing for a SWE role, do check out my guide on behavioral interviews. If you want to break into big tech, startups, or MAANG companies, you must ace the behavioral round. This guide will help you do it → https://lnkd.in/drnsTNhU (230+ engineers are already using this!)