0% found this document useful (0 votes)
58 views20 pages

LeetCode 600 FAANG Final

The document lists 600 LeetCode questions categorized into various topics such as Arrays, Binary Search, Two Pointers, Sliding Window, Graph, Dynamic Programming, Linked List, Stacks & Queues, Trees & Binary Search Trees, Backtracking, Tries, Bit Manipulation, and Math & Number Theory. Each category contains a specific number of questions aimed at helping individuals prepare for technical interviews, particularly in FAANG companies. The questions cover a wide range of algorithms and data structures, providing a comprehensive resource for practice.

Uploaded by

im.mightyrajveer
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views20 pages

LeetCode 600 FAANG Final

The document lists 600 LeetCode questions categorized into various topics such as Arrays, Binary Search, Two Pointers, Sliding Window, Graph, Dynamic Programming, Linked List, Stacks & Queues, Trees & Binary Search Trees, Backtracking, Tries, Bit Manipulation, and Math & Number Theory. Each category contains a specific number of questions aimed at helping individuals prepare for technical interviews, particularly in FAANG companies. The questions cover a wide range of algorithms and data structures, providing a comprehensive resource for practice.

Uploaded by

im.mightyrajveer
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

600 Ultimate FAANG LeetCode Questions (Final Version)

Arrays (50 Questions)

1. Two Sum
2. Best Time to Buy and Sell Stock
3. Contains Duplicate
4. Product of Array Except Self
5. Maximum Subarray
6. Maximum Product Subarray
7. Find Minimum in Rotated Sorted Array
8. Search in Rotated Sorted Array
9. 3Sum
10. Container With Most Water
11. Next Permutation
12. Longest Consecutive Sequence
13. Set Matrix Zeroes
14. Rotate Image
15. Spiral Matrix
16. Pascals Triangle
17. Merge Intervals
18. Insert Interval
19. Non-overlapping Intervals
20. Meeting Rooms II
21. Subarray Sum Equals K
22. Sort Colors
23. Majority Element
24. Majority Element II
25. Missing Number
26. Find the Duplicate Number
27. Largest Rectangle in Histogram
28. Trapping Rain Water
29. Jump Game
30. Jump Game II
31. Longest Increasing Subsequence
32. Russian Doll Envelopes
33. Minimum Swaps to Sort
34. Maximum Points from Cards
35. Sliding Window Maximum
36. Minimum Number of Platforms
37. Maximum Sum Circular Subarray
38. Count Inversions in an Array
39. Smallest Range in K Lists
40. Maximum Product of Three Numbers
41. Next Greater Element I, II
42. Partition Labels
43. Number of Subarrays with Bounded Maximum
44. Candy Distribution
45. Smallest Missing Positive Number
46. Count the Number of Nice Subarrays
47. Minimum Size Subarray Sum
48. Find Peak Element
49. K-th Largest Element in Array
50. Count Pairs with Given Sum

Binary Search (30 Questions)

51. Binary Search


52. Search in Rotated Sorted Array
53. Find Peak Element
54. Find Minimum in Rotated Sorted Array
55. Search a 2D Matrix
56. Median of Two Sorted Arrays
57. Find Kth Smallest Pair Distance
58. Kth Largest Element in an Array
59. Split Array Largest Sum
60. Capacity to Ship Packages Within D Days
61. Koko Eating Bananas
62. Aggressive Cows
63. Painters Partition Problem
64. Book Allocation Problem
65. Find Smallest Divisor Given a Threshold
66. Single Element in a Sorted Array
67. Find First and Last Position of Element in Sorted Array
68. Find the Duplicate Number
69. Missing Element in Sorted Array
70. Find Median in a Stream
71. Minimize Max Distance to Gas Station
72. Magnetic Force Between Two Balls
73. EKO Wood Cutting Machine
74. Smallest Divisor Given a Threshold
75. Minimum Speed to Arrive on Time
76. Minimize Maximum Pair Sum in Array
77. Guess Number Higher or Lower
78. Divide Chocolate
79. Handshakes Across a Circle
80. Maximize Minimum Distance of Gas Stations

Two Pointers (30 Questions)

81. Two Sum II


