Hackbright Code Challenges

Intro

Intro

Welcome to the Hackbright Code Challenges book. This book collects problems that we think are appropriate for alumnae of our program that will test and reinforce the concepts taught in the Fellowship, as well as adding a few new advanced concepts.

This guide was primarily written by Joel Burton with contributions from Jennifer Griffith-Delgado, Agnes Klimaite, Henry Chen, Ahmad Alawad, Bonnie Schulkin, Meggie Mahnken, Sarah Stringer, and Lavinia Karl.

It is dedicated to all Hackbright Teaching Assistants, past and present.

We provide two kinds of challenges:

Whiteboard Problems

These are shorter, simpler problems designed to be done live at a whiteboard.

While it’s alway hard to guess how difficult a problem will be, our general rubric for whiteboard problems is:

Easier

90% of alumnae should be able to solve in under 15 minutes.

Medium

80% of alumnae should be able to solve in under 25 minutes.

Harder

50% of alumnae should be able to solve in under 25 minutes.

Code Challenges

These are problems to worked on solo or in groups over a period of time, using computers and being able to run/test their code as they go.

Our estimated difficulty for these are:

Easy

90% of alumnae should be able to solve in less than one hour.

Medium

80% of alumnae should be able to solve in less than three hours.

Hard

50% of alumnae should be able to solve in a day. (Some of these are very tricky, and would be exceptionally hard problems for Junior Developer interviews!)

All Problems

Add Linked Lists
Given two linked lists, treat as numbers and add them together.

Whiteboard Level: None
Coding Challenge Level: Harder
Concepts: Linked Lists

Add To Zero
Given list of ints, return True if any two nums in list sum to 0.

Whiteboard Level: Easier
Coding Challenge Level: None
Concepts: Loops, General

Anagram of Palindrome
Is a word an anagram of a palindrome?

Whiteboard Level: Medium
Coding Challenge Level: Easier
Concepts: Dictionaries, General

BST Add Child
Insert a new node into right place in a binary search tree.

Whiteboard Level: Harder
Coding Challenge Level: Medium
Concepts: BST, Recursion

Balanced Brackets
Does a given string have balanced pairs of brackets?

Whiteboard Level: Harder
Coding Challenge Level: Medium
Concepts: Conditionals, Loops

Balanced Parentheses
Given a string, check whether its parentheses are balanced.

Whiteboard Level: Medium
Coding Challenge Level: None
Concepts: Conditionals, Loops

Battleship!
Finish an incomplete version of the game Battleship.

Whiteboard Level: None
Coding Challenge Level: Harder
Concepts: Object Orientation, Reading Code

Binary Search
Write an optimal number guessing user binary search.

Whiteboard Level: Medium
Coding Challenge Level: Easier
Concepts: Binary Search

Binary Search Tree Validator
Check if a BST is valid.

Whiteboard Level: Harder
Coding Challenge Level: Medium
Concepts: Recursion, Trees

Boggle
Check if a word is on a Boggle board.

Whiteboard Level: None
Coding Challenge Level: Harder
Concepts: Recursion

Calculator
Build a “polish notation” calculator.

Whiteboard Level: Harder
Coding Challenge Level: Medium
Concepts: Stacks

Check Detection
Determine if a chess player is in check.

Whiteboard Level: Harder
Coding Challenge Level: Medium
Concepts: Data Structures, General

Check Tree Balance
Is this tree balanced?

Whiteboard Level: None
Coding Challenge Level: Medium
Concepts: Trees, Recursion

Circular Array
Build a circular array, a useful data structure.

Whiteboard Level: None
Coding Challenge Level: Medium
Concepts: Lists, Data Structures

Coins
Finding possibilities for making change using recursion.

Whiteboard Level: Harder
Coding Challenge Level: Medium
Concepts: Recursion

Compress a String
Compress a string with a simple compression algorithm

Whiteboard Level: Harder
Coding Challenge Level: Easier
Concepts: Strings, Loops

Concatenate Lists
Concatenate one list at the end of another.

Whiteboard Level: Easier
Coding Challenge Level: None
Concepts: Lists

Count Employees
Find number of employees in an organization chart.

Whiteboard Level: Harder
Coding Challenge Level: Medium
Concepts: Recursion, Trees

Count List Recursively
Count the number of items in a list using recursion.

Whiteboard Level: Medium
Coding Challenge Level: Easier
Concepts: Recursion

