Practise JavaScript, Python and SQL, one test at a time
Coding challenges
fix it, write it, pass it.
Fix broken code or write a function, then press "Run tests". The tests run safely in your own browser. Stuck? Ask for a hint. Sign in to save your progress, points and badges.
- 25challenges
- 4challenge types
- 420points to earn
Python and SQL run in your browser too. PHP and Laravel exercises will follow.
Debugging
The code is almost right. Find the bug, fix it and make every test pass.
Sum the numbers
A function that adds up an array returns the wrong total. Find the loop bug.
Start Easy 10 ptsThe last item
lastItem returns undefined. Fix the off-by-one error.
Start Easy 10 ptsCount the vowels
The vowel counter misses capital letters and counts too much. Fix it.
Start Medium 20 ptsFix FizzBuzz
FizzBuzz prints the wrong word for multiples of 15. Reorder the checks.
Start Medium 20 ptsRemove duplicates
unique should keep the first copy of each value in order, but it changes the input and loses items.
Start Medium 20 ptsAverage of scores
average returns NaN for some inputs and joins numbers as text for others.
StartWrite a function
Start from an empty function and write it yourself. The tests tell you when you are done.
Reverse a string
Write a function that returns the text backwards.
Start Easy 10 ptsPalindrome check
Decide if a phrase reads the same forwards and backwards, ignoring case and punctuation.
Start Easy 10 ptsTitle case
Capitalise the first letter of every word.
Start Medium 20 ptsChunk an array
Split a list into groups of a given size.
Start Medium 20 ptsGroup words by length
Build an object that maps each length to the words of that length.
Start Hard 30 ptsTwo sum
Find two positions in a list whose values add up to a target - fast.
Start Hard 30 ptsBalanced brackets
Check that every (, [ and { is closed in the right order.
StartPython
Write Python functions and run them in your browser. Nothing is installed and nothing leaves your device.
Python: greet someone
Build a greeting with an f-string.
Start Easy 10 ptsPython: keep the even numbers
Filter a list with a list comprehension.
Start Easy 10 ptsPython: count the words
Split text and count how often each word appears.
Start Easy 10 ptsPython: fix the average
An average function gives wrong answers. Find the bugs.
Start Medium 20 ptsPython: FizzBuzz
The classic interview warm-up.
Start Medium 20 ptsPython: anagram check
Do two words use exactly the same letters?
Start Hard 30 ptsPython: flatten a list
Turn nested lists into one flat list with recursion.
StartSQL
Write SELECT queries against a small practice database that lives in your browser.
SQL: customers in Delhi
Filter rows with WHERE.
Start Easy 10 ptsSQL: total of paid orders
Add numbers with SUM.
Start Medium 20 ptsSQL: orders per customer
Group rows and count them.
Start Medium 20 ptsSQL: customers with no orders
Find rows that have nothing on the other side of a join.
Start Hard 30 ptsSQL: big spenders
Filter groups with HAVING.
StartBadges to earn
Badges are worked out from your solved challenges. Sign in to collect them.
How a challenge works
- 1
Read the task
Each challenge explains what the function should do, with the tests it must pass.
- 2
Write or fix the code
Edit the code in the editor. Nothing to install: it all runs in your browser.
- 3
Run the tests
See exactly which tests pass and which fail, and fix them one by one.
- 4
Earn points and badges
Solve a challenge with fewer hints to keep more of its points.