82. 3Sum
83. 4Sum
84. Remove Duplicates from Sorted Array
85. Remove Element
86. Move Zeroes
87. Container With Most Water
88. Trapping Rain Water
89. Valid Palindrome
90. Reverse Words in a String
91. Sort Colors
92. Intersection of Two Arrays
93. Subarray Sum Equals K
94. Minimum Window Substring
95. Longest Substring Without Repeating Characters
96. Longest Repeating Character Replacement
97. Permutation in String
98. Minimum Swaps to Group All 1s Together
99. Count Triplets with Sum Less Than X
100. Pairs of Songs With Total Durations Divisible by 60

Sliding Window (20 Questions)

101. Maximum Sum Subarray of Size K


102. Smallest Subarray with Given Sum
103. Longest Substring Without Repeating Characters
104. Longest Repeating Character Replacement
105. Sliding Window Maximum
106. Minimum Window Substring
107. Find All Anagrams in a String
108. Subarrays with K Different Integers
109. Count Number of Nice Subarrays
110. Fruit Into Baskets
111. Maximum Points You Can Obtain from Cards
112. Maximum Consecutive Ones III
113. Longest Subarray of 1s After Deleting One Element
114. Shortest Subarray with Sum at Least K
115. Count Binary Substrings
116. Maximum Frequency Stack
117. Find the Longest Balanced Subarray
118. Substrings of Size K with K Distinct Characters
119. Number of Substrings Containing All Three Characters
120. Shortest Unsorted Continuous Subarray

Graph (50 Questions)


121. Clone Graph
122. Number of Islands
123. Word Ladder
124. Course Schedule
125. Pacific Atlantic Water Flow
126. Surrounded Regions
127. Rotting Oranges
128. Walls and Gates
129. Alien Dictionary
130. Graph Valid Tree
131. Cheapest Flights Within K Stops
132. Network Delay Time
133. Critical Connections in a Network
134. Number of Connected Components in an Undirected Graph
135. Find the Town Judge
136. Redundant Connection
137. Find Eventual Safe States
138. Shortest Path in Binary Matrix
139. Path with Minimum Effort
140. Find if Path Exists in Graph

Dynamic Programming (50 Questions)

141. Climbing Stairs


142. House Robber
143. House Robber II
144. Longest Palindromic Substring
145. Partition Equal Subset Sum
146. Coin Change
147. Coin Change II
148. Combination Sum IV
149. Unique Paths
150. Minimum Path Sum
151. Edit Distance
152. Decode Ways
153. Interleaving String
154. Longest Increasing Subsequence
155. Russian Doll Envelopes
156. Longest Common Subsequence
157. Wildcard Matching
158. Distinct Subsequences
159. Jump Game
160. Jump Game II
161. Longest Valid Parentheses
162. Maximum Product Subarray
163. Best Time to Buy and Sell Stock
164. Best Time to Buy and Sell Stock with Cooldown
165. Word Break
166. Word Break II
167. Paint House
168. Paint Fence
169. Burst Balloons
170. Palindrome Partitioning II
171. Dungeon Game
172. Predict the Winner
173. Minimum Number of Refueling Stops
174. Cherry Pickup
175. Remove Boxes
176. Longest Arithmetic Subsequence
177. Arithmetic Slices
178. Scramble String
179. Strange Printer
180. Target Sum
181. Maximum Length of Repeated Subarray
182. Longest String Chain
183. Count Square Submatrices with All Ones
184. Minimum Falling Path Sum
185. Stone Game
186. K Inverse Pairs Array
187. Maximal Rectangle
188. Largest Divisible Subset
189. Partition Array for Maximum Sum
190. Regular Expression Matching

Linked List (50 Questions)

191. Reverse a Linked List


192. Detect Cycle in a Linked List
193. Merge Two Sorted Lists
194. Merge K Sorted Lists
195. Remove Nth Node From End of List
196. Reorder List
197. Remove Linked List Elements
198. Odd Even Linked List
199. Palindrome Linked List
200. Add Two Numbers
201. Copy List with Random Pointer
202. Rotate List
203. Swap Nodes in Pairs
204. Intersection of Two Linked Lists
205. Flatten a Multilevel Doubly Linked List
206. Reverse Nodes in k-Group
207. Sort List
208. Convert Sorted List to Binary Search Tree
209. Remove Duplicates from Sorted List
210. Remove Duplicates from Sorted List II
211. Partition List
212. Linked List Cycle II
213. Delete Node in a Linked List
214. Insert into a Cyclic Sorted List
215. LRU Cache
216. LFU Cache
217. Design Linked List
218. Add Two Numbers II
219. Reverse Linked List II
220. Split Linked List in Parts
221. Next Greater Node In Linked List
222. Delete Middle Node of a Linked List
223. Double a Number Represented as Linked List
224. Reverse Even Length Groups
225. Rotate List to Right
226. Maximum Twin Sum of a Linked List
227. Remove Zero Sum Consecutive Nodes
228. Swap Adjacent Nodes in Linked List
229. Insert Greatest Common Divisors
230. Merge In Between Linked Lists
231. Reverse Nodes in Odd Length Groups
232. Design Browser History
233. Insert into a Sorted Circular Linked List
234. Convert Binary Number in a Linked List to Integer
235. Multiply Two Linked Lists
236. Flatten a Linked List
237. Convert Sorted Circular List to BST
238. Design Front Middle Back Queue
239. Odd Even Jump
240. Linked List Components

