Bootcamp
Searchโ€ฆ
๐Ÿ“…
Course Schedule
0: Language and Tooling Teaching Guide
1: Frontend Basics Teaching Guide
2: Backend Basics Teaching Guide
3: Backend Applications Teaching Guide
4: Backend Structure Teaching Guide
5: Full-Stack Applications Teaching Guide
6: Frontend Infrastructure Teaching Guide
7: React Teaching Guide
8: Advanced React Teaching Guide
9: Advanced Topics Teaching Guide
๐Ÿงฎ
Algorithms Teaching Guide
๐Ÿ’ผ
Interview Prep Teaching Guide
โ˜บ
User Experience Teaching Guide
A.13: Open Practice

Introduction

The following is a list of curated Leetcode problems we can work on daily after learning algorithms fundamentals. The problems are taken from the Top Interview Questions list in Leetcode, sorted in decreasing acceptance rate, i.e. % of submissions that were accepted on Leetcode.
The majority of algorithms interviews Rocket grads have encountered have focused on arrays and hash tables. If you find yourself stuck on a problem focusing on a different data structure, feel free to skip and focus on the array and hash tables problems first.

Exercises

Day 1

Day 2

  1. 1.
    1. 1.
      Feel free to skip the follow up question to implement this traversal iteratively. The iterative implementation is challenging and unlikely to appear in coding interviews.

Day 3

  1. 2.
    1. 1.
      Hint: How can we traverse a BST in sorted order?
  2. 3.
    1. 1.
      Hint: Recall our solution to the kth-largest element in a stream problem: https://leetcode.com/problems/kth-largest-element-in-a-stream/โ€‹

Day 4

  1. 1.
    1. 1.
      Hint: To instantiate a TreeNode class, the syntax is new_node = TreeNode(...), replacing ... with the initialisation parameters.
  2. 2.
    1. 1.
      Hint: Solving this in O(n) without division is a bit of a trick. Feel free to solve it with division and move on.
    2. 2.
      If you're keen on solving it without division: Can we pre-process the data and create intermediate data structures in O(n) time such that we can then fill in the answer array with a single loop?

Day 5

  1. 2.
    1. 1.
      Hint: What combination of arrays and hash tables can we use to group anagrams?
    2. 2.
      Rocket solution code: https://pastebin.com/pfM6JiTxโ€‹
    3. 3.
      Rocket solution video: https://youtu.be/yVCKfkJWHfQ?t=5281โ€‹

Day 6

Day 7

  1. 3.
    1. 1.
      Hint: This is a base-26 numbering system. Requires a more math background to understand how numbers and exponents work. Feel free to skip.

Day 8

Day 9

Day 10

Day 11

  1. 1.
    1. 1.
      Completing this problem will help us understand how to use and implement classes in Python.
    2. 2.
      Hint: An iterator works like this: Each time we call next() on the iterator it will return the next element in the collection. When the iterator is "exhausted", i.e. we have reached the end of the collection, next() will return None.
    3. 3.
      Hint: For a refresher on how to use and implement classes in Python, see code examples from RA's OOP module.

Day 12

Day 13

Day 14

Day 15

Day 16

Day 17

Day 18

Day 19

Day 20

Day 21

Day 22

Day 23

Day 24

Day 25

Day 26

Day 27

Day 28

Day 29

Day 30

Day 31

Day 32

Day 33

Day 34

Day 35

Day 36

Day 37

Day 38

Day 39

Day 40

Last modified 1mo ago