Days in Month
Given a month and a year, return how many days are in that month.

Whiteboard Level: Easier
Coding Challenge Level: None
Concepts: Conditionals, Loops

Decimal To Binary
Convert a decimal number to binary representation.

Whiteboard Level: Harder
Coding Challenge Level: Medium
Concepts: General

Decode a String
Decode a string into the original text.

Whiteboard Level: Medium
Coding Challenge Level: Easier
Concepts: Loops

Encipher a String
Encode a string using a variable Caesar Cipher

Whiteboard Level: Medium
Coding Challenge Level: Medium
Concepts: Strings, General

Find Lucky Numbers
Return n unique random numbers from a list.

Whiteboard Level: Easier
Coding Challenge Level: None
Concepts: Loops, General

Find the Range
Find the smallest and largest number in a list.

Whiteboard Level: Easier
Coding Challenge Level: None
Concepts: Lists, Loops

Fit String to Width
Print a string within a character limit

Whiteboard Level: Medium
Coding Challenge Level: Easier
Concepts: Loops

FizzBuzz
Print a series of messages of “fizz”, “buzz”, and “fizzbuzz”.

Whiteboard Level: Easier
Coding Challenge Level: None
Concepts: Loops

Friends
Find out if two friends in a graph are connected.

Whiteboard Level: Harder
Coding Challenge Level: Medium
Concepts: Graphs, Recursion

Has More Vowels
Given a word, return True if it has more vowels than consonants.

Whiteboard Level: Easier
Coding Challenge Level: None
Concepts: Loops, Conditionals

Has Unique Characters
Given a word, return True if it contains no duplicate characters.

Whiteboard Level: Easier
Coding Challenge Level: None
Concepts: Sets, Conditions

Hexadecimal Conversion
Convert a number from hexadecimal to decimal.

Whiteboard Level: Harder
Coding Challenge Level: Medium
Concepts: Math, General

Insertion Sort
Implement insertion sort, a straightforward sorting algorithm.

Whiteboard Level: Harder
Coding Challenge Level: Medium
Concepts: Sorting

Is Number Prime?
Is a number a prime number?

Whiteboard Level: Easier
Coding Challenge Level: None
Concepts: General, Math

Is Palindrome
Is a word a palindrome?

Whiteboard Level: Easier
Coding Challenge Level: None
Concepts: Loops, General

Josephus Survivors
Determine who will survive in a circle.

Whiteboard Level: Harder
Coding Challenge Level: Medium
Concepts: General, Linked Lists

Largest Smaller Than
Find largest number in nums list smaller than x.

Whiteboard Level: Easier
Coding Challenge Level: None
Concepts: Loops, Lists, Conditionals

Largest Subsequence Sum
Find the highest subsequence sum in a list.

Whiteboard Level: Harder
Coding Challenge Level: Medium
Concepts: General

Lazy Lemmings
Help our lemmings find the nearest cafe.

Whiteboard Level: Medium
Coding Challenge Level: Easier
Concepts: Loops, List, Binary Search

Leaping Lemur
Help our sprightly lemur cross the forest.

Whiteboard Level: Medium
Coding Challenge Level: Easier
Concepts: Loops, Lists

Leet Speak
Translate a string into leet speak.

Whiteboard Level: Easier
Coding Challenge Level: None
Concepts: Strings

Leveret Lunch
Help our hungry leveret find her lunch.

Whiteboard Level: Harder
Coding Challenge Level: Medium
Concepts: Loops, Lists

Longest Word
Find the longest word in a list.

Whiteboard Level: Easier
Coding Challenge Level: None
Concepts: Strings, Lists

Make Binary Search Tree
Make a balanced binary search from a list.

Whiteboard Level: None
Coding Challenge Level: Medium
Concepts: Trees, Recursion

Max Number
Implementation of max.

Whiteboard Level: Easier
Coding Challenge Level: None
Concepts: Math, Loops, Conditionals

Max Path of Triangle
What’s the high-scoring path for navigating a DAG?

Whiteboard Level: Harder
Coding Challenge Level: Medium
Concepts: Trees, Graphs

Max of Three
Given 3 integers, return the largest one.

Whiteboard Level: Easier
Coding Challenge Level: None
Concepts: Math, Conditionals

Merge Sort
Implement merge sort, a high-performance sorting algorithm.

Whiteboard Level: Harder
Coding Challenge Level: Medium
Concepts: Sorting