Stacks & Queues (50 Questions)

241. Implement Stack using Queues


242. Implement Queue using Stacks
243. Min Stack
244. Next Greater Element I
245. Next Greater Element II
246. Daily Temperatures
247. Online Stock Span
248. Valid Parentheses
249. Remove All Adjacent Duplicates in String
250. Largest Rectangle in Histogram
251. Maximal Rectangle
252. Sliding Window Maximum
253. Evaluate Reverse Polish Notation
254. Simplify Path
255. Decode String
256. Basic Calculator
257. Basic Calculator II
258. Basic Calculator III
259. Exclusive Time of Functions
260. Design Circular Queue
261. Design Circular Deque
262. Find the Most Competitive Subsequence
263. Sum of Subarray Minimums
264. Remove K Digits
265. Asteroid Collision
266. Next Greater Element III
267. Stock Price Fluctuation
268. Maximum Number of Achievable Transfer Requests
269. Recent Counter Calls
270. Longest Valid Parentheses
271. Validate Stack Sequences
272. Maximum Frequency Stack
273. Sort Stack
274. Reverse Substrings Between Parentheses
275. Design Hit Counter
276. Decode Ways II
277. Design Browser History
278. Shortest Subarray with Sum at Least K
279. Count Number of Valid Parentheses Strings
280. Remove Duplicate Letters
281. Smallest Subsequence of Distinct Characters
282. Buildings with an Ocean View
283. Design Front Middle Back Queue
284. Sum of Subsequence Widths
285. Remove Duplicate Adjacent Letters II
286. Find the Most Competitive Subsequence
287. Largest Rectangle in Histogram
288. Find Pivot Index
289. Trapping Rain Water
290. Implement a Monotonic Queue

Trees & Binary Search Trees (50 Questions)

291. Maximum Depth of Binary Tree


292. Same Tree
293. Invert Binary Tree
294. Diameter of Binary Tree
295. Balanced Binary Tree
296. Binary Tree Level Order Traversal
297. Binary Tree Right Side View
298. Count Good Nodes in Binary Tree
299. Sum Root to Leaf Numbers
300. Path Sum
301. Construct Binary Tree from Preorder and Inorder Traversal
302. Construct Binary Search Tree from Preorder Traversal
303. Validate Binary Search Tree
304. Kth Smallest Element in a BST
305. Lowest Common Ancestor of a BST
306. Binary Tree Zigzag Level Order Traversal
307. Populating Next Right Pointers in Each Node
308. Flatten Binary Tree to Linked List
309. Serialize and Deserialize Binary Tree
310. Binary Tree Cameras
311. Binary Search Tree Iterator
312. Recover Binary Search Tree
313. Closest Binary Search Tree Value
314. Count Complete Tree Nodes
315. Sum of Left Leaves
316. Construct Binary Tree from Inorder and Postorder Traversal
317. Find Duplicate Subtrees
318. All Nodes Distance K in Binary Tree
319. Find Bottom Left Tree Value
320. Maximum Binary Tree
321. Longest Univalue Path
322. Trim a Binary Search Tree
323. Distribute Coins in Binary Tree
324. Pseudo-Palindromic Paths in a Binary Tree
325. Count Unique Subtrees
326. Path with Maximum Sum
327. BST to Greater Tree
328. Binary Tree Pruning
329. Find Leaves of a Binary Tree
330. Diameter of N-Ary Tree
331. Even-Odd Tree
332. Construct Binary Tree from String
333. Maximum Product of Splitted Binary Tree
334. Deepest Leaves Sum
335. Step-By-Step Directions from One Node to Another
336. Smallest String Starting From Leaf
337. Check Completeness of a Binary Tree
338. Path Sum III
339. House Robber III
340. Find Largest Value in Each Tree Row

