0% found this document useful (0 votes)
12 views

TopInterviewQuestions - LeetCode

Uploaded by

manoharan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

TopInterviewQuestions - LeetCode

Uploaded by

manoharan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

27/11/2019 Problems - LeetCode

🎉🎁 Thanksgiving Sales 🎁🎊
Our Thanksgiving sales begin now! Limited time offer of $30 off our Annual Premium
Membership for just $129. Remember to enter the code THANKS2019 at checkout.
Hurry up and subscribe now (/subscribe) while the discount still last!

Algorithms Database Shell

(/problemset/algorithms/) (/problemset/database/) (/problemset/shell/)


New

Concurrency

(/problemset/concurrency/)

All Problems
(/problemset/all/)

 Top 100 Liked Questions


(/problemset/top-100-liked-questions/)

 Top Amazon Questions 


(/problemset/top-amazon-questions/)

 Top Facebook Questions 


(/problemset/top-facebook-questions/)

 Top Google Questions 


(/problemset/top-google-questions/)

 Top Interview Questions


(/problemset/top-interview-questions/)

 Top LinkedIn Questions 


(/problemset/top-linkedin-questions/)

Contribute Question
(/contribute/)

 Top Interview Questions


47/145 Solved - Easy 35 Medium 12 Hard 0

Search question titles, description or IDs

https://leetcode.com/problemset/top-interview-questions/ 1/14
27/11/2019 Problems - LeetCode

 Difficulty  Status  Lists  Tags 

# Title Solution Acceptance Difficulty Frequency

 1 Two Sum (/problems/two-  (/articles/two-sum) 44.8% Easy


sum)

 2 Add Two Numbers  (/articles/add-two- 32.3% Medium


(/problems/add-two- numbers)
numbers)

146 LRU Cache (/problems/lru-  (/articles/lru-cache) 28.6% Medium


cache)

42 Trapping Rain Water  (/articles/trapping- 45.8% Hard


(/problems/trapping-rain- rain-water)
water)

5 Longest Palindromic  (/articles/longest- 28.3% Medium


Substring (/problems/longest- palindromic-substring)
palindromic-substring)

4 Median of Two Sorted Arrays  (/articles/median-of- 27.8% Hard


(/problems/median-of-two- two-sorted-arrays)
sorted-arrays)

200 Number of Islands  (/articles/number-of- 43.8% Medium


(/problems/number-of- islands)
islands)

15 3Sum (/problems/3sum) 25.3% Medium

 53 Maximum Subarray  (/articles/maximum- 45.1% Easy


(/problems/maximum- subarray)
subarray)

 20 Valid Parentheses  (/articles/valid- 37.6% Easy


(/problems/valid- parentheses)
parentheses)

3 Longest Substring Without  (/articles/longest- 29.2% Medium


Repeating Characters substring-without-
(/problems/longest-substring- repeating-characters)
without-repeating-
characters)

 21 Merge Two Sorted Lists  (/articles/merged- 50.1% Easy


(/problems/merge-two- two-sorted-lists)
sorted-lists)

23 Merge k Sorted Lists  (/articles/merge-k- 37.1% Hard


(/problems/merge-k-sorted- sorted-list)
lists)

https://leetcode.com/problemset/top-interview-questions/ 2/14
27/11/2019 Problems - LeetCode

238 Product of Array Except Self  (/articles/product-of- 57.5% Medium


(/problems/product-of-array- array-except-self)
except-self)

 202 Happy Number  (/articles/happy- 47.5% Easy


(/problems/happy-number) number)

 56 Merge Intervals  (/articles/merge- 37.3% Medium


(/problems/merge- intervals)
intervals)

289 Game of Life  (/articles/game-of- 49.5% Medium


(/problems/game-of-life) life)

76 Minimum Window Substring  (/articles/minimum- 32.6% Hard


(/problems/minimum-window- window-substring)
substring)

 206 Reverse Linked List  (/articles/reverse- 58.1% Easy


(/problems/reverse-linked- linked-list)
list)