Minesweeper!
Complete an incomplete version of Minesweeper.

Whiteboard Level: None
Coding Challenge Level: Harder
Concepts: Object Orientation, Reading Code

Missing Number
Find the missing number in a list.

Whiteboard Level: Medium
Coding Challenge Level: Easier
Concepts: Runtime, General

Mode
Find the most frequent number in a list.

Whiteboard Level: Medium
Coding Challenge Level: None
Concepts: Lists, Loops, Math

Monkey River Crossing
Help the monkey cross the river by jumping on stones.

Whiteboard Level: Harder
Coding Challenge Level: Medium
Concepts: Logic, Lists

Most Active Period
Find the window of time when most authors were active.

Whiteboard Level: Harder
Coding Challenge Level: Medium
Concepts: Logic, Loops

Most Common Anagram
Find the most common anagram in a list of words.

Whiteboard Level: None
Coding Challenge Level: Medium
Concepts: General

Number To Word
Convert a number into words.

Whiteboard Level: None
Coding Challenge Level: Medium
Concepts: General

One Edit Away?
Are two words, at most, one edit away from each other?

Whiteboard Level: None
Coding Challenge Level: Medium
Concepts: Strings, Logic

Pangram
Return True if a sentence contains all the letters of alphabet.

Whiteboard Level: Easier
Coding Challenge Level: Easier
Concepts: Sets, Strings

Pattern Matching
Can a string match a given pattern?

Whiteboard Level: None
Coding Challenge Level: Harder
Concepts: Algorithm Design

Pig Latin
Translate text into Pig Latin.

Whiteboard Level: Easier
Coding Challenge Level: Easier
Concepts: General

Pivot Linked List
Pivot a linked list around a particular value.

Whiteboard Level: Harder
Coding Challenge Level: Medium
Concepts: Logic, Linked Lists

Poker
Evaluate a poker hand for strength.

Whiteboard Level: None
Coding Challenge Level: Harder
Concepts: Logic, Data Structures

Prime Number Generator
Generate a certain number of prime numbers.

Whiteboard Level: Harder
Coding Challenge Level: Easier
Concepts: Math, General

Print Digits Backwards
Print digits of a number on backwards order.

Whiteboard Level: Medium
Coding Challenge Level: Easier
Concepts: General, Math

Print List Recursively
Print items in a list using recursion.

Whiteboard Level: Medium
Coding Challenge Level: Easier
Concepts: Recursion

Rain in Codelandia
How much rain is gathered on buildings?

Whiteboard Level: None
Coding Challenge Level: Harder
Concepts: Logic, Loops

Recursive Index
Search a list using recursion.

Whiteboard Level: Medium
Coding Challenge Level: Easier
Concepts: Recursion

Remove Duplicates
Remove duplicates in an a list and keep order.

Whiteboard Level: Easier
Coding Challenge Level: Easier
Concepts: Lists, Sets

Remove Linked List Node
Remove a node from the start/middle of a linked list.

Whiteboard Level: Medium
Coding Challenge Level: Easier
Concepts: Linked Lists

Replace Vowels
Replace all vowels in a list of chars with star.

Whiteboard Level: Easier
Coding Challenge Level: None
Concepts: Loops, Lists

Reverse Linked List
Reverse a linked list, returning a new list.

Whiteboard Level: Medium
Coding Challenge Level: Easier
Concepts: Linked Lists

Reverse Linked List In Place
Reverse a linked list working in place.

Whiteboard Level: Harder
Coding Challenge Level: Easier
Concepts: Linked Lists

Reverse List in Place
Reverse a list, working in place.

Whiteboard Level: Easier
Coding Challenge Level: None
Concepts: Loops, Lists

Reverse Words
Reverse words in a string, preserving spaces.

Whiteboard Level: Harder
Coding Challenge Level: Medium
Concepts: Strings, Loops

Reverse a String
Reverse characters in a string without using reversed.

Whiteboard Level: Easier
Coding Challenge Level: None
Concepts: Loops, Strings

Reverse a String Recursively
Reverse characters in a string using recursion.

Whiteboard Level: Medium
Coding Challenge Level: Easier
Concepts: Recursion, Strings

Roman Numerals
Convert a decimal number into roman numerals.

Whiteboard Level: Harder
Coding Challenge Level: Medium
Concepts: General, Math

SQL Managers
Design and query a database for an organization chart.