Backtracking (30 Questions)

341. Subsets
342. Subsets II
343. Permutations
344. Permutations II
345. Combination Sum
346. Combination Sum II
347. Letter Combinations of a Phone Number
348. Generate Parentheses
349. Word Search
350. Palindrome Partitioning
351. Restore IP Addresses
352. N-Queens
353. N-Queens II
354. Sudoku Solver
355. Word Ladder II
356. Beautiful Arrangement
357. Maximum Length of Concatenated String with Unique Characters
358. Remove Invalid Parentheses
359. Number of Squareful Arrays
360. Matchsticks to Square
361. Word Search II
362. Splitting a String Into Descending Consecutive Values
363. Letter Tile Possibilities
364. Brace Expansion
365. Maximum Good People Based on Statements
366. Path with Maximum Gold
367. Count Numbers with Unique Digits
368. Sequential Digits
369. Unique Paths III
370. Partition to K Equal Sum Subsets

Graphs (50 Questions)

371. Number of Islands


372. Flood Fill
373. Rotting Oranges
374. Surrounded Regions
375. Course Schedule
376. Course Schedule II
377. Redundant Connection
378. Critical Connections in a Network
379. Clone Graph
380. Graph Valid Tree
381. Find Eventual Safe States
382. Shortest Path in Binary Matrix
383. Cheapest Flights Within K Stops
384. Network Delay Time
385. Reconstruct Itinerary
386. Alien Dictionary
387. Word Ladder
388. Word Ladder II
389. Minimum Genetic Mutation
390. Swim in Rising Water
391. Keys and Rooms
392. Find the Town Judge
393. Count Sub Islands
394. Path With Minimum Effort
395. Find the Safest Path in a Grid
396. Shortest Path to Get Food
397. Graph Bipartite Check
398. Number of Connected Components
399. Remove Max Number of Edges
400. Min Cost to Connect All Points
401. Find Redundant Connection II
402. Min Cost to Make at Least One Valid Path
403. Find the Judge
404. Count Restricted Paths
405. Find the Town Judge
406. Network Delay Time
407. Min Cost to Hire Workers
408. Connecting Cities with Minimum Cost
409. Find the Smallest Binary
410. Maximal Network Rank
411. Satisfiability of Equality Equations
412. Graph Eulerian Path
413. Shortest Path Visiting All Nodes
414. Minimum Swaps to Make the String Balanced
415. Snakes and Ladders
416. Maximum Area of Island
417. Maximal Rectangle
418. Pacific Atlantic Water Flow
419. Open the Lock

Tries (30 Questions)

420. Implement Trie (Prefix Tree)


421. Design Add and Search Words Data Structure
422. Longest Word in Dictionary
423. Replace Words
424. Maximum XOR of Two Numbers
425. Stream of Characters
426. Search Suggestions System
427. Short Encoding of Words
428. Implement Magic Dictionary
429. Sum of Prefix Scores of Strings
430. Palindrome Pairs
431. Maximum XOR With an Element From Array
432. Trie Longest Common Prefix
433. Search AutoComplete System
434. Count Unique Substrings
435. Concatenated Words
436. Add and Search Word
437. Word Search II
438. Design File System
439. Longest Word in Dictionary
440. Max XOR of an Array Pair
441. Number of Distinct Substrings
442. Minimum Number of Contacts
443. Maximum XOR Between Two Numbers
444. Maximum Number of Items Collected
445. Design Search Autocomplete System
446. Maximum Number of Prefix Codes
447. Prefix Tree Construction
448. Dictionary Longest Word
449. Find Words Formed by Characters

Bit Manipulation (20 Questions)

450. Single Number


451. Single Number II
452. Sum of Two Integers
453. Number of 1 Bits
454. Counting Bits
455. Reverse Bits
456. Power of Two
457. Power of Four
458. Missing Number
459. XOR Queries of a Subarray
460. Maximum XOR of Two Numbers in an Array
461. Find XOR of Numbers from L to R
462. Bitwise AND of Numbers Range
463. Subsets Using Bitmask
464. Number Complement
465. Hamming Distance
466. Find Maximum XOR Pair
467. UTF-8 Validation
468. Minimum Flips to Make A or B Equal to C
469. Convert Binary Number in a Linked List to Integer