297 Serialize and Deserialize  (/articles/serialize- 43.9% Hard


Binary Tree and-deserialize-binary-
(/problems/serialize-and- tree)
deserialize-binary-tree)

 22 Generate Parentheses  (/articles/generate- 58.3% Medium


(/problems/generate- parentheses)
parentheses)

33 Search in Rotated Sorted  (/articles/search-in- 33.4% Medium


Array (/problems/search-in- rotated-sorted-array)
rotated-sorted-array)

253 Meeting Rooms II  (/articles/meeting- 44.1% Medium


(/problems/meeting-rooms- rooms-ii)
ii) 

138 Copy List with Random  (/articles/copy-list- 30.6% Medium


Pointer (/problems/copy-list- with-random-pointer)
with-random-pointer)

 121 Best Time to Buy and Sell  (/articles/best-time- 48.8% Easy


Stock (/problems/best-time- to-buy-and-sell-stock)
to-buy-and-sell-stock)

269 Alien Dictionary 33.3% Hard


(/problems/alien-dictionary)

https://leetcode.com/problemset/top-interview-questions/ 3/14
27/11/2019 Problems - LeetCode

49 Group Anagrams  (/articles/group- 50.9% Medium


(/problems/group- anagrams)
anagrams)

54 Spiral Matrix  (/articles/spiral- 32.1% Medium


(/problems/spiral-matrix) matrix)

11 Container With Most Water  (/articles/container- 47.8% Medium


(/problems/container-with- with-most-water)
most-water)

 88 Merge Sorted Array  (/articles/merge- 37.4% Easy


(/problems/merge-sorted- sorted-arrays)
array)

41 First Missing Positive  (/articles/first- 30.2% Hard


(/problems/first-missing- missing-positive)
positive)

380 Insert Delete GetRandom  (/articles/insert- 44.5% Medium


O(1) (/problems/insert-delete- delete-getrandom-o1)
getrandom-o1)

17 Letter Combinations of a  (/articles/letter- 43.8% Medium


Phone Number combinations-of-a-
(/problems/letter- phone-number)
combinations-of-a-phone-
number)

91 Decode Ways 23.2% Medium


(/problems/decode-ways)

 7 Reverse Integer  (/articles/reverse- 25.6% Easy


(/problems/reverse- integer)
integer)

322 Coin Change  (/articles/coin- 32.6% Medium


(/problems/coin-change) change)

10 Regular Expression Matching  (/articles/regular- 25.9% Hard


(/problems/regular- expression-matching)
expression-matching)

79 Word Search 33.0% Medium


(/problems/word-search)

 46 Permutations  58.7% Medium


(/problems/permutations) (/articles/permutations)

127 Word Ladder  (/articles/word- 26.5% Medium


(/problems/word-ladder) ladder)

https://leetcode.com/problemset/top-interview-questions/ 4/14
27/11/2019 Problems - LeetCode

124 Binary Tree Maximum Path  (/articles/binary- 31.6% Hard


Sum (/problems/binary-tree- tree-maximum-path-
maximum-path-sum) sum)

166 Fraction to Recurring  (/articles/fraction-to- 20.4% Medium


Decimal (/problems/fraction- recurring-decimal)
to-recurring-decimal)

 125 Valid Palindrome 33.1% Easy


(/problems/valid-
palindrome)

13 Roman to Integer 53.8% Easy


(/problems/roman-to-
integer)

218 The Skyline Problem  (/articles/skyline- 32.9% Hard


(/problems/the-skyline- problem)
problem)

 139 Word Break (/problems/word-  (/articles/word- 37.4% Medium


break) break)

412 Fizz Buzz (/problems/fizz-  (/articles/fizz-buzz) 60.5% Easy


buzz)

240 Search a 2D Matrix II  (/articles/search-a- 41.9% Medium


(/problems/search-a-2d- 2d-matrix-ii)
matrix-ii)

215 Kth Largest Element in an  (/articles/kth-largest- 51.0% Medium


Array (/problems/kth-largest- element-in-an-array)
element-in-an-array)

295 Find Median from Data  (/articles/find- 39.8% Hard


Stream (/problems/find- median-from-data-
median-from-data-stream) stream)

