Day 1: Arrays Data Structures and Algorithms
What you’re going to get from this course
Welcome! How to make best use of this course (Please Watch)
Day 1 Goals
Introduction to Data Structures
Introduction to Big O, Time Complexity
2 Asymptotic Analysis and Big O
Big O Space Complexity
Big O Logarithm
Arrays: Data Structures Crash Course
Quiz: Arrays
CODING EXERCISES
CODING INTERVIEW Q1 (Easy): Sorted Squared Array
Coding Exercise: Sorted Squared Array
Method 1, Big O Analysis
Python Code – Method 1
Method 2
Python Code – Method 2
CODING INTERVIEW Q2 (Easy): Monotonic Array
Coding Exercise: Monotonic Array
Method and Big O analysis
Python Code – Monotonic Array
Day 2: Recursion
Day 2 Goals
Recursion Basics
Recursive Leap of Faith
Visualising Recursion
Recursion vs Iteration
Ways to write Base condition
Recurrence relation
How to Solve Recursion Questions
Recursion Approaches – 0 to N and N to 0
Recursion is everywhere
Complexity Analysis of Recursive Solutions
Quiz: Recursion
CODING INTERVIEW QUESTION (Medium): k-th symbol in Grammar
Coding Exercise (k-th symbol in Grammar)
Approach(k-th symbol in Grammar)
Pseudocode (k-th symbol in Grammar)
Python Code
Complexity Analysis(k-th symbol in Grammar)
Python Solution (k-th symbol in Grammar)
CODING INTERVIEW QUESTION (Medium): Josephus problem
Coding Exercise: Josephus problem
Approach 1
Pseudocode
Complexity Analysis
Python Solution 1: Josephus problem Method 1
Approach 2
Pseudocode
Complexity Analysis
Python Solution 2 : Josephus problem Method 2
Approach 3
Complexity Analysis
Python Solution 3 : Josephus problem Method 3
Day 3: Recursion Continued
Day 3 Goals
CODING INTERVIEW QUESTION (Medium): Tower of Hanoi
Coding Exercise(Tower of Hanoi)
Identifying that wew can use Recursion
Approach
Recursion Tree
Python Solution : Tower of Hanoi
Complexity Analysis : Tower of Hanoi
CODING INTERVIEW QUESTION(Medium): Power Sum
Coding Exercise: Power Sum
Method and Big O Analysis
Python Solution: Power Sum
Day 4: Backtracking
Day 4 Goals
What is Backtracking
How is it different from Recursion ?
How does Backtracking work ?
Pass by reference / change inplace
Blueprint to solve questions using Backtracking
Identify when to use Backtracking
Quiz: Backtracking
CODING INTERVIEW QUESTION (Medium): Permutations
Coding Exercise ( Permutations)
Approach
Pseudocode
Python Solution : Permutations
Complexity Analysis
CODING INTERVIEW QUESTION(Medium): Permutations 2
Permutations 2
Approach
Pseudocode
Python Code: Permutations 2
Complexity Analysis : Permutations 2
Day 5: Backtracking
Day 5 Goals
CODING INTERVIEW QUESTION(Medium): Subsets
Subsets
Method
Subsets – Comparison with Backtracking Blueprint
Subsets – Complexity Analysis
Python Code – Subsets
CODING INTERVIEW QUESTION(Medium): Subsets 2
Coding Exercise: Subsets 2
Approach
Python Code: Subsets 2
Subsets 2: Complexity Analysis
Day 6: Backtracking
Day 6 Goals
CODING INTERVIEW QUESTION(Medium): Combinations
Coding Exercise: Combinations
Approach
Combinations : Complexity Analysis
Python Code : Combinations
Combinations: Optimisation
Python Code: Combinations with Optimisation
CODING INTERVIEW QUESTION ( Medium) : Combinations Sum 1
Combinations Sum 1
Day 7: Backtracking
Day 7 Goals
CODING INTERVIEW QUESTION (Medium): Combinations Sum 2
Coding Exercise: Combinations Sum 2
CODING INTERVIEW QUESTION ( Medium) : Combinations Sum 3
Coding Exercise: Combinations Sum 3
Day 8: Backtracking
Day 8 Goals
CODING INTERVIEW QUESTION(Hard) : Sudoku Solver
Sudoku Solver
Approach
Pseudocode
isValid check for Sudoku Solver
Python Code : Sudoku Solver
Complexity Analysis
Another approach – Sudoku Solver ( Python Code)
CODING INTERVIEW QUESTION(Hard): N Queen
Coding Exercise: N Queen
Approach
Pseudocode
Python Code: N Queen
Complexity Analysis
Day 9: Dynamic Programming
Day 9 Goals
Introduction to Dynamic Programming (DP)
Dynamic Programming – Patterns
Approach to solve DP(Dynamic Programming) Questions
Why writing the Recursive solution helps to write the Bottom up approach
Identifying Dynamic Programming Questions
Quiz: Dynamic Programming
CODING INTERVIEW QUESTION(Easy): Fibonacci
Coding Exercise: Fibonacci
Approaches
Approach 1: Recursion
Complexity Analysis: Approach 1 – Recursion
Python Code – Recursion
Approach 2: Memoization
Complexity Analysis : Approach 2 – Memoization
Python Code: Approach 2 – Memoization
Approach 3: Tabulation
Complexity Analysis: Approach 3 – Tabulation
Python Code: Approach 3 – Tabulation
Approach 4: Space Optimised Tabulation + Complexity Analysis
Python Code: Approach 4 -Space Optimised Tabulation + Complexity Analysis
CODING INTERVIEW QUESTION(Easy): Climbing Stairs
Coding Exercise: Climbing Stairs
Day 10: Dynamic Programming Type – Fibonacci
Day 10 Goals
CODING INTERVIEW QUESTION(Easy): Min Cost Climbing Stairs
Coding Exercise: Minimum Cost Climbing Stairs
CODING INTERVIEW QUESTION(Easy): Tribonacci
Coding Exercise: Tribonacci
Day 11: Dynamic Programming Type – Knapsack
Day 11 Goals
CODING INTERVIEW QUESTION(Medium): 0/1 Knapsack
Coding Exercise: 01 Knapsack
Approach 1: Recursion
Recursive Approach: Pseudocode
Recursive Approach: Complexity Analysis
Python Code : Recursive Approach
Approach 2: Memoization
Memoization: Pseudocode
Python Code: Memoization
Memoization: Complexity Analysis
Approach 3: Tabulation
Python Code: Tabulation
Tabulation: Complexity Analysis
Approach 4: Space Optimised Tabulation Approach
Python Code: Space Optimised Tabulation
Space Optimised Tabulation Approach: Complexity Analysis
CODING INTERVIEW QUESTION(Medium): Unbounded Knapsack
Coding Exercise: Unbounded Knapsack
Day 12: Dynamic Programming Type – Knapsack
Day 12 Goals
CODING INTERVIEW QUESTION(Medium): Target Sum
Coding Exercise: Target Sum
CODING INTERVIEW QUESTION(Medium): Partition Equal Subset Sum
Coding Exercise: Partition Equal Subset Sum
Day 13: Dynamic Programming Type – LCS ( Longest Common Subsequence)
Day 13 Goals
CODING INTERVIEW QUESTION(Medium): LCS
Coding Exercise: LCS ( Longest Common Subsequence)
Approach 1: Recursion
Pseudocode
Recursion Tree and Complexity Analysis
Python Code: LCS
Approach 2: Memoization
Python Code: Memoization – LCS
Approach 3: Tabulation
Tabulation: Complexity Analysis
Python Code : Tabulation – LCS
Approach 4: Space Optimised Tabulation – LCS
Python Code : Space Optimised Tabulation – LCS
CODING INTERVIEW QUESTION(Medium): Edit Distance
Coding Exercise: Edit Distance
Identifying this as an LCS Type Question
Approach 1: Recursion
Pseudocode
Recursion: Complexity Analysis
Python Code: Recursive Approach(Edit Distance)
Approach 2: Memoization
Python Code: Memoization(Edit Distance)
Approach 3: Tabulation
Tabulation: Complexity Analysis
Python Code: Tabulation (Edit Distance)
Approach 4: Space Optimised Tabulation
Python Code: Space Optimised Tabulation ( Edit Distance)
Day 14: Dynamic Programming Type – LIS ( Longest Increasing Subsequence)
Day 14 Goals
CODING INTERVIEW QUESTION(Medium): Longest Increasing Subsequence (LIS)
Coding Exercise: LIS
Approach 1: Recursion – LIS
Recursion Tree
Complexity Analysis – Recursion – LIS
Python Code – Recursion – LIS
Approach 2: Memoization
Complexity Analysis – Memoization
Python Code – Memoization – LIS
Approach 3: Tabulation – using a 2D dp array
Dry run
Complexity Analysis – Tabulation – using a 2D dp array
Python Code – Tabulation using a 2D dp array – LIS
Approach 4: Tabulation – using a 1D dp array
Dry run
Complexity Analysis- Tabulation – using a 1D dp array
Python Code-Tabulation – using a 1D dp array
Approach 5: using Binary Search – LIS
Part 1 – Approach 5: using Binary Search – LIS
Part 2 – Approach 5: using Binary Search – LIS
Binary Search for this question ( refer Binary Search section for more details)
Complexity Analysis – Approach 5: using Binary Search – LIS
Python Code – Approach 5: using Binary Search – LIS
CODING INTERVIEW QUESTION(Medium): Max Length of Pair Chain
Coding Exercise: Max Length of Pair Chain
CODING INTERVIEW QUESTION(Hard): Russian Doll Envelopes
Coding Exercise: Russian Doll Envelopes
Day 15: Dynamic Programming Type – Gap Strategy / Length wise Iteration
Day 15 Goals
Introduction to Gap Strategy or Length wise Iteration
CODING INTERVIEW QUESTION(Medium): Palindromic Substrings
Palindromic Substrings
Intuition for Approach
Indetifying this as a DP question
Approach: Recursion with memoization
pseudocode
Filling the Memoization table
iterate length wise
Recursion with memoization: Complexity analysis
Python Code: Recursion with memoization
Tabulation approach
Tabulation approach: Complexity Analysis
Python Code: Tabulation
CODING INTERVIEW QUESTION(Medium): Longest Palindromic Substring
Coding Exercise: Longest Palindromic Substring
CODING INTERVIEW QUESTION(Medium): Longest Palindromic Subsequence
Coding Exercise: Longest Palindromic Subsequence
Day 16: Dynamic Programming Type – Partition Method
Day 16 Goals
Introduction to the Partition method
CODING INTERVIEW QUESTION(Medium): Palindrome Partitioning
Coding Exercise: Palindrome Partitioning
Approach
Pseudocode
Side note: Computing n C r
Complexity Analysis
Python Code: Palindrome Partitioning
CODING INTERVIEW QUESTION(Hard):Palindrome Partitioning 2 ( Minimum Cuts) – Hard
Coding Exercise: Palindrom Partitioning 2 ( Min Cuts)
Approach 1: Recursion
Python Code: Recursion – Palindrome Partitioning 2
Approach 2: Memoization
Python Code: Memoization – Palindrome Partitioning 2
Tabulation – Approach A : Palindrome Partitioning 2
Dry Run
Pseudocode
Python Code : Tabulation – Approach A : Palindrome Partitioning 2
Complexity Analysis
Tabulation – Approach B : Palindrome Partitioning 2
Dry run
Pseudocode
Python Code: Tabulation – Approach A : Palindrome Partitioning 2
Complexity Analysis
Day 17: Dynamic Programming Type – Partition Method
Day 17 Goals
CODING INTERVIEW QUESTION(Medium): Word Break
Coding Exercise: Word Break
CODING INTERVIEW QUESTION(Hard): Matrix Chain Multiplication
Coding Exercise: Matrix Chain Multiplication
Day 18: Dynamic Programming Type – Kadane’s Algorithm
Day 18 Goals
CODING INTERVIEW QUESTION (Medium): Max Subarray
Coding Exercise: Max Subarray
CODING INTERVIEW QUESTION (Medium): Maximum Product Subarray
Coding Exercise: Maximum Product Subarray
Day 19: Arrays Data Structures and Algorithms
Day 19 Goals
Coding Interview Q1(Medium): Rotate Array
Coding Exercise: Rotate Array
Method and Big O analysis
PYTHON Code Solution
Python Code Method 2
Coding Interview Q2(Medium): Container with most water
Coding Exercise: Container with most water
Method 1 and Big O analysis
PYTHON Code Method 1
Method 2 and Big O analysis
PYTHON Code Method 2
Day 20: Dictionaries / Hash Tables Data Structures and Algorithms
Day 20 Goals
Hash Table: Data Structures Crash Course
Coding Interview Q1(Easy): Two Sum
Coding Exercise: Two Sum
Method 1, Big O analysis
PYTHON Code
Method 2, Big O analysis
PYTHON Code
Coding Interview Q2(Easy): Isomorphic Strings
Coding Exercise: Isomorphic Strings
Method and Big O analysis
PYTHON Code
Day 21 : Strings Data Structures and Algorithms
Day 21 Goals
Data Structures Crash Course: Strings
Coding Interview Q1(Easy): First Non Repeating Character
Coding Exercise: First Non Repeating Character
Method 1 and Big O analysis
PYTHON code
Method 2 and Big O analysis
PYTHON code
Coding Interview Q2(Easy): Is Palindrome ?
Coding Exercise: Is Palindrome ?
Method 1 and Big O analysis
PYTHON code
Method 2 and Big O analysis
PYTHON code
Method 3 and Big O analysis
PYTHON code
Day 22: Strings Data Structures and Algorithms
Day 22 Goals
Coding Interview Q1(Medium): Longest Sub string with Unique characters
Coding Exercise: Longest Sub string with Unique characters
Method and Big O analysis
PYTHON code
Coding Interview Q2(Medium): Group Anagrams
Coding Exercise: Group Anagrams
method and Big O analysis
PYTHON code
Day 23: Searching Algorithms
Day 23 Goals
Coding Interview Q1 (Easy): Binary Search Algorithm
Coding Exercise: Binary Search Algorithm
Method and Big O analysis
PYTHON Code Iterative
PYTHON Code Recursive
Coding Interview Q2(Medium): Search in rotated sorted array
Coding Exercise: Search in rotated sorted array
Method and Big O analysis
PYTHON Code
Day 24: Searching Algorithms
Day 24 Goals
Coding Interview Q1(Medium): Search for range
Coding Exercise: Search for range
Method and Big O analysis
PYTHON Code – Recursive
PYTHON Code – Iterative
Coding Interview Q2(Medium): Search in Matrix
Coding Exercise: Search in Matrix
method and Big O analysis
PYTHON code
Day 25: Sorting Algorithms
Day 25 Goals
Coding Interview Q1: Bubble Sort Algorithm
Coding Exercise: Bubble Sort Algorithm
Method and Big O analysis
Python Code
Coding Interview Q2: Insertion Sort Algorithm, Big O analysis
Coding Exercise : Insertion Sort Algorithm
Python code
Insertion sort is a stable sorting Algorithm
Day 26: Sorting Algorithms
Day 26 Goals
Coding Interview Q1: Selection Sort Algorithm, Big O analysis
Coding Exercise: Selection Sort Algorithm
Python Code
Coding Interview Q2: Merge Sort Algorithm
Coding Exercise: Merge Sort
Method and Big O analysis
Python Code
Day 27: Sorting Algorithms
Day 27 Goals
Coding Interview Q1: Quick Sort Algorithm
Coding Exercise: Quick Sort
Optimise Time Complexity
Optimise Space Complexity
Python Code
Coding Interview Q2: Radix Sort Algorithm, Big O analysis
Coding Exercise: Radix Sort Algorithm
Python Code
Day 28 Singly Linked List Data Structures and Algorithms
Day 28 Goals
Data Structures Crash Course: Linked Lists
Coding Interview Q1(Medium): Design a Singly Linked List
Coding Exercise: Design a Singly Linked List
Method and Big O analysis
Python Code
Coding Interview Q2: Remove Duplicates
Coding Exercise: Remove Duplicates
Method and Big O analysis
Python Code
Day 29 Singly Linked List Data Structures and Algorithms
Day 29 Goals
Coding Interview Q1(Easy): Reverse
Coding Exercise: Reverse SLL
Method and Big O analysis
Python Code
Coding Interview Q2(Medium) : Cycle Detection
Coding Exercise: Cycle Detection
Method and Big O analysis
Python Code
proof
Day 30 : Singly Linked List Data Structures and Algorithms
Day 30 Goals
Coding Interview Q1(Medium): Find duplicate number
Coding Exercise: Find duplicate number
method and Big O analysis
Python code
Coding Interview Q2(Medium): Add 2 numbers
Coding Exercise: Add 2 numbers
method and Big O analysis
Python code
Day 31 Doubly Linked List Data Structures and Algorithms
Day 31 Goals
Coding Interview Q1: Remove Node, Insert Node
Coding Exercise: Remove Node
Method remove
Python code: Remove
Insert Intro
Method Insert
Coding Exercise: Insert Node
Python code: Insert
Coding Interview Q2: Remove Value, Insert at Position in Doubly Linked List
Coding Exercise :Remove Value in Doubly Linked List
Remove Val Method
Python Code
Insert at Position
method
Coding Exercise: Insert at Position in DLL
Python Code
Day 32: Stacks Data Structures and Algorithms
Day 32 Goals
Data Structures Crash Course: Stacks and Queues
Coding Interview Q1: Design a Stack
Coding Exercise: Design a Stack (with Linked List)
Python Code
Coding Interview Q2(Medium): Reverse Polish Notation
Coding Exercise: Reverse Polish Notation
method and Big O analysis
Python Code
Day 33: Queue Data Structures and Algorithms
Day 33 Goals
Coding Interview Q1: Design a Queue
Coding Exercise: Design a Queue using a Linked List
Python Code
Coding Interview Q2(Easy) : Queue with Stack
Coding Exercise : Queue with Stack
method and Big O analysis
Python Code
Day 34: Binary Tree / Binary Search Tree Data Structures and Algorithms
Day 34 Goals
Data Structures Crash Course: Trees Introduction
Theory: Binary Trees 1
Proof : height of Balanced Binary tree is floor(log N)
Theory: Binary Tree Terminaologies
What is a BST – Binary Search Tree
Coding Interview Q1: Construct Binary Search Tree,Big O analysis
Coding Exercise: Construct Binary Search Tree
Python Code
Coding Interview Q2 : Traverse – BFS and DFS,Big O analysis
Coding Exercise : Traverse – BFS and DFS
Python Code
Day 35: Binary Tree / Binary Search Tree Data Structures and Algorithms
Day 35 Goals
Coding Interview Q1(Medium): Level Order traversal
Coding Exercise: Instance method, Level Order traversal
Insert method
Python code
Level Order Traversal Method and Big O analysis
Python code – Level order traversal
Coding Interview Q2(Medium): Left / Right view
Coding Exercise: Left / Right view
Method and Big O analysis
Python code
Day 36: Binary Tree Data Structures and Algorithms
Day 36 Goals
Coding Interview Q1 (Easy): Invert Binary Tree
Iterative method and Big O analysis
Python Code: Iterative
Recursive method and Big O analysis
Python Code: Recursive
Coding Interview Q2 (Easy): Diameter of Binary Tree
Method and Big O analysis
Python Code
Day 37: Binary Search Trees Data Structures and Algorithms
Day 37 Goals
Coding Interview Q1(Easy): sorted array to BST
method and Big O analysis
Python code
Coding Interview Q2(Medium) : Valid BST
Method and Big O analysis
Python Code
Day 38: Heaps and Priority Queue Data Structures and Algorithms
Day 38 Goals
Binary Heap: Data Structure Crash Course
Coding Interview Q1: Construct Max Binary Heap, Big O analysis
Proof of Build Binary Heap Time Complexity
Python Code
Introduction to Priority Queue
Coding Interview Q2: Construct Priority Queue,Big O analysis
Python Code
Day 39: Graphs Data Structures and Algorithms
Day 39 Goals
Coding Interview Q1: BFS, Adjacency List,Big O analysis
Python Code
BFS, Adjacency Matrix
Python Code
Coding Interview Q2: DFS, Recursive, Big O analysis
Python Code
DFS Iterative
Python Code
Day 40: Graphs Data Structures and Algorithms
Day 40 Goals
Coding Interview Q1: Number of Components, Big O analysis
Python Code
Coding Interview Q2(Medium): Course Scheduler
Brute Force Method and Big O analysis
Python Code – Brute Force Method
Topological Sort based method and Big O analysis
Python Code