Math & Number Theory (30 Questions)

470. Count Primes


471. Sieve of Eratosthenes
472. Integer to Roman
473. Roman to Integer
474. Pow(x, n)
475. Palindrome Number
476. Multiply Strings
477. String to Integer (atoi)
478. Valid Perfect Square
479. Happy Number
480. Plus One
481. Add Binary
482. Factorial Trailing Zeroes
483. Super Pow
484. Excel Sheet Column Number
485. Excel Sheet Column Title
486. Kth Largest Element in an Array
487. Find the Duplicate Number
488. Fibonacci Number
489. Ugly Number
490. Ugly Number II
491. Prime Factorization
492. Count of Smaller Numbers After Self
493. Kth Symbol in Grammar
494. Random Pick with Weight
495. Number of Ways to Reach Target Score
496. Divide Two Integers
497. Permutation Sequence
498. Find Peak Element
499. Power of Three
500. Largest Number

Strings (40 Questions)

501. Longest Substring Without Repeating Characters


502. Longest Repeating Character Replacement
503. Valid Anagram
504. Group Anagrams
505. Valid Parentheses
506. Implement strStr()
507. Longest Palindromic Substring
508. Palindromic Substrings
509. Regular Expression Matching
510. Wildcard Matching
511. Minimum Window Substring
512. Find All Anagrams in a String
513. Reorganize String
514. Multiply Strings
515. Longest Common Prefix
516. Reverse Words in a String
517. Reverse String
518. Longest Word in Dictionary
519. Valid Palindrome
520. Valid Palindrome II
521. Isomorphic Strings
522. Permutation in String
523. Check if Two String Arrays are Equivalent
524. Minimum Add to Make Parentheses Valid
525. Check If String Is a Valid Parentheses String
526. Remove All Adjacent Duplicates
527. Count and Say
528. Integer to English Words
529. One Edit Distance
530. Encode and Decode Strings
531. Find and Replace Pattern
532. Add Binary
533. Longest Subsequence Between Two Strings
534. String Compression
535. Shortest Distance to a Character
536. Find the Index of the First Occurrence
537. Remove Duplicate Letters
538. Largest Odd Number in a String
539. Custom Sort String
540. Sort Characters By Frequency

Heaps & Priority Queues (20 Questions)

541. Kth Largest Element in an Array


542. K Closest Points to Origin
543. Top K Frequent Elements
544. Find Median from Data Stream
545. Sliding Window Maximum
546. Min Heap Implementation
547. Max Heap Implementation
548. Merge K Sorted Lists
549. Task Scheduler
550. Kth Smallest Element in a Sorted Matrix
551. Super Ugly Number
552. Trapping Rain Water II
553. Find K Pairs with Smallest Sums
554. IPO
555. Min Cost to Connect Sticks
556. Frequency Sort
557. Design Twitter
558. Least Number of Unique Integers After K Removals
559. Find Median in a Stream
560. Seat Reservation Manager
Segment Trees & Fenwick Trees (15 Questions)

561. Range Sum Query - Mutable


562. The Skyline Problem
563. Reverse Pairs
564. Count of Smaller Numbers After Self
565. Range Addition
566. Maximum Sum Queries
567. NumArray - Fenwick Tree
568. Count of Range Sum
569. Kth Smallest Number in Multiplication Table
570. 2D Range Sum Query
571. Interval List Intersections
572. Range Frequency Queries
573. Range XOR Queries
574. Reverse Pairs (Advanced)
575. Sum of Mutated Array Closest to Target

Advanced Dynamic Programming (20 Questions)

576. Russian Doll Envelopes


577. Count Different Palindromic Subsequences
578. Number of Ways to Paint N 3 Grid
579. Stone Game II
580. Minimum Difficulty of a Job Schedule
581. Number of Ways to Stay in the Same Place
582. Freedom Trail
583. Strange Printer
584. Split Array Largest Sum
585. Max Sum of 3 Non-Overlapping Subarrays
586. Shortest Path in a Grid with Obstacles
587. Find the Longest Valid Obstacle Course
588. Minimum Swaps to Make Strings Equal
589. Maximum Points You Can Obtain from Cards
590. Frog Jump
591. Remove Boxes
592. Maximum Sum of Non-Adjacent Elements
593. Longest Arithmetic Subsequence of Given Difference
594. Maximum Length of Repeated Subarray
595. Partition Array for Maximum Sum

You might also like