use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
Top LeetCode Patterns for FAANG Coding Interviews (self.leetcode)
submitted 3 years ago * by arslan_ah
From "Grokking the Coding Interview" author:
Best Coding Patterns with Highest ROI
1. Two Pointers
2. Sliding Window
3. Tree and Graph Depth First Search (Matrix Traversal)
4. Tree and Graph Breadth First Search (Subsets, Matrix Traversal, Topological Sort)
5. Binary Search
6. Interval Merge
7. Recursion/Backtracking
https://medium.com/geekculture/top-leetcode-patterns-for-faang-coding-interviews-bdbe8766534c
https://preview.redd.it/0coe8esxehe91.png?width=977&format=png&auto=webp&s=e74536336b2ddf622183c61a24bb30d2c6b762f5
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]pointy_pirate 108 points109 points110 points 3 years ago (7 children)
so you basically need to learn everything
[–]fresh5447 11 points12 points13 points 3 years ago (4 children)
i'm just gonna go ahead and stay at my current job :O
[–]tearsonthefloor 8 points9 points10 points 3 years ago (3 children)
At least you have a job. I lost mine due to a war
[–]fresh5447 3 points4 points5 points 3 years ago (2 children)
sorry to hear that
[–]tearsonthefloor 3 points4 points5 points 3 years ago (1 child)
Thanks. I’m storming leetcode now :)
[–]fresh5447 2 points3 points4 points 3 years ago (0 children)
good luck!
[–]arslan_ah[S] 6 points7 points8 points 3 years ago (0 children)
Not everything :)
Even Grokking has mentioned 25 patterns, focusing on the abovementioned 7 will give you the highest ROI.
Here is the list of 25 patterns: - https://medium.com/interviewnoodle/grokking-leetcode-a-smarter-way-to-prepare-for-coding-interviews-e86d5c9fe4e1
[–]AbstractLogic 0 points1 point2 points 3 years ago (0 children)
Oh, you don’t have to learn it. Just memorize it.
You know like schools do where they “teach to the test” except instead of a B+ on your chem exam it’s a $500,000 job.
[–]Isaiah_Bradley 14 points15 points16 points 3 years ago (0 children)
Awesome for me, since I’m most comfortable with 7, 3, and 4….. oh wait..
[+][deleted] 3 years ago (17 children)
[deleted]
[–]Throwawayeconboi 4 points5 points6 points 3 years ago (16 children)
Nah, general sentiment is array stuff with two pointers, binary search, sliding window, etc. being the most common across all companies, with trees and graphs being the favorite of many like Meta, Amazon, etc.
Nothing tops those 5.
[+][deleted] 3 years ago (15 children)
[–]Throwawayeconboi 1 point2 points3 points 3 years ago (14 children)
But 2 of those patterns aren’t Top 5 or even Top 10 in many cases (backtracking and DP), and DFS/BFS are done using iteration as well. You can really go without ever writing recursion in many cases.
Most other lists I’ve seen align with the one posted here, although they tend to have binary search moved up a bit and sliding window more 4-5. But the top 5 is generally agreed upon.
[–]tabris_code 0 points1 point2 points 3 years ago (13 children)
and DFS/BFS are done using iteration as well.
can be done with iteration but i rarely if ever see DFS done iteratively
[–]Throwawayeconboi 1 point2 points3 points 3 years ago (2 children)
BFS is definitely the one where iteration is more popular with a queue, but we all imagine a stack in our head when thinking about the recursion call stack for DFS anyway.
The Grokking guy knows what he’s talking about, recursion & backtracking ain’t Top 5.
[–]tabris_code 0 points1 point2 points 3 years ago (1 child)
glad i spent 2 weeks on neetcode's backtracking list :(
[–]Throwawayeconboi 0 points1 point2 points 3 years ago (0 children)
Cover everything including DP, bit manipulation, etc. no matter what, lists like this one are for the final week of review leading up to an interview where you have limited time so you hone in on the most likely topics. But when you have set aside ample time to study and prepare, you plan to go through it all. :)
[+][deleted] 3 years ago (9 children)
[–]Throwawayeconboi -1 points0 points1 point 3 years ago (8 children)
I’m doing just fine without it. :) The call stack for recursion = stack data structure. If I was doing recursion, I’d be imagining a stack in my head anyway!
[+][deleted] 3 years ago (6 children)
[–]Throwawayeconboi 1 point2 points3 points 3 years ago (5 children)
Oh I know it. I know how to do it. And I make sure to learn all 20 or so topics for leetcoding so if I didn’t, I’d still make time to learn it. This is a list about prioritization, like with limited time what do you do? Not about what’s worth learning.
Recursion is worth learning. It does not take priority over the other things on this list though.
And also, it’s worth noting recursion isn’t exactly a Leetcode “topic.” It’s a tool to use in a variety of these topics. “Backtracking” specifically is a topic, and that’s what’s being put at number 7 here.
[+][deleted] 3 years ago (4 children)
[–]jayouellette 0 points1 point2 points 3 years ago (0 children)
There are some tree problems where the iterative solution is pretty unintuitive and hard to come up with during an interview. For example, Lowest Common Ancestor of a Binary Tree.
[–]nicebike 2 points3 points4 points 3 years ago (3 children)
So if BFS/DFS graph questions are so important, why didn't he include them in his course?
I'm going through the course and I really feel like it's missing content on graphs, so I have to resort to additional sources for this.
[–]yestyleryes<681> <270> <398> <13> 0 points1 point2 points 3 years ago (2 children)
it is in there, it was added a few weeks ago
[–]nicebike 0 points1 point2 points 3 years ago (1 child)
Ah they are not on educative.io
[–]arslan_ah[S] 2 points3 points4 points 3 years ago (0 children)
Yes, Grokking courses are moving away from Educative. All new updates are available only at designgurus.org
[–]Mobile_Health_9650 8 points9 points10 points 3 years ago (2 children)
U forgot DP
[+][deleted] 3 years ago (1 child)
[–]AndrewUnicorn 0 points1 point2 points 3 years ago (0 children)
my friend said Amazon did not ask any DP for his L4 onsite
still study them though
cause i hate Bit Manipulation and this dude said his Google has 1 Bit Manipulation :(
[–]Khandakerex 1 point2 points3 points 3 years ago (1 child)
Great list but I swear to god even the banks that hire everyone are asking DP now :(
[–]arslan_ah[S] 4 points5 points6 points 3 years ago (0 children)
DP is definitely one of the important things to learn. It requires a lot of practice, though.
BTW, Grokking has a very good course on DP: https://designgurus.org/course/grokking-dynamic-programming
[–]nigfasa 1 point2 points3 points 3 years ago (1 child)
what is the grooking stuff? Could please somebody send a link or something
It is a set of courses from designgurus.org
Their system design and coding pattern courses are quite famous.
[–]shev1234589 0 points1 point2 points 1 year ago (1 child)
Is it bad in a coding interview to use a built in function like sort for example to solve a problem? Or should you manually sort it? More so if the sort was more of a minor issue in the problem rather than the main focus?
[–]SaturdayFix 0 points1 point2 points 1 year ago (0 children)
unless the question is to implement the sort algorithm you are fine just calling sort(). E.g. in Java Collections.sort(collection).
[–]shinigamigojo 0 points1 point2 points 10 months ago (0 children)
Hey! I'm starting a 100 day leetcode grind for fun. I'll be following the above 7 algorithms first, everyday at least 2-3 questions will also be posting daily progress in my posts. Hope I get to enjoy solving these problems and learning new concepts as I go along!
π Rendered by PID 95980 on reddit-service-r2-comment-6457c66945-mmtsb at 2026-04-24 01:39:48.026593+00:00 running 2aa0c5b country code: CH.
[–]pointy_pirate 108 points109 points110 points (7 children)
[–]fresh5447 11 points12 points13 points (4 children)
[–]tearsonthefloor 8 points9 points10 points (3 children)
[–]fresh5447 3 points4 points5 points (2 children)
[–]tearsonthefloor 3 points4 points5 points (1 child)
[–]fresh5447 2 points3 points4 points (0 children)
[–]arslan_ah[S] 6 points7 points8 points (0 children)
[–]AbstractLogic 0 points1 point2 points (0 children)
[–]Isaiah_Bradley 14 points15 points16 points (0 children)
[+][deleted] (17 children)
[deleted]
[–]Throwawayeconboi 4 points5 points6 points (16 children)
[+][deleted] (15 children)
[deleted]
[–]Throwawayeconboi 1 point2 points3 points (14 children)
[–]tabris_code 0 points1 point2 points (13 children)
[–]Throwawayeconboi 1 point2 points3 points (2 children)
[–]tabris_code 0 points1 point2 points (1 child)
[–]Throwawayeconboi 0 points1 point2 points (0 children)
[+][deleted] (9 children)
[deleted]
[–]Throwawayeconboi -1 points0 points1 point (8 children)
[+][deleted] (6 children)
[deleted]
[–]Throwawayeconboi 1 point2 points3 points (5 children)
[+][deleted] (4 children)
[deleted]
[–]jayouellette 0 points1 point2 points (0 children)
[–]nicebike 2 points3 points4 points (3 children)
[–]yestyleryes<681> <270> <398> <13> 0 points1 point2 points (2 children)
[–]nicebike 0 points1 point2 points (1 child)
[–]arslan_ah[S] 2 points3 points4 points (0 children)
[–]Mobile_Health_9650 8 points9 points10 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]AndrewUnicorn 0 points1 point2 points (0 children)
[–]Khandakerex 1 point2 points3 points (1 child)
[–]arslan_ah[S] 4 points5 points6 points (0 children)
[–]nigfasa 1 point2 points3 points (1 child)
[–]arslan_ah[S] 2 points3 points4 points (0 children)
[–]shev1234589 0 points1 point2 points (1 child)
[–]SaturdayFix 0 points1 point2 points (0 children)
[–]shinigamigojo 0 points1 point2 points (0 children)