Whiteboard Level: None
Coding Challenge Level: Medium
Concepts: SQL, Joins, Self-Joins

Same Line
Find points on lines that have 3+ points on it.

Whiteboard Level: Harder
Coding Challenge Level: Medium
Concepts: Loops, Geometry

Show Even Numbers
Show indexes of even numbers in a list.

Whiteboard Level: Easier
Coding Challenge Level: Easier
Concepts: Loops

Simple Infix Calculator
Write a calculator for simple math expressions.

Whiteboard Level: None
Coding Challenge Level: Harder
Concepts: Data Structures

Smallest Difference
Find smallest difference between numbers in lists.

Whiteboard Level: None
Coding Challenge Level: Harder
Concepts: Algorithms, Runtime

Snake Case to Camel Case
Convert string from snake_case to camelCase.

Whiteboard Level: Easier
Coding Challenge Level: None
Concepts: Strings

Sort Sorted Lists
Merge together two already-sorted lists.

Whiteboard Level: Medium
Coding Challenge Level: Easier
Concepts: Loops, Sorting

Spiral
Move in a spiral direction around a matrix.

Whiteboard Level: None
Coding Challenge Level: Harder
Concepts: Data Structures

Split Square
Design data and recursive algorithms for “split squares”.

Whiteboard Level: None
Coding Challenge Level: Harder
Concepts: Recursion, Data Structures

Split a String
Split a string on another, like the Python built-in split.

Whiteboard Level: Medium
Coding Challenge Level: Easier
Concepts: Loops, Strings

Staircase Steps
How many ways are there to climb a staircase?

Whiteboard Level: None
Coding Challenge Level: Harder
Concepts: Recursion, Dynamic Programming

Stock Prices
Find the maximum possible stock profit for a day.

Whiteboard Level: Harder
Coding Challenge Level: Medium
Concepts: Logic

Sum List
Implementation of sum.

Whiteboard Level: Easier
Coding Challenge Level: None
Concepts: Math, Loops

Sum List Recursively
Implement sum using recursion.

Whiteboard Level: Medium
Coding Challenge Level: Easier
Concepts: Recursion, Lists

Takeaway
Write an AI for a simple game.

Whiteboard Level: Harder
Coding Challenge Level: Medium
Concepts: Game Theory

Tic-Tac-Random
Complete a tic-tac-toe game with a random AI.

Whiteboard Level: None
Coding Challenge Level: Harder
Concepts: Data Structures

Time Word
Convert a time into words.

Whiteboard Level: None
Coding Challenge Level: Medium
Concepts: General

Towers of Hanoi
Solve a classic recursion problem involving stacks of disks.

Whiteboard Level: None
Coding Challenge Level: Harder
Concepts: Recursion, Stacks

Tree Cousins
Find nodes at the same level as current node.

Whiteboard Level: Harder
Coding Challenge Level: Medium
Concepts: Trees

Truncate Repeats
Truncate repeating characters in a string

Whiteboard Level: Easier
Coding Challenge Level: Easier
Concepts: Strings, Loops

Word Break
Find ways of breaking string into known words.

Whiteboard Level: Harder
Coding Challenge Level: Medium
Concepts: Recursion

Word Count
Count words in a sentence, and print in ascending order.

Whiteboard Level: Easier
Coding Challenge Level: None
Concepts: Strings, Dictionaries

Word Lengths
Find the lengths of words in a string.

Whiteboard Level: Easier
Coding Challenge Level: None
Concepts: Dictionaries, Loops

Word Prefixes and Tries
Find words with matching prefixes using trie.

Whiteboard Level: None
Coding Challenge Level: Harder
Concepts: Trees, Tries

Zero Out Matrix
Update a matrix to zero out some columns and rows.

Whiteboard Level: None
Coding Challenge Level: Medium
Concepts: Data Structures

Whiteboarding Problems

Easier

Add To Zero
Given list of ints, return True if any two nums in list sum to 0.

Concepts: Loops, General

Concatenate Lists
Concatenate one list at the end of another.

Concepts: Lists

Days in Month
Given a month and a year, return how many days are in that month.

Concepts: Conditionals, Loops

Find Lucky Numbers
Return n unique random numbers from a list.

Concepts: Loops, General

Find the Range
Find the smallest and largest number in a list.

Concepts: Lists, Loops

FizzBuzz
Print a series of messages of “fizz”, “buzz”, and “fizzbuzz”.

