Skip to content

Solutions for the Design Gurus' Grokking the Coding Interview course

Notifications You must be signed in to change notification settings

mohllal/grokking-the-coding-interview-patterns

Repository files navigation

Grokking Coding Interview Patterns

This repository contains my solutions and notes for the Design Gurus's Grokking the Coding Interview: Patterns for Coding Questions course.

Patterns

Pattern 1: Two Pointers

  1. Pair with Target Sum
  2. Remove Duplicates
  3. Squaring a Sorted Array
  4. Triplet Sum to Zero
  5. Triplet Sum Close to Target
  6. Triplets with Smaller Sum
  7. Dutch National Flag Problem
  8. Quadruple Sum to Target
  9. Comparing Strings Containing Backspaces
  10. Minimum Window Sort

Pattern 2: Fast and Slow Pointers

  1. Linked List Cycle
  2. Start of Linked List Cycle
  3. Happy Number
  4. Middle of the Linked List
  5. Palindrome Linked List
  6. Rearrange a Linked List
  7. Cycle in a Circular Array

Pattern 3: Sliding Window

  1. Maximum Sum Subarray of Size K
  2. Smallest Subarray with a Given Sum
  3. Longest Substring with K Distinct Characters
  4. Fruits into Baskets
  5. No-repeat Substring
  6. Longest Substring with Same Letters after Replacement
  7. Longest Subarray with Ones after Replacement
  8. Permutation in a String
  9. String Anagrams
  10. Smallest Window Containing Substring
  11. Words Concatenation

Pattern 4: Merge Intervals

  1. Merge Intervals
  2. Insert Interval
  3. Intervals Intersection
  4. Conflicting Appointments
  5. Minimum Meeting Rooms
  6. Maximum CPU Load
  7. Employee Free Time

Pattern 5: Cyclic Sort

  1. Cyclic Sort
  2. Missing Number
  3. Find All Numbers Disappeared in an Array
  4. Find the Duplicate Number
  5. Find All Duplicates in an Array
  6. Find the Corrupt Pair
  7. First Missing Positive
  8. First K Missing Positive Numbers

Pattern 6: In-Place Reversal of a Linked List

  1. Reverse a Linked List
  2. Reverse a Sub-List
  3. Reverse Every K-element Sub-List
  4. Reverse Alternating K-element Sub-List
  5. Rotate a Linked List

Pattern 7: Stacks

  1. Balanced Parentheses
  2. Reverse a String Using Stack
  3. Decimal to Binary Conversion
  4. Next Greater Element
  5. Sort a Stack
  6. Simplify Path

Pattern 15: Two Heaps

  1. Find the Median of a Number Stream
  2. Sliding Window Median

Extra Material

Problem Lists

About

Solutions for the Design Gurus' Grokking the Coding Interview course

Topics

Resources

Stars

Watchers

Forks