Kotlin Whiteboard

Level up your whiteboard interview skills by solving a number of common coding interview questions using Kotlin. By Joe Howard.

Leave a rating/review
Save for later
Comments
Share

Who is this for?

Kotlin developers preparing for job interviews or looking to refresh their coding interview skills.

Covered concepts

  • Binary search
  • Linear data structures: linked lists, stacks, and queues
  • Trees, Binary Trees, BSTs, and AVL Trees
  • Heaps and Priority Queues
  • Basic sorting algorithms
  • Merge Sort, Radix Sort, Heap Sort, and Quicksort
  • Graphs, BFS, and DFS

Part 1: Introduction

01
Toggle description

Learn about the common developer interview practice of whiteboarding, and see some strategies for preparing for whiteboard interviews.

Toggle description

Understand the prerequisites for following along with the course, and see some resources for learning about data structures and algorithms.

Toggle description

See how to create IntelliJ IDEA Kotlin JVM projects that allow you to work with the sample code from the course episodes and how to use the Kotlin playground.

Toggle description

Learn about binary search and solve a warm-up question that uses a technique similar to binary search.

Part 2: Linear Data Structures

Toggle description

See a review of some of the key properties of linear data structures: arrays, linked lists, stacks, and queues.

Toggle description

Given a linked list, create an extension function on the LinkedList class to print the nodes in reverse order.

Toggle description

Given a linked list, find the middle node in the list.

Toggle description

Given a linked list, reverse the linked list itself, so that the nodes are linked in the opposite direction.

Toggle description

Create a function that takes two sorted linked lists and merges them into a single sorted linked list.

Toggle description

Given a linked list, create an extension function on the LinkedList class to print the nodes in reverse order, but this time, with no recursion.

Toggle description

Given a string, check whether the string has matching parentheses.

Toggle description

Imagine you’re playing a game of Monopoly with your friends. Create a Monopoly organizer that tells you whose turn it is.

Toggle description

Implement a method to reverse the contents of a queue using an extension function.

Part 3: Trees

Trees 4:04
Toggle description

Review the definitions surrounding tree data structures and the properties of a number of tree variants.

Toggle description

Print the values in a tree in an order based on their level.

Toggle description

Given a Binary Tree, write an extension function to find the height of the tree.

Toggle description

Devise a way to serialize a Binary Tree into a list, and a way to deserialize the list back into the same Binary Tree.

Toggle description

Create a function that checks if a Binary Tree is a Binary Search Tree.

Toggle description

Add methods to a BinarySearchTree class and BinaryNode class to check whether two BSTs are equal.

Toggle description

Create a method to checks if one BST contains all of the elements of another BST.

Toggle description

How many leaf nodes are there in a perfectly balanced Binary Tree of height 3? What about a perfectly balanced Binary Tree of height h?

Toggle description

How many nodes are there in a perfectly balanced Binary Tree of height 3? What about a perfectly balanced Binary Tree of height h?

Part 4: Heaps and Priority Queues

Toggle description

Review the heap and priority queue data structures as well as their properties and applications.

Toggle description

Write a function to find the nth smallest integer in an unsorted array.

Toggle description

Instead of a heap, use an ArrayList to implement a Priority Queue.

Toggle description

Use a priority queue to get a list of people on a waitlist by the appropriate priority.

Part 5: Basic Sorting

Toggle description

See an animated review of the basic sorting algorithms.

Toggle description

Review Bubble Sort visually then add Bubble Sort as an extension function on MutableList.

Toggle description

Review Selection Sort visually then add Selection Sort as an extension function on MutableList.

Toggle description

Review Insertion Sort visually then add Insertion Sort as an extension function on MutableList.

Toggle description

Given a list of Comparable elements, bring all instances of a given value in the list to the right side of the list.

Toggle description

Given a list of Comparable elements, return the largest element that’s a duplicate in the list.

Toggle description

Create a function to reverse a mutable list of elements without relying on any library functions.

Part 6: Advanced Sorting

Toggle description

Review some of the more advanced sorting algorithms: Merge Sort, Radix Sort, Heap Sort, and Quicksort.

Toggle description

Write a function that takes two sorted Kotlin iterables and merges them into a single iterable.

Toggle description

Implement a most-significant-digit (MSD) Radix Sort, also called lexicographical sorting.

Toggle description

When performing a Heap Sort in ascending order, choose which of two starting arrays require the fewest comparisons.

Toggle description

Use Heap Sort to sort an array in descending order instead of ascending order.

Toggle description

The Quicksort algorithm is typically implemented using recursion. Can you implement it iteratively?

Part 7: Graphs

Graphs 2:41
Toggle description

Review the definition of graphs as well as some of the properties of graphs and their implementation.

Toggle description

Write a method to count the number of paths between two vertices in a directed graph.

Toggle description

Determine the maximum number of items ever in the queue used to perform a breadth-first traversal on a given undirected graph.

Toggle description

Implement a graph breadth-first traversal using recursion and not iteration.

Toggle description

Create a graph method to detect whether or not a graph is disconnected.

DFS or BFS 0:50
Toggle description

For a given graph, determine which traversal (DFS or BFS) is better for discovering if a path exists between certain nodes.

Toggle description

Create a graph method to detect if a directed graph has a cycle.