Hey coders,
In the past few months, I started to share some Interview Experience and tips for preparing for various company Interviews. During, that time, I have got so many requests from students for some Interview questions list, so that they can prepare easily.
Here in this article, I am sharing a comprehensive list of DSA questions that you can practice on Leetcode to increase your chances of cracking that Interview.
Now, before I start with the List. I want to tell you,
HOW TO WORK WITH THIS LIST.
The list is divided based on different topics and level of difficulty. I would recommend to start by solving all the questions of a difficulty level rather than following a specific topic and solving all easy, medium and hard questions. This way once you complete a difficulty level you will have a better understanding of all the topics rather than being a expert in just one topic.
Moreover, if you have a interview coming your way soon, then my recommendation would be to follow the same pattern within a difficulty level, i.e. for Easy level – 1 question of one topic followed by question of another topic. This way you will have grasp in multiple topics in a short span of time. Focusing on one topic and getting expert at it is only helpful if you have enough time to prepare.
Another tip from my side is to find the most optimal solution for the problem, if you are able to get it Great, otherwise look at the fastest submissions and try to understand and replicate it.
So, Choose your strategy wisely.
Also, if you are unable to solve a particular problem. Try reading Solution code first and attempt to understand what is done in code rather than watching a video on YouTube. You can find the solutions to these question in my Github Repository(LINK). Give it a star if you find it helpful.
Here Come questions –
- EASY
- https://leetcode.com/problems/two-sum/
- https://leetcode.com/problems/best-time-to-buy-and-sell-stock/
- https://leetcode.com/problems/plus-one/
- https://leetcode.com/problems/move-zeroes/
- https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/
- https://leetcode.com/problems/running-sum-of-1d-array/
- https://leetcode.com/problems/find-pivot-index/
- https://leetcode.com/problems/majority-element/
- https://leetcode.com/problems/fibonacci-number/
- https://leetcode.com/problems/squares-of-a-sorted-array/
- https://leetcode.com/problems/pascals-triangle/
- https://leetcode.com/problems/remove-duplicates-from-sorted-array/
- https://leetcode.com/problems/reverse-integer/
- https://leetcode.com/problems/add-binary/
- https://leetcode.com/problems/palindrome-number/
- https://leetcode.com/problems/minimum-moves-to-equal-array-elements/
- https://leetcode.com/problems/happy-number/
- https://leetcode.com/problems/excel-sheet-column-title/
- https://leetcode.com/problems/missing-number/
- https://leetcode.com/problems/maximum-product-of-three-numbers/
- https://leetcode.com/problems/power-of-two/
- https://leetcode.com/problems/delete-node-in-a-linked-list/
- https://leetcode.com/problems/middle-of-the-linked-list/
- https://leetcode.com/problems/convert-binary-number-in-a-linked-list-to-integer/
- https://leetcode.com/problems/design-hashset/
- https://leetcode.com/problems/design-hashmap/
- https://leetcode.com/problems/reverse-linked-list/
- https://leetcode.com/problems/merge-two-sorted-lists/
- https://leetcode.com/problems/remove-duplicates-from-sorted-list/
- https://leetcode.com/problems/intersection-of-two-linked-lists/
- https://leetcode.com/problems/linked-list-cycle/
- https://leetcode.com/problems/palindrome-linked-list/
- https://leetcode.com/problems/remove-linked-list-elements/
- https://leetcode.com/problems/diameter-of-binary-tree/
- https://leetcode.com/problems/invert-binary-tree/
- https://leetcode.com/problems/subtree-of-another-tree/
- https://leetcode.com/problems/range-sum-of-bst/
- https://leetcode.com/problems/symmetric-tree/
- https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree/
- https://leetcode.com/problems/merge-two-binary-trees/
- https://leetcode.com/problems/maximum-depth-of-binary-tree/
- https://leetcode.com/problems/binary-tree-paths/
- https://leetcode.com/problems/same-tree/
- https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree/
- https://leetcode.com/problems/path-sum/
- https://leetcode.com/problems/minimum-absolute-difference-in-bst/
- https://leetcode.com/problems/sum-of-left-leaves/
- https://leetcode.com/problems/balanced-binary-tree/
- https://leetcode.com/problems/binary-tree-inorder-traversal/
- MEDIUM
- https://leetcode.com/problems/merge-intervals/
- https://leetcode.com/problems/3sum/
- https://leetcode.com/problems/product-of-array-except-self/
- https://leetcode.com/problems/insert-delete-getrandom-o1/
- https://leetcode.com/problems/subarray-sum-equals-k/
- https://leetcode.com/problems/next-permutation/
- https://leetcode.com/problems/spiral-matrix/
- https://leetcode.com/problems/container-with-most-water/
- https://leetcode.com/problems/rotate-image/
- https://leetcode.com/problems/word-search/
- https://leetcode.com/problems/3sum-closest/
- https://leetcode.com/problems/game-of-life/
- https://leetcode.com/problems/pairs-of-songs-with-total-durations-divisible-by-60/
- https://leetcode.com/problems/4sum/
- https://leetcode.com/problems/find-the-duplicate-number/
- https://leetcode.com/problems/combination-sum/
- https://leetcode.com/problems/jump-game-ii/
- https://leetcode.com/problems/maximum-points-you-can-obtain-from-cards/
- https://leetcode.com/problems/maximum-area-of-a-piece-of-cake-after-horizontal-and-vertical-cuts/
- https://leetcode.com/problems/max-area-of-island/
- https://leetcode.com/problems/find-all-duplicates-in-an-array/
- https://leetcode.com/problems/k-diff-pairs-in-an-array/
- https://leetcode.com/problems/subsets/
- https://leetcode.com/problems/invalid-transactions/
- https://leetcode.com/problems/jump-game/
- https://leetcode.com/problems/subarray-sums-divisible-by-k/
- https://leetcode.com/problems/longest-substring-without-repeating-characters/
- https://leetcode.com/problems/minimum-remove-to-make-valid-parentheses/
- https://leetcode.com/problems/longest-palindromic-substring/
- https://leetcode.com/problems/group-anagrams/
- https://leetcode.com/problems/generate-parentheses/
- https://leetcode.com/problems/basic-calculator-ii/
- https://leetcode.com/problems/integer-to-roman/
- https://leetcode.com/problems/reverse-words-in-a-string/
- https://leetcode.com/problems/simplify-path/
- https://leetcode.com/problems/zigzag-conversion/
- https://leetcode.com/problems/encode-and-decode-tinyurl/
- https://leetcode.com/problems/string-to-integer-atoi/
- https://leetcode.com/problems/multiply-strings/
- https://leetcode.com/problems/angle-between-hands-of-a-clock/
- https://leetcode.com/problems/integer-break/
- https://leetcode.com/problems/valid-square/
- https://leetcode.com/problems/the-kth-factor-of-n/
- https://leetcode.com/problems/remove-all-adjacent-duplicates-in-string-ii/
- https://leetcode.com/problems/daily-temperatures/
- https://leetcode.com/problems/flatten-nested-list-iterator/
- https://leetcode.com/problems/online-stock-span/
- https://leetcode.com/problems/minimum-cost-tree-from-leaf-values/
- https://leetcode.com/problems/sum-of-subarray-minimums/
- https://leetcode.com/problems/evaluate-reverse-polish-notation/
- https://leetcode.com/problems/add-two-numbers/
- https://leetcode.com/problems/copy-list-with-random-pointer/
- https://leetcode.com/problems/add-two-numbers-ii/
- https://leetcode.com/problems/reverse-linked-list-ii/
- https://leetcode.com/problems/reorder-list/
- https://leetcode.com/problems/remove-nth-node-from-end-of-list/
- https://leetcode.com/problems/flatten-a-multilevel-doubly-linked-list/
- https://leetcode.com/problems/partition-list/
- https://leetcode.com/problems/remove-duplicates-from-sorted-list-ii/
- https://leetcode.com/problems/odd-even-linked-list/
- https://leetcode.com/problems/sort-list/
- https://leetcode.com/problems/swap-nodes-in-pairs/
- https://leetcode.com/problems/rotate-list/
- https://leetcode.com/problems/time-based-key-value-store/
- https://leetcode.com/problems/search-in-rotated-sorted-array/
- https://leetcode.com/problems/powx-n/
- https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array/
- https://leetcode.com/problems/find-peak-element/
- https://leetcode.com/problems/search-a-2d-matrix/
- https://leetcode.com/problems/divide-two-integers/
- https://leetcode.com/problems/capacity-to-ship-packages-within-d-days/
- https://leetcode.com/problems/minimum-limit-of-balls-in-a-bag/
- https://leetcode.com/problems/decode-ways/
- https://leetcode.com/problems/word-break/
- https://leetcode.com/problems/delete-and-earn/
- https://leetcode.com/problems/maximal-square/
- https://leetcode.com/problems/coin-change/
- https://leetcode.com/problems/maximum-product-subarray/
- https://leetcode.com/problems/maximum-length-of-repeated-subarray/
- https://leetcode.com/problems/palindromic-substrings/
- https://leetcode.com/problems/house-robber/
- https://leetcode.com/problems/continuous-subarray-sum/
- https://leetcode.com/problems/knight-dialer/
- https://leetcode.com/problems/longest-increasing-subsequence/
- https://leetcode.com/problems/unique-paths/
- https://leetcode.com/problems/count-square-submatrices-with-all-ones/
- https://leetcode.com/problems/range-sum-query-2d-immutable/
- https://leetcode.com/problems/longest-arithmetic-subsequence/
- https://leetcode.com/problems/task-scheduler/
- https://leetcode.com/problems/gas-station/
- https://leetcode.com/problems/minimum-deletion-cost-to-avoid-repeating-letters/
- https://leetcode.com/problems/maximum-number-of-events-that-can-be-attended/
- https://leetcode.com/problems/minimum-deletions-to-make-character-frequencies-unique/
- https://leetcode.com/problems/remove-k-digits/
- https://leetcode.com/problems/restore-the-array-from-adjacent-pairs/
- https://leetcode.com/problems/non-overlapping-intervals/
- https://leetcode.com/problems/partition-labels/
- https://leetcode.com/problems/sort-colors/
- https://leetcode.com/problems/longest-repeating-character-replacement/
- https://leetcode.com/problems/maximum-number-of-visible-points/
- https://leetcode.com/problems/subarrays-with-k-different-integers/
- https://leetcode.com/problems/palindrome-partitioning/
- https://leetcode.com/problems/combination-sum-ii/
- https://leetcode.com/problems/combinations/
- https://leetcode.com/problems/permutations-ii/
- https://leetcode.com/problems/subsets-ii/
- https://leetcode.com/problems/beautiful-arrangement/
- https://leetcode.com/problems/top-k-frequent-elements/
- https://leetcode.com/problems/design-twitter/
- https://leetcode.com/problems/longest-substring-with-at-least-k-repeating-characters/
- https://leetcode.com/problems/max-consecutive-ones-iii/
- https://leetcode.com/problems/grumpy-bookstore-owner/
- https://leetcode.com/problems/sliding-window-median/
- https://leetcode.com/problems/k-closest-points-to-origin/
- https://leetcode.com/problems/kth-largest-element-in-an-array/
- https://leetcode.com/problems/reorganize-string/
- https://leetcode.com/problems/furthest-building-you-can-reach/
- https://leetcode.com/problems/kth-smallest-element-in-a-sorted-matrix/
- https://leetcode.com/problems/cheapest-flights-within-k-stops/
- https://leetcode.com/problems/find-the-most-competitive-subsequence/
- https://leetcode.com/problems/ugly-number-ii/
- https://leetcode.com/problems/longest-substring-with-at-least-k-repeating-characters/
- https://leetcode.com/problems/max-consecutive-ones-iii/
- https://leetcode.com/problems/grumpy-bookstore-owner/
- https://leetcode.com/problems/sliding-window-median/
- https://leetcode.com/problems/count-good-nodes-in-binary-tree/
- https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree/
- https://leetcode.com/problems/binary-tree-right-side-view/
- https://leetcode.com/problems/all-nodes-distance-k-in-binary-tree/
- https://leetcode.com/problems/validate-binary-search-tree/
- https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal/
- https://leetcode.com/problems/binary-search-tree-iterator/
- https://leetcode.com/problems/binary-tree-level-order-traversal/
- https://leetcode.com/problems/path-sum-iii/
- https://leetcode.com/problems/construct-binary-tree-from-preorder-and-postorder-traversal/
- https://leetcode.com/problems/unique-binary-search-trees/
- https://leetcode.com/problems/recover-binary-search-tree/
- https://leetcode.com/problems/populating-next-right-pointers-in-each-node/
- https://leetcode.com/problems/flatten-binary-tree-to-linked-list/
- https://leetcode.com/problems/maximum-width-of-binary-tree/
- https://leetcode.com/problems/unique-binary-search-trees-ii/
- https://leetcode.com/problems/kth-smallest-element-in-a-bst/
- https://leetcode.com/problems/redundant-connection/
- https://leetcode.com/problems/letter-combinations-of-a-phone-number/
- https://leetcode.com/problems/course-schedule-ii/
- https://leetcode.com/problems/decode-string/
- https://leetcode.com/problems/number-of-provinces/
- https://leetcode.com/problems/clone-graph/
- https://leetcode.com/problems/shortest-bridge/
- https://leetcode.com/problems/all-paths-from-source-to-target/
- https://leetcode.com/problems/surrounded-regions//
- https://leetcode.com/problems/house-robber-iii/
- https://leetcode.com/problems/number-of-islands/
- https://leetcode.com/problems/rotting-oranges/
- https://leetcode.com/problems/snakes-and-ladders/
- https://leetcode.com/problems/is-graph-bipartite/
- https://leetcode.com/problems/minimum-jumps-to-reach-home/
- https://leetcode.com/problems/evaluate-division/
- https://leetcode.com/problems/accounts-merge/
- https://leetcode.com/problems/network-delay-time/
- https://leetcode.com/problems/find-eventual-safe-states/
- https://leetcode.com/problems/keys-and-rooms/
- https://leetcode.com/problems/possible-bipartition/
- https://leetcode.com/problems/most-stones-removed-with-same-row-or-column/
- https://leetcode.com/problems/regions-cut-by-slashes/
- https://leetcode.com/problems/satisfiability-of-equality-equations/
- https://leetcode.com/problems/as-far-from-land-as-possible/
- https://leetcode.com/problems/number-of-closed-islands/
- https://leetcode.com/problems/number-of-operations-to-make-network-connected/
- https://leetcode.com/problems/find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance/
- https://leetcode.com/problems/time-needed-to-inform-all-employees/
- https://leetcode.com/problems/lru-cache/
- https://leetcode.com/problems/find-median-from-data-stream/
- https://leetcode.com/problems/design-underground-system/
- https://leetcode.com/problems/lfu-cache/
- https://leetcode.com/problems/tweet-counts-per-frequency/
- https://leetcode.com/problems/all-oone-data-structure/
- https://leetcode.com/problems/design-browser-history/
- HARD
- https://leetcode.com/problems/first-missing-positive/
- https://leetcode.com/problems/largest-rectangle-in-histogram/
- https://leetcode.com/problems/insert-delete-getrandom-o1-duplicates-allowed/
- https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iii/
- https://leetcode.com/problems/max-value-of-equation/
- https://leetcode.com/problems/text-justification/
- https://leetcode.com/problems/integer-to-english-words/
- https://leetcode.com/problems/minimum-window-substring/
- https://leetcode.com/problems/valid-number/
- https://leetcode.com/problems/distinct-subsequences/
- https://leetcode.com/problems/smallest-range-covering-elements-from-k-lists/
- https://leetcode.com/problems/substring-with-concatenation-of-all-words/
- https://leetcode.com/problems/basic-calculator/
- https://leetcode.com/problems/max-points-on-a-line/
- https://leetcode.com/problems/permutation-sequence/
- https://leetcode.com/problems/number-of-digit-one/
- https://leetcode.com/problems/merge-k-sorted-lists/
- https://leetcode.com/problems/reverse-nodes-in-k-group/
- https://leetcode.com/problems/median-of-two-sorted-arrays/
- https://leetcode.com/problems/count-of-smaller-numbers-after-self/
- https://leetcode.com/problems/max-sum-of-rectangle-no-larger-than-k/
- https://leetcode.com/problems/split-array-largest-sum/
- https://leetcode.com/problems/shortest-subarray-with-sum-at-least-k/
- https://leetcode.com/problems/trapping-rain-water/
- https://leetcode.com/problems/word-break-ii/
- https://leetcode.com/problems/regular-expression-matching/
- https://leetcode.com/problems/maximal-rectangle/
- https://leetcode.com/problems/longest-valid-parentheses/
- https://leetcode.com/problems/edit-distance/
- https://leetcode.com/problems/minimum-difficulty-of-a-job-schedule/
- https://leetcode.com/problems/frog-jump/
- https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iv/
- https://leetcode.com/problems/burst-balloons/
- https://leetcode.com/problems/minimum-cost-to-merge-stones/
- https://leetcode.com/problems/minimum-insertion-steps-to-make-a-string-palindrome/
- https://leetcode.com/problems/super-egg-drop/
- https://leetcode.com/problems/count-different-palindromic-subsequences/
- https://leetcode.com/problems/minimum-cost-to-cut-a-stick/
- https://leetcode.com/problems/candy/
- https://leetcode.com/problems/minimum-number-of-taps-to-open-to-water-a-garden/
- https://leetcode.com/problems/create-maximum-number/
- https://leetcode.com/problems/word-search-ii/
- https://leetcode.com/problems/sudoku-solver/
- https://leetcode.com/problems/n-queens/
- https://leetcode.com/problems/unique-paths-iii/
- https://leetcode.com/problems/merge-k-sorted-lists/
- https://leetcode.com/problems/sliding-window-maximum/
- https://leetcode.com/problems/the-skyline-problem/
- https://leetcode.com/problems/trapping-rain-water-ii/
- https://leetcode.com/problems/minimum-number-of-refueling-stops/
- https://leetcode.com/problems/swim-in-rising-water/
- https://leetcode.com/problems/shortest-path-to-get-all-keys/
- https://leetcode.com/problems/minimum-cost-to-hire-k-workers/
- https://leetcode.com/problems/k-th-smallest-prime-fraction/
- https://leetcode.com/problems/serialize-and-deserialize-binary-tree/
- https://leetcode.com/problems/binary-tree-maximum-path-sum/
- https://leetcode.com/problems/vertical-order-traversal-of-a-binary-tree/
- https://leetcode.com/problems/binary-tree-cameras/
- https://leetcode.com/problems/sum-of-distances-in-tree/
- https://leetcode.com/problems/number-of-ways-to-reconstruct-a-tree/
- https://leetcode.com/problems/redundant-connection-ii/
- https://leetcode.com/problems/critical-connections-in-a-network/
- https://leetcode.com/problems/remove-invalid-parentheses/
- https://leetcode.com/problems/longest-increasing-path-in-a-matrix/
- https://leetcode.com/problems/concatenated-words/
- https://leetcode.com/problems/making-a-large-island/
- https://leetcode.com/problems/contain-virus/
- https://leetcode.com/problems/24-game/
- https://leetcode.com/problems/remove-boxes/
- https://leetcode.com/problems/word-ladder/
- https://leetcode.com/problems/word-ladder-ii/
- https://leetcode.com/problems/cut-off-trees-for-golf-event/
- https://leetcode.com/problems/reachable-nodes-in-subdivided-graph/
Stay connected