Concepts: Loops

Has More Vowels
Given a word, return True if it has more vowels than consonants.

Concepts: Loops, Conditionals

Has Unique Characters
Given a word, return True if it contains no duplicate characters.

Concepts: Sets, Conditions

Is Number Prime?
Is a number a prime number?

Concepts: General, Math

Is Palindrome
Is a word a palindrome?

Concepts: Loops, General

Largest Smaller Than
Find largest number in nums list smaller than x.

Concepts: Loops, Lists, Conditionals

Leet Speak
Translate a string into leet speak.

Concepts: Strings

Longest Word
Find the longest word in a list.

Concepts: Strings, Lists

Max Number
Implementation of max.

Concepts: Math, Loops, Conditionals

Max of Three
Given 3 integers, return the largest one.

Concepts: Math, Conditionals

Pangram
Return True if a sentence contains all the letters of alphabet.

Concepts: Sets, Strings

Pig Latin
Translate text into Pig Latin.

Concepts: General

Remove Duplicates
Remove duplicates in an a list and keep order.

Concepts: Lists, Sets

Replace Vowels
Replace all vowels in a list of chars with star.

Concepts: Loops, Lists

Reverse List in Place
Reverse a list, working in place.

Concepts: Loops, Lists

Reverse a String
Reverse characters in a string without using reversed.

Concepts: Loops, Strings

Show Even Numbers
Show indexes of even numbers in a list.

Concepts: Loops

Snake Case to Camel Case
Convert string from snake_case to camelCase.

Concepts: Strings

Sum List
Implementation of sum.

Concepts: Math, Loops

Truncate Repeats
Truncate repeating characters in a string

Concepts: Strings, Loops

Word Count
Count words in a sentence, and print in ascending order.

Concepts: Strings, Dictionaries

Word Lengths
Find the lengths of words in a string.

Concepts: Dictionaries, Loops

Medium

Anagram of Palindrome
Is a word an anagram of a palindrome?

Concepts: Dictionaries, General

Balanced Parentheses
Given a string, check whether its parentheses are balanced.

Concepts: Conditionals, Loops

Binary Search
Write an optimal number guessing user binary search.

Concepts: Binary Search

Count List Recursively
Count the number of items in a list using recursion.

Concepts: Recursion

Decode a String
Decode a string into the original text.

Concepts: Loops

Encipher a String
Encode a string using a variable Caesar Cipher

Concepts: Strings, General

Fit String to Width
Print a string within a character limit

Concepts: Loops

Lazy Lemmings
Help our lemmings find the nearest cafe.

Concepts: Loops, List, Binary Search

Leaping Lemur
Help our sprightly lemur cross the forest.

Concepts: Loops, Lists

Missing Number
Find the missing number in a list.

Concepts: Runtime, General

Mode
Find the most frequent number in a list.

Concepts: Lists, Loops, Math

Print Digits Backwards
Print digits of a number on backwards order.

Concepts: General, Math

Print List Recursively
Print items in a list using recursion.

Concepts: Recursion

Recursive Index
Search a list using recursion.

Concepts: Recursion

Remove Linked List Node
Remove a node from the start/middle of a linked list.

Concepts: Linked Lists

Reverse Linked List
Reverse a linked list, returning a new list.

Concepts: Linked Lists

Reverse a String Recursively
Reverse characters in a string using recursion.

Concepts: Recursion, Strings

Sort Sorted Lists
Merge together two already-sorted lists.

Concepts: Loops, Sorting

Split a String
Split a string on another, like the Python built-in split.

Concepts: Loops, Strings

Sum List Recursively
Implement sum using recursion.

Concepts: Recursion, Lists

Harder

BST Add Child
Insert a new node into right place in a binary search tree.

Concepts: BST, Recursion

Balanced Brackets
Does a given string have balanced pairs of brackets?

Concepts: Conditionals, Loops

Binary Search Tree Validator
Check if a BST is valid.

Concepts: Recursion, Trees

Calculator
Build a “polish notation” calculator.

Concepts: Stacks

Check Detection
Determine if a chess player is in check.

Concepts: Data Structures, General

Coins
Finding possibilities for making change using recursion.

Concepts: Recursion

Compress a String
Compress a string with a simple compression algorithm

Concepts: Strings, Loops

Count Employees
Find number of employees in an organization chart.

Concepts: Recursion, Trees