341 Flatten Nested List Iterator 50.3% Medium


(/problems/flatten-nested-list-
iterator)

212 Word Search II  (/articles/word- 31.0% Hard


(/problems/word-search-ii) search-ii)

227 Basic Calculator II 35.2% Medium


(/problems/basic-calculator-
ii)

155 Min Stack (/problems/min- 39.8% Easy


stack)

https://leetcode.com/problemset/top-interview-questions/ 5/14
27/11/2019 Problems - LeetCode

 344 Reverse String  (/articles/reverse- 64.8% Easy


(/problems/reverse-string) string)

48 Rotate Image  (/articles/rotate- 51.9% Medium


(/problems/rotate-image) image)

 98 Validate Binary Search Tree  (/articles/validate- 26.7% Medium


(/problems/validate-binary- binary-search-tree)
search-tree)

 283 Move Zeroes  (/articles/move- 55.7% Easy


(/problems/move-zeroes) zeroes)

44 Wildcard Matching  (/articles/wildcard- 23.7% Hard


(/problems/wildcard- matching)
matching)

315 Count of Smaller Numbers 40.0% Hard


After Self (/problems/count-
of-smaller-numbers-after-
self)

 236 Lowest Common Ancestor of  (/articles/lowest- 41.1% Medium


a Binary Tree common-ancestor-of-
(/problems/lowest-common- a-binary-tree)
ancestor-of-a-binary-tree)

8 String to Integer (atoi) 14.9% Medium


(/problems/string-to-integer-
atoi)

 70 Climbing Stairs  (/articles/climbing- 45.5% Easy


(/problems/climbing-stairs) stairs)

14 Longest Common Prefix  (/articles/longest- 34.4% Easy


(/problems/longest-common- common-prefix)
prefix)

 387 First Unique Character in a  (/articles/first- 51.0% Easy


String (/problems/first- unique-character-in-a-
unique-character-in-a- string)
string)

34 Find First and Last Position  (/articles/find-first- 34.6% Medium


of Element in Sorted Array and-last-position-
(/problems/find-first-and-last- element-sorted-array)
position-of-element-in-sorted-
array)

140 Word Break II  (/articles/word- 28.9% Hard


(/problems/word-break-ii) break-ii)

https://leetcode.com/problemset/top-interview-questions/ 6/14
27/11/2019 Problems - LeetCode

 78 Subsets 56.4% Medium


(/problems/subsets)

348 Design Tic-Tac-Toe 51.8% Medium


(/problems/design-tic-tac-
toe) 

347 Top K Frequent Elements  (/articles/top-k- 57.6% Medium


(/problems/top-k-frequent- frequent-elements)
elements)

239 Sliding Window Maximum  (/articles/sliding- 40.1% Hard


(/problems/sliding-window- window-maximum)
maximum)

300 Longest Increasing  (/articles/longest- 41.7% Medium


Subsequence increasing-
(/problems/longest- subsequence)
increasing-subsequence)

105 Construct Binary Tree from  (/articles/construct- 44.3% Medium


Preorder and Inorder binary-tree-from-
Traversal preorder-and-inorder-
(/problems/construct-binary- tr)
tree-from-preorder-and-
inorder-traversal)

103 Binary Tree Zigzag Level 44.2% Medium


Order Traversal
(/problems/binary-tree-
zigzag-level-order-
traversal)

149 Max Points on a Line  (/articles/max- 16.3% Hard


(/problems/max-points-on-a- points-on-a-line)
line)

210 Course Schedule II  (/articles/course- 37.1% Medium


(/problems/course-schedule- schedule-ii)
ii)

128 Longest Consecutive  (/articles/longest- 43.2% Hard


Sequence consecutive-sequence)
(/problems/longest-
consecutive-sequence)

 207 Course Schedule 40.0% Medium


(/problems/course-
schedule)

https://leetcode.com/problemset/top-interview-questions/ 7/14
27/11/2019 Problems - LeetCode

 198 House Robber  (/articles/house- 41.5% Easy


(/problems/house-robber) robber)

152 Maximum Product Subarray 30.4% Medium


