I have 13 years of Java experience and have interviewed hundreds of developers at MNCs. Most candidates know the 14 major coding patterns by name. Fewer can look at a fresh problem and instantly know which one fits — that's the actual skill being tested. Here's the mapping.
Find if a sorted array has two numbers that sum to a target, without extra space → Two Pointers
Find the longest substring without repeating characters → Sliding Window
Group a list of words into anagram sets → Hash Map / Frequency Counter
Answer many "sum between index i and j" queries efficiently, without recalculating each time → Prefix Sum
Find an element in a rotated sorted array in O(log n) → Binary Search and Variants
Check if a string of brackets is balanced → Stack-Based Problems
Find the maximum sum of any contiguous subarray → Greedy / Kadane's Algorithm
Find the shortest path between two nodes in an unweighted graph → Tree/Graph Traversal (BFS)
Find the maximum value of items that fit in a knapsack of limited capacity → Dynamic Programming (Pick / No-Pick)
Find the longest common subsequence between two strings → Dynamic Programming (Sequence Matching)
Generate all valid combinations of balanced parentheses → Backtracking
Find the Kth largest element in an unsorted array without fully sorting it → Quick Select
I put together a complete backend interview guide covering Core Java, Java 8-21, Multithreading, Spring Boot, Microservices, Design Patterns, and Coding Round Patterns.
Full guide: https://kamaninikhil.gumroad.com/l/java-interview-guide
Feedback or questions? Email me: kamaninikhil71@gmail.com
Bookmark this — which one do you always blank on when you're under pressure?
Top comments (0)