Decimal To Binary
Convert a decimal number to binary representation.

Concepts: General

Friends
Find out if two friends in a graph are connected.

Concepts: Graphs, Recursion

Hexadecimal Conversion
Convert a number from hexadecimal to decimal.

Concepts: Math, General

Insertion Sort
Implement insertion sort, a straightforward sorting algorithm.

Concepts: Sorting

Josephus Survivors
Determine who will survive in a circle.

Concepts: General, Linked Lists

Largest Subsequence Sum
Find the highest subsequence sum in a list.

Concepts: General

Leveret Lunch
Help our hungry leveret find her lunch.

Concepts: Loops, Lists

Max Path of Triangle
What’s the high-scoring path for navigating a DAG?

Concepts: Trees, Graphs

Merge Sort
Implement merge sort, a high-performance sorting algorithm.

Concepts: Sorting

Monkey River Crossing
Help the monkey cross the river by jumping on stones.

Concepts: Logic, Lists

Most Active Period
Find the window of time when most authors were active.

Concepts: Logic, Loops

Pivot Linked List
Pivot a linked list around a particular value.

Concepts: Logic, Linked Lists

Prime Number Generator
Generate a certain number of prime numbers.

Concepts: Math, General

Reverse Linked List In Place
Reverse a linked list working in place.

Concepts: Linked Lists

Reverse Words
Reverse words in a string, preserving spaces.

Concepts: Strings, Loops

Roman Numerals
Convert a decimal number into roman numerals.

Concepts: General, Math

Same Line
Find points on lines that have 3+ points on it.

Concepts: Loops, Geometry

Stock Prices
Find the maximum possible stock profit for a day.

Concepts: Logic

Takeaway
Write an AI for a simple game.

Concepts: Game Theory

Tree Cousins
Find nodes at the same level as current node.

Concepts: Trees

Word Break
Find ways of breaking string into known words.

Concepts: Recursion

Coding Challenge Problems

Easier

Anagram of Palindrome
Is a word an anagram of a palindrome?

Concepts: Dictionaries, General

Binary Search
Write an optimal number guessing user binary search.

Concepts: Binary Search

Compress a String
Compress a string with a simple compression algorithm

Concepts: Strings, Loops

Count List Recursively
Count the number of items in a list using recursion.

Concepts: Recursion

Decode a String
Decode a string into the original text.

Concepts: Loops

Fit String to Width
Print a string within a character limit

Concepts: Loops

Lazy Lemmings
Help our lemmings find the nearest cafe.

Concepts: Loops, List, Binary Search

Leaping Lemur
Help our sprightly lemur cross the forest.

Concepts: Loops, Lists

Missing Number
Find the missing number in a list.

Concepts: Runtime, General

Pangram
Return True if a sentence contains all the letters of alphabet.

Concepts: Sets, Strings

Pig Latin
Translate text into Pig Latin.

Concepts: General

Prime Number Generator
Generate a certain number of prime numbers.

Concepts: Math, General

Print Digits Backwards
Print digits of a number on backwards order.

Concepts: General, Math

Print List Recursively
Print items in a list using recursion.

Concepts: Recursion

Recursive Index
Search a list using recursion.

Concepts: Recursion

Remove Duplicates
Remove duplicates in an a list and keep order.

Concepts: Lists, Sets

Remove Linked List Node
Remove a node from the start/middle of a linked list.

Concepts: Linked Lists

Reverse Linked List
Reverse a linked list, returning a new list.

Concepts: Linked Lists

Reverse Linked List In Place
Reverse a linked list working in place.

Concepts: Linked Lists

Reverse a String Recursively
Reverse characters in a string using recursion.

Concepts: Recursion, Strings

Show Even Numbers
Show indexes of even numbers in a list.

Concepts: Loops

Sort Sorted Lists
Merge together two already-sorted lists.

Concepts: Loops, Sorting

Split a String
Split a string on another, like the Python built-in split.

Concepts: Loops, Strings

Sum List Recursively
Implement sum using recursion.

Concepts: Recursion, Lists

Truncate Repeats
Truncate repeating characters in a string

Concepts: Strings, Loops

Medium

BST Add Child
Insert a new node into right place in a binary search tree.

Concepts: BST, Recursion

Balanced Brackets
Does a given string have balanced pairs of brackets?

Concepts: Conditionals, Loops

Binary Search Tree Validator
Check if a BST is valid.

