This is an archive of whiteboarding problems discussed at weekly whiteboarding meetups at Noisebridge. Make a PR if you've written a solution.
If you're new to whiteboarding, here's a miniature prerequisite roadmap to help prepare you for the experience:
- Learn programming fundamentals (variables, functions, loops, arrays, etc). Python is a popular language choice; however, most algorithm books use Java, C or C++, so exposure to one of those is recommended.
- Explore the basics of data structures and algorithms (big-O, stacks, queues, graphs, hashing, sorting, searching, etc).
- Grab a copy of Cracking the Coding Interview, read a few chapters and try some problems.
- Sign up for LeetCode and other coding challenge sites and keep solving!
- Please adhere to your language's typical style guidelines for indentation, whitespace and casing.
- Focus on realistic solutions to whiteboarding problems (cap lines of code at a reasonable amount but feel free to subtract lines used to write larger helper functions that an interviewer would typically allow to be abbreviated, like a disjoint-set).
- Add a simple test suite or driver code.
- Collect maximum points in a grid using two traversals (similar: Cherry Pickup)
- Largest time for given digits
- Reveal cards in increasing order
- Flip equivalent binary trees
- Design an elevator
- Given a sequence of points where consecutive points are connected by line segments to make a path, return the point along the path that corresponds to a given percentage along the path.
- Longest file path
- Write the most efficient data structure that stores the last N records of orders to a company that supports two operations: (1) Return the record for the ith last order and (2) add a new record for a new order.
- Write a post-order traversal of a binary tree using iteration
- Concurrent sum
- Force order in concurrency (Similar)
- Select a random number from a stream with O(1) space
- Find missing number in an array of N-1 elements where number from 1 to N is missing. (Similar)
- CTCI 17.24, Max Submatrix: Given an NxN matrix of positive and negative integers, write code to find the submatrix with the largest possible sum. Variant: submatrix is not necessarily square.
- Dependency resolution (Similar to CTCI 4.7)
- CTCI 2.5: Add two numbers stored in linked lists
- CTCI 2.3: Delete a node in the middle of a singly linked list, given only access to that node
- Regions cut by slashes
- Generate all binary strings of length n with k bits set
- Print all paths from top left to bottom right of an n by m matrix moving only right and down
- 2-sum, 3-sum, 4-sum and variants
- Encode and decode strings
- CTCI 1.1: Is unique
- CTCI 1.2: Check permutations
- CTCI 1.3: URLify
- CTCI 1.5: One away
- CTCI 1.6: String compression
- All possible full BSTs
- Range sum of BST
- Find itinerary (variant: return origin city)
- LRU cache
- CTCI 15.7: Multithreaded FizzBuzz
- CTCI 4.1: Routes between nodes
- Save the Queen!
- Balanced parenthesis
- Combine fruits
- Find and replace in string
- Word break
- Best time to buy and sell stock
- Decode String
- Binary parse trees
- Reverse Vowels in a String
- Valid parenthesis string
- Largest region in matrix
- Longest palindromic substring