(/problems/maximum-
product-subarray)

 75 Sort Colors (/problems/sort-  (/articles/sort-colors) 43.9% Medium


colors)

 50 Pow(x, n) (/problems/powx-  (/articles/powx-n) 28.8% Medium


n)

242 Valid Anagram  (/articles/valid- 54.3% Easy


(/problems/valid-anagram) anagram)

340 Longest Substring with At  (/articles/longest- 41.8% Hard


Most K Distinct Characters substring-with-at-most-
(/problems/longest-substring- k-distinct-characte)
with-at-most-k-distinct-
characters) 

148 Sort List (/problems/sort- 38.3% Medium


list)

150 Evaluate Reverse Polish 34.0% Medium


Notation (/problems/evaluate-
reverse-polish-notation)

328 Odd Even Linked List  (/articles/odd-even- 51.1% Medium


(/problems/odd-even-linked- linked-list)
list)

36 Valid Sudoku  (/articles/valid- 45.6% Medium


(/problems/valid-sudoku) sudoku)

277 Find the Celebrity 39.1% Medium


(/problems/find-the-
celebrity) 

84 Largest Rectangle in  (/articles/largest- 32.8% Hard


Histogram rectangle-in-histogram)
(/problems/largest-rectangle-
in-histogram)

19 Remove Nth Node From End  (/articles/remove- 34.6% Medium


of List (/problems/remove- nth-node-from-end-of-
nth-node-from-end-of-list) list)

https://leetcode.com/problemset/top-interview-questions/ 8/14
27/11/2019 Problems - LeetCode

102 Binary Tree Level Order  (/articles/binary- 51.0% Medium


Traversal (/problems/binary- tree-level-order-
tree-level-order-traversal) traversal)

 234 Palindrome Linked List  37.4% Easy


(/problems/palindrome- (/articles/palindrome-
linked-list) linked-list)

 136 Single Number  (/articles/single- 62.1% Easy


(/problems/single-number) number)

29 Divide Two Integers 16.2% Medium


(/problems/divide-two-
integers)

 169 Majority Element  (/articles/majority- 54.9% Easy


(/problems/majority- element)
element)

 350 Intersection of Two Arrays II  49.7% Easy


(/problems/intersection-of- (/articles/intersection-
two-arrays-ii) of-two-arrays-ii)

208 Implement Trie (Prefix Tree)  (/articles/implement- 42.1% Medium


(/problems/implement-trie- trie-prefix-tree)
prefix-tree)

 162 Find Peak Element  (/articles/find-peak- 42.2% Medium


(/problems/find-peak- element)
element)

204 Count Primes 30.2% Easy


(/problems/count-primes)

134 Gas Station (/problems/gas-  (/articles/gas- 35.7% Medium


station) station)

329 Longest Increasing Path in a  (/articles/longest- 41.5% Hard


Matrix (/problems/longest- increasing-path-matrix)
increasing-path-in-a-
matrix)

131 Palindrome Partitioning 43.6% Medium


(/problems/palindrome-
partitioning)

 141 Linked List Cycle  (/articles/linked-list- 38.8% Easy


(/problems/linked-list- cycle)
cycle)

38 Count and Say 42.3% Easy


(/problems/count-and-say)

https://leetcode.com/problemset/top-interview-questions/ 9/14
27/11/2019 Problems - LeetCode

62 Unique Paths 50.2% Medium


(/problems/unique-paths)

 101 Symmetric Tree  (/articles/symmetric- 45.0% Easy


(/problems/symmetric-tree) tree)

334 Increasing Triplet 39.7% Medium


Subsequence
(/problems/increasing-triplet-
subsequence)

 130 Surrounded Regions 24.6% Medium


(/problems/surrounded-
regions)

179 Largest Number  (/articles/largest- 26.9% Medium


(/problems/largest- number)
number)

 28 Implement strStr() 33.3% Easy


(/problems/implement-
strstr)

 69 Sqrt(x) (/problems/sqrtx)  (/articles/sqrtx) 32.5% Easy

 122 Best Time to Buy and Sell  (/articles/best-time- 53.7% Easy


Stock II (/problems/best-time- to-buy-and-sell-stock-
to-buy-and-sell-stock-ii) ii)

 160 Intersection of Two Linked  36.6% Easy


