algo icon indicating copy to clipboard operation
algo copied to clipboard

101+ coding interview problems in Go

116+ Coding Interview Problems with Detailed Solutions

Build Status Go Report Card hackernews r/golang

The Ultimate Go Study Guide eBook version →

Join my mailing list to get the latest updates here →

Motivation

I am building a database of most frequently appeared coding interview problems that I think are the most valuable and productive to spend time on. For each one, I am including my thoughts of process on how to approach and solve it, adding well-documented solutions with test cases, time and space complexity analysis. My goal is to help you get good algorithms and data structures so that you can prepare better for your next coding interviews.

These resources that I am looking at are:

If you’re interested in getting updates for this, feel free to join my mailing list here →

Table of Contents

  • Interview Cake
    • Array and string manipulation
      • Merge meeting times
      • Reverse string in place
      • Reverse words
      • Merge sorted arrays
    • Hashing and hash tables
      • In-flight entertainment
      • Permutation palindrome
      • Word cloud data
      • Top scores
    • Greedy algorithms
      • Apple stocks
      • Highest product of three
      • Product of all other numbers
      • In-place shuffle
    • Sorting, searching, and logarithms
      • Find rotation point
    • Trees and graphs
      • Balanced binary tree
      • Binary search tree checker
      • 2nd largest item in a binary search tree
      • Graph coloring
    • Dynamic programming and recursion
      • Recursive string permutations
      • Compute nth Fibonacci number
      • Making change
    • Queues and stacks
      • Largest stack
      • A queue with two stacks
      • Parenthesis matching
      • Bracket validator
    • Linked lists
      • Delete node
      • Linked list has a cycle
      • Reverse a linked list
      • Kth to last node
    • Bit manipulation
      • The stolen breakfast drone
  • LeetCode
    • Array/String
      • Two sum I
      • Two sum II
      • Valid palindrome
      • Implement strstr()
      • Reverse words in string
      • Longest substring without repeating characters
      • Missing ranges
      • One edit distance
    • Math
      • Reverse integer
      • Plus one
      • Palindrome number
    • Linked list
      • Merge sorted linked list
      • Add two numbers
      • Swap nodes in pairs
    • Binary tree
      • Validate binary search tree
      • Maximum depth of binary tree
      • Minimum depth of binary tree
      • Balanced binary tree
      • Binary tree maximum path sum
    • Bit manipulation
      • Single number I
      • Single number II
    • Misc
      • Spiral matrix
    • Stack
      • Min stack
      • Valid parenthesis
    • Dynamic programming
      • Climbing stairs
  • Cracking the Coding Interviews
    • Bit manipulation
      • Bit operation
      • Bit insertion
  • Grokking the Coding Interview: Patterns for Coding Questions
    • Sliding Window
      • Average of any contiguous subarray of size k
      • Maximum sum of any contiguous subarray of size k
      • Smallest subarray with a given sum
      • Longest substring with k distinct characters
      • Fruits into baskets
      • Longest substring without repeating characters
      • Longest substring after k replacements
      • Longest substring after ones replacements
      • Permutation in string
      • String anagrams
    • Two pointers
      • Pair with target sum
      • Remove duplicates
      • Squaring a sorted array
      • Dutch national flag problem
    • Fast and slow pointers
      • Linked list cycle
      • Start of a linked list cycle
      • Happy number
      • Middle of a linked list
      • Palindrome linked list
      • Reorder a linked list
    • Merge intervals
      • Merge intervals
      • Insert interval
      • Intervals intersection
      • Conflicting appointment
    • Cyclic sort
      • Cyclic sort
      • Missing number
      • Missing numbers
      • Find duplicate
      • Find duplicates
      • Find corrupt pair
    • In-place reversal of a linked list
      • Reverse a linked list
    • Tree breath first search
      • Binary tree level order traversal
      • Reverse level order traversal
      • Zigzag traversal
      • Level averages
      • Minimum depth
      • Maximum depth
      • Level order successor
    • Tree depth first search
      • Binary tree path sum
      • Sum of path numbers
    • Two Heaps
      • Find the median of a number stream
    • Subsets
      • Subsets
      • Subsets with duplicates
      • Permutations
  • Grokking Dynamic Programming Patterns
    • Knapsack
      • 0/1 Knapsack
      • Equal subset sum partition
    • Fibonacci numbers
      • Fibonacci numbers
      • Staircase
      • Number factors
  • Practical Algorithms and Data Structures
  • Elements of Programming Interviews
  • Lab (to experiment with different ideas)
    • Data structures
      • Tree
        • Balanced binary tree
        • Binary tree traversals
      • Priority Queue: TODO
      • Bloom filter: TODO
      • LRU cache
    • Sorting
      • Bubble sort
      • Selection sort
      • Insertion sort
      • Merge Sort
      • Quicksort
      • Heapsort
      • Counting Sort
      • Radix Sort: TODO

Developing

Count the number of questions:

make count

Clean up, lint source files, run tests and be ready for a push:

make ready

Test only:

make test

Test and report:

make cover

Test verbose:

make test-verbose

Lint:

make lint

Clean up:

make clean

For more information:

make help

Stargazers over time

Stargazers over time