ctci/README.md

1.5 KiB

Cracking the coding interview exercises and notes

If you can't afford to buy the book, you can find a free pdf here.

Introduction

  1. Big O
  2. Technical questions

Chapter 1 Arrays and strings

  • check unique characters
  • check if permutation
  • replace character by substring
  • Levenshtein distance
  • String compression
  • Matrix rotation
  • String rotation
  • Hash tables (chapter 7)
  • Magic index (chapter 8)
  • Search in sorted matrix (chapter 10)

Chapter 2 Linked lists

  • Remove duplicates
  • Return kth to last
  • Delete middle node
  • Partition list
  • Sum lists
  • Check if palindrome
  • Insert node at beginning
  • Insert node at end
  • Reverse list, single and double linked
  • List intersection
  • Loop detection

Chapter 3 Stacks and queues

  • 3 stacks in array
  • Min function in stack
  • List of stacks
  • Queue via stack
  • Sort stack
  • Animal shelter (enqueue and dequeue with ordering)

Chapter 4 Trees and graphs

Chapter 7 Object-oriented design

  • Hash tables

Chapter 8 Recursion

  • Magic index (index such that A[i] = 1)

Chapter 10 Sorting and searching

  • Sorted matrix search

Chapter 16 Moderate problems

  • Write an integer in english
  • Contiguous sequence or Maximum subarray
  • Least Recently Used cache

Chapter 18 Advanced topics

  • Hash table collision resolution
  • Rabin-Karp substring search