Lists (/problems/intersection- (/articles/intersection-
of-two-linked-lists) of-two-linked-lists)

 268 Missing Number  (/articles/missing- 49.6% Easy


(/problems/missing- number)
number)

 118 Pascal's Triangle  (/articles/pascals- 48.9% Easy


(/problems/pascals- triangle)
triangle)

287 Find the Duplicate Number  (/articles/find-the- 51.7% Medium


(/problems/find-the-duplicate- duplicate-number)
number)

116 Populating Next Right 40.4% Medium


Pointers in Each Node
(/problems/populating-next-
right-pointers-in-each-
node)

https://leetcode.com/problemset/top-interview-questions/ 10/14
27/11/2019 Problems - LeetCode

 26 Remove Duplicates from  (/articles/remove- 42.6% Easy


Sorted Array duplicates-from-sorted-
(/problems/remove- array)
duplicates-from-sorted-
array)

 189 Rotate Array  (/articles/rotate- 32.1% Easy


(/problems/rotate-array) array)

 104 Maximum Depth of Binary  (/articles/maximum- 63.0% Easy


Tree (/problems/maximum- depth-of-binary-tree)
depth-of-binary-tree)

279 Perfect Squares  (/articles/perfect- 43.5% Medium


(/problems/perfect- squares)
squares)

55 Jump Game  (/articles/jump- 32.9% Medium


(/problems/jump-game) game)

378 Kth Smallest Element in a 51.4% Medium


Sorted Matrix (/problems/kth-
smallest-element-in-a-sorted-
matrix)

324 Wiggle Sort II 28.9% Medium


(/problems/wiggle-sort-ii)

94 Binary Tree Inorder Traversal  (/articles/binary- 59.6% Medium


(/problems/binary-tree- tree-inorder-traversal)
inorder-traversal)

395 Longest Substring with At 39.8% Medium


Least K Repeating
Characters
(/problems/longest-substring-
with-at-least-k-repeating-
characters)

384 Shuffle an Array  (/articles/shuffle-an- 51.3% Medium


(/problems/shuffle-an- array)
array)

251 Flatten 2D Vector 44.8% Medium


(/problems/flatten-2d-vector)

163 Missing Ranges 23.6% Medium


(/problems/missing-ranges)

https://leetcode.com/problemset/top-interview-questions/ 11/14
27/11/2019 Problems - LeetCode

73 Set Matrix Zeroes  (/articles/set-matrix- 41.4% Medium


(/problems/set-matrix- zeroes)
zeroes)

 171 Excel Sheet Column Number 52.8% Easy


(/problems/excel-sheet-
column-number)

230 Kth Smallest Element in a  (/articles/kth- 54.5% Medium


BST (/problems/kth-smallest- smallest-element-in-a-
element-in-a-bst) bst)

108 Convert Sorted Array to  (/articles/convert- 53.7% Easy


Binary Search Tree sorted-array-to-bst)
(/problems/convert-sorted-
array-to-binary-search-
tree)

 66 Plus One (/problems/plus- 41.8% Easy


one)

285 Inorder Successor in BST  (/articles/inorder- 37.2% Medium


(/problems/inorder- successor-in-bst)
successor-in-bst) 

371 Sum of Two Integers 50.8% Easy


(/problems/sum-of-two-
integers)

 237 Delete Node in a Linked List  (/articles/delete- 56.7% Easy


(/problems/delete-node-in-a- node-linked-list)
linked-list)

 217 Contains Duplicate  (/articles/contains- 54.0% Easy


(/problems/contains- duplicate)
duplicate)

454 4Sum II (/problems/4sum- 51.8% Medium


ii)

308 Range Sum Query 2D - 33.6% Hard


Mutable (/problems/range-
sum-query-2d-mutable) 

172 Factorial Trailing Zeroes 37.6% Easy


(/problems/factorial-trailing-
zeroes)

191 Number of 1 Bits  (/articles/number-1- 45.7% Easy


(/problems/number-of-1- bits)
bits)

