Pro

# Kotlin Whiteboard

Jul 28 2020 · Video Course (3 hrs, 5 mins) · Intermediate

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

4.3/5 6 Ratings

#### Version

• Kotlin 1.3, IntelliJ IDEA 2020.1

## Introduction

#### Whiteboard Interviews

2:59 Free

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

1

#### Prerequisites

3:54

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

2

#### Use The Sample Code

4:16

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.

3

#### Find the Range

10:59

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

4

## Linear Data Structures

#### Linear Data Structures

9:18

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

5

#### Print Linked List in Reverse

4:13

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

6

#### Find the Middle Item

3:29

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

7

5:27

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

8

5:04

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

9

#### Print Linked List in Reverse-Iterative

2:55

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.

10

#### Parentheses Validation

4:03

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

11

#### Next Player

2:36

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

12

#### Reverse a Queue

3:03

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

13

## Trees

#### Trees

4:04

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

14

#### Print by Level

4:18

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

15

#### Tree Height

3:01

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

16

#### Binary Tree Serialization

7:53

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

17

#### BST Validation

4:34

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

18

#### BST Equality

3:22

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

19

#### BST Same Elements

3:32

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

20

#### Count the Leaves

2:36

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?

21

#### Count the Nodes

2:40

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

22

## Heaps and Priority Queues

#### Heaps and Priority Queues

2:00

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

23

#### Find nth Smallest Value

3:51

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

24

#### ArrayList Priority Queue

7:36

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

25

#### Sorting by Priority

3:07

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

26

## Basic Sorting

#### Basic Sorting

2:53

See an animated review of the basic sorting algorithms.

27

#### Bubble Sort

5:12

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

28

#### Selection Sort

3:34

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

29

#### Insertion Sort

3:46

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

30

#### Move to the Left

4:19

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

31

#### Duplicate Finder

4:59

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

32

#### Manual Reverse

2:03

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

33

2:05

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

34

#### Merge Iterables

4:57

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

35

#### Most Significant Digit Sort

7:17

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

36

#### Fewest Comparisons

1:04

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

37

#### Descending Sort

1:57

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

38

#### Iterative Quicksort

4:10

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

39

## Graphs

#### Graphs

2:41

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

40

#### Paths Between Vertices

4:50

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

41

#### How Many Nodes

2:22

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

42

#### Recursive BFS

5:00

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

43

#### Detect Disconnects

2:41

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

44

#### DFS or BFS

0:50

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

45

#### Cycle Detection

3:49

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

46

## 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