etrepum / nb_whiteboarding

Problems discussed at weekly whiteboarding meetups at Noisebridge

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Noisebridge Whiteboarding Workshop

This is an archive of whiteboarding problems discussed at weekly whiteboarding meetups at Noisebridge. Make a PR if you've written a solution.

Starting out

If you're new to whiteboarding, here's a miniature prerequisite roadmap to help prepare you for the experience:

  1. 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.
  2. Explore the basics of data structures and algorithms (big-O, stacks, queues, graphs, hashing, sorting, searching, etc).
  3. Grab a copy of Cracking the Coding Interview, read a few chapters and try some problems.
  4. Sign up for LeetCode and other coding challenge sites and keep solving!

Pull request guidelines

  • 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.

Past problems

Other Problems

  1. Merge Sort

11/07/2018

  1. Longest path in DAG
  2. BST to linked list
  3. K smallest numbers in array

11/14/2018

  1. Rotate array
  2. Detect cycle in undirected graph
  3. Roads and Libraries
  4. New Year Chaos

11/21/2018

  1. Bouquet of flowers
  2. First missing positive
  3. Median of two sorted arrays

11/28/2018

  1. Find the duplicate number
  2. N-th Fibonacci Number
  3. Shortest Supersequence
  4. Design a spreadsheet

12/05/2018

  1. Collect maximum points in a grid using two traversals (similar: Cherry Pickup)
  2. Largest time for given digits
  3. Reveal cards in increasing order
  4. Flip equivalent binary trees
  5. Design an elevator
  6. 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.

12/12/2018

  1. Longest file path
  2. 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.
  3. Write a post-order traversal of a binary tree using iteration
  4. Concurrent sum
  5. Force order in concurrency (Similar)
  6. Select a random number from a stream with O(1) space
  7. Find missing number in an array of N-1 elements where number from 1 to N is missing. (Similar)
  8. 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.

12/19/2018

  1. Dependency resolution (Similar to CTCI 4.7)
  2. CTCI 2.5: Add two numbers stored in linked lists
  3. CTCI 2.3: Delete a node in the middle of a singly linked list, given only access to that node
  4. Regions cut by slashes

12/26/2018

  1. Generate all binary strings of length n with k bits set
  2. Print all paths from top left to bottom right of an n by m matrix moving only right and down
  3. 2-sum, 3-sum, 4-sum and variants
  4. Encode and decode strings

01/02/2019

  1. CTCI 1.1: Is unique
  2. CTCI 1.2: Check permutations
  3. CTCI 1.3: URLify
  4. CTCI 1.5: One away
  5. CTCI 1.6: String compression
  6. All possible full BSTs
  7. Range sum of BST
  8. Find itinerary (variant: return origin city)
  9. LRU cache
  10. CTCI 15.7: Multithreaded FizzBuzz

01/09/2019

  1. CTCI 4.1: Routes between nodes
  2. Save the Queen!
  3. Balanced parenthesis
  4. Combine fruits
  5. Find and replace in string
  6. Word break
  7. Best time to buy and sell stock

01/16/2019

  1. Decode String
  2. Binary parse trees
  3. Reverse Vowels in a String
  4. Valid parenthesis string
  5. Largest region in matrix
  6. Longest palindromic substring

About

Problems discussed at weekly whiteboarding meetups at Noisebridge


Languages

Language:Python 64.5%Language:C 12.0%Language:Java 11.5%Language:Ruby 5.6%Language:C++ 4.5%Language:Perl 1.8%