https://leetcode.com/problemset/top-interview-questions/ 12/14
27/11/2019 Problems - LeetCode

 326 Power of Three  (/articles/power-of- 41.9% Easy


(/problems/power-of-three) three)

190 Reverse Bits 33.8% Easy


(/problems/reverse-bits)

all  rows per page.

 Topics

Array 206 (/tag/array/) Dynamic Programming 170 (/tag/dynamic-programming/) Math 159 (/tag/math/)

String 149 (/tag/string/) Tree 123 (/tag/tree/) Hash Table 121 (/tag/hash-table/)

Depth-first Search 113 (/tag/depth-first-search/) Binary Search 79 (/tag/binary-search/) Greedy 66 (/tag/greedy/)

Two Pointers 60 (/tag/two-pointers/) Breadth-first Search 58 (/tag/breadth-first-search/) Stack 54 (/tag/stack/)

Backtracking 50 (/tag/backtracking/) Design 42 (/tag/design/) Bit Manipulation 38 (/tag/bit-manipulation/)

Sort 38 (/tag/sort/) Graph 37 (/tag/graph/) Linked List 36 (/tag/linked-list/) Heap 34 (/tag/heap/)

Show More 

 Companies

Google 740 (/company/google/) Amazon 599 (/company/amazon/) Facebook 450 (/company/facebook/)

Microsoft 393 (/company/microsoft/) Uber 268 (/company/uber/) Apple 260 (/company/apple/)

Bloomberg 251 (/company/bloomberg/) Adobe 170 (/company/adobe/) LinkedIn 141 (/company/linkedin/)

Oracle 113 (/company/oracle/) Yahoo 106 (/company/yahoo/) Snapchat 83 (/company/snapchat/)

Goldman Sachs 81 (/company/goldman-sachs/) Twitter 79 (/company/twitter/)

Walmart Labs 66 (/company/walmart-labs/) Airbnb 64 (/company/airbnb/) eBay 61 (/company/ebay/)

VMware 58 (/company/vmware/) Salesforce 56 (/company/salesforce/) Alibaba 55 (/company/alibaba/)

Lyft 51 (/company/lyft/) Cisco 48 (/company/cisco/) Yelp 47 (/company/yelp/)

ByteDance 45 (/company/bytedance/) Expedia 42 (/company/expedia/) Baidu 41 (/company/baidu/)

Paypal 37 (/company/paypal/) Mathworks 35 (/company/mathworks/) Pinterest 35 (/company/pinterest/)

Zillow 33 (/company/zillow/) Yandex 32 (/company/yandex/) SAP 31 (/company/sap/) Visa 31 (/company/visa/)

Tencent 30 (/company/tencent/) Atlassian 29 (/company/atlassian/) Intuit 26 (/company/intuit/)

Quora 25 (/company/quora/) Nutanix 24 (/company/nutanix/) Zenefits 24 (/company/zenefits/)

https://leetcode.com/problemset/top-interview-questions/ 13/14
27/11/2019 Problems - LeetCode

Dropbox 23 (/company/dropbox/) Pocket Gems 21 (/company/pocket-gems/) Qualtrics 21 (/company/qualtrics/)

Wish 21 (/company/wish/) Citadel 20 (/company/citadel/) Palantir Technologies 20 (/company/palantir-technologies/)

Indeed 19 (/company/indeed/) Square 19 (/company/square/) GoDaddy 18 (/company/godaddy/)

Hulu 18 (/company/hulu/) JPMorgan 18 (/company/jpmorgan/) Samsung 18 (/company/samsung/)

Two Sigma 18 (/company/two-sigma/) Wayfair 18 (/company/wayfair/) Akuna Capital 17 (/company/akuna-capital/)

Coursera 17 (/company/coursera/) Houzz 17 (/company/houzz/) TripAdvisor 17 (/company/tripadvisor/)

Show More 

Copyright © 2019 LeetCode


Help Center (/support/) | Terms (/terms/) | Privacy Policy (/privacy/)
United States (/region/)

https://leetcode.com/problemset/top-interview-questions/ 14/14

You might also like