Concepts: Recursion, Trees

Calculator
Build a “polish notation” calculator.

Concepts: Stacks

Check Detection
Determine if a chess player is in check.

Concepts: Data Structures, General

Check Tree Balance
Is this tree balanced?

Concepts: Trees, Recursion

Circular Array
Build a circular array, a useful data structure.

Concepts: Lists, Data Structures

Coins
Finding possibilities for making change using recursion.

Concepts: Recursion

Count Employees
Find number of employees in an organization chart.

Concepts: Recursion, Trees

Decimal To Binary
Convert a decimal number to binary representation.

Concepts: General

Encipher a String
Encode a string using a variable Caesar Cipher

Concepts: Strings, General

Friends
Find out if two friends in a graph are connected.

Concepts: Graphs, Recursion

Hexadecimal Conversion
Convert a number from hexadecimal to decimal.

Concepts: Math, General

Insertion Sort
Implement insertion sort, a straightforward sorting algorithm.

Concepts: Sorting

Josephus Survivors
Determine who will survive in a circle.

Concepts: General, Linked Lists

Largest Subsequence Sum
Find the highest subsequence sum in a list.

Concepts: General

Leveret Lunch
Help our hungry leveret find her lunch.

Concepts: Loops, Lists

Make Binary Search Tree
Make a balanced binary search from a list.

Concepts: Trees, Recursion

Max Path of Triangle
What’s the high-scoring path for navigating a DAG?

Concepts: Trees, Graphs

Merge Sort
Implement merge sort, a high-performance sorting algorithm.

Concepts: Sorting

Monkey River Crossing
Help the monkey cross the river by jumping on stones.

Concepts: Logic, Lists

Most Active Period
Find the window of time when most authors were active.

Concepts: Logic, Loops

Most Common Anagram
Find the most common anagram in a list of words.

Concepts: General

Number To Word
Convert a number into words.

Concepts: General

One Edit Away?
Are two words, at most, one edit away from each other?

Concepts: Strings, Logic

Pivot Linked List
Pivot a linked list around a particular value.

Concepts: Logic, Linked Lists

Reverse Words
Reverse words in a string, preserving spaces.

Concepts: Strings, Loops

Roman Numerals
Convert a decimal number into roman numerals.

Concepts: General, Math

SQL Managers
Design and query a database for an organization chart.

Concepts: SQL, Joins, Self-Joins

Same Line
Find points on lines that have 3+ points on it.

Concepts: Loops, Geometry

Stock Prices
Find the maximum possible stock profit for a day.

Concepts: Logic

Takeaway
Write an AI for a simple game.

Concepts: Game Theory

Time Word
Convert a time into words.

Concepts: General

Tree Cousins
Find nodes at the same level as current node.

Concepts: Trees

Word Break
Find ways of breaking string into known words.

Concepts: Recursion

Zero Out Matrix
Update a matrix to zero out some columns and rows.

Concepts: Data Structures

Harder

Add Linked Lists
Given two linked lists, treat as numbers and add them together.

Concepts: Linked Lists

Battleship!
Finish an incomplete version of the game Battleship.

Concepts: Object Orientation, Reading Code

Boggle
Check if a word is on a Boggle board.

Concepts: Recursion

Minesweeper!
Complete an incomplete version of Minesweeper.

Concepts: Object Orientation, Reading Code

Pattern Matching
Can a string match a given pattern?

Concepts: Algorithm Design

Poker
Evaluate a poker hand for strength.

Concepts: Logic, Data Structures

Rain in Codelandia
How much rain is gathered on buildings?

Concepts: Logic, Loops

Simple Infix Calculator
Write a calculator for simple math expressions.

Concepts: Data Structures

Smallest Difference
Find smallest difference between numbers in lists.

Concepts: Algorithms, Runtime

Spiral
Move in a spiral direction around a matrix.

Concepts: Data Structures

Split Square
Design data and recursive algorithms for “split squares”.

Concepts: Recursion, Data Structures

Staircase Steps
How many ways are there to climb a staircase?

Concepts: Recursion, Dynamic Programming

Tic-Tac-Random
Complete a tic-tac-toe game with a random AI.

Concepts: Data Structures

Towers of Hanoi
Solve a classic recursion problem involving stacks of disks.

Concepts: Recursion, Stacks

Word Prefixes and Tries
Find words with matching prefixes using trie.

Concepts: Trees, Tries