Practice
Practice problems and mock tests
Solve problems in JavaScript, Python and SQL, the way many companies screen developers. Every problem has example tests that you can see. It also has hidden tests that check the cases you did not think of. You see how many hidden tests passed, and not what they are.
All problems are written for Absolute Path. They are not copies of problems from other sites. You do not need an account.
How a problem works
1. Read and write
Read the problem. Write your function in the editor. Press Run to try your own calls.
2. Run all tests
The example tests show the call, the answer you should get, and the answer you got.
3. Fix the hidden tests
Hidden tests show only a count. Think about empty input, repeated values, and large values.
Problems
Showing 30 of 30 problems.
- Tidy a nameFix the spaces and the capital letters of a name.JavaScriptEasyStrings 10 min
- Count the wordsCount how often each word appears in a text.JavaScriptEasyHash mapsStrings 15 min
- Spend the whole budgetFind two items whose prices add up to the budget.JavaScriptEasyArraysHash maps 15 min
- Balanced bracketsCheck that every bracket closes in the right order.JavaScriptMediumStacksStrings 20 min
- Group the anagramsPut words that use the same letters into one group.JavaScriptMediumHash mapsStringsSorting 25 min
- Turn the pictureTurn a grid of values a quarter turn to the right.JavaScriptMediumGridsArrays 20 min
- Merge the time slotsJoin time slots that overlap or touch.JavaScriptMediumArraysSorting 25 min
- Flatten a configTurn nested objects into one object with dotted keys.JavaScriptMediumRecursionObjects 25 min
- Read a query stringTurn the part of a web address after the question mark into an object.JavaScriptMediumParsing textObjects 25 min
- The longest run of few kindsFind the longest part of a list that holds at most k different values.JavaScriptMediumSliding windowArrays 25 min
- Postage with stampsCount the ways to pay an exact amount with stamps.JavaScriptHardDynamic programming 35 min
- Shortest way outFind the fewest steps from the start to the exit of a maze.JavaScriptHardGridsArrays 40 min
- Palindrome phraseCheck if a phrase reads the same forwards and backwards.PythonEasyStringsTwo pointers 10 min
- Rotate a listMove the items of a list to the right, and wrap around.PythonEasyArraysMath 15 min
- Moving averageAverage every group of neighbouring numbers.PythonEasyArraysMath 15 min
- The most common wordsList the words that appear most often in a text.PythonMediumHash mapsSortingStrings 25 min
- Shorter textWrite each run of the same character as the character and a count.PythonMediumStrings 20 min
- Check an IPv4 addressDecide whether a text is a valid IPv4 address.PythonMediumParsing textStrings 25 min
- Reverse Polish calculatorCalculate a sum that has each operator after its numbers.PythonMediumStacksParsing text 25 min
- Climb the stairsCount the ways to climb a stair with moves of 1, 2 or 3 steps.PythonMediumDynamic programmingMath 20 min
- Count the lakesCount the separate groups of water cells on a map.PythonHardGridsRecursion 35 min
- Fewest editsCount the fewest changes that turn one word into another.PythonHardDynamic programmingStrings 40 min
- Well paid staffList the people in two teams who earn at least a given salary.SQLEasyFiltering rows 10 min
- The best way to reach a personChoose the first contact detail that exists for each person.SQLEasyMissing valuesConditional logic 15 min
- Orders per customerCount the orders of each customer, also for customers who never ordered.SQLMediumJoinsGrouping and totals 20 min
- Revenue for each monthAdd up the paid payments of each month.SQLMediumDatesGrouping and totals 20 min
- Teams above the averageFind the teams that pay more than the company average.SQLMediumGrouping and totalsSubqueries 20 min
- Running total per storeShow a running total of the sales of each store.SQLMediumWindow functions 25 min
- Top two salaries in each teamFind the best paid people of each team, and keep ties together.SQLHardWindow functions 30 min
- Who works below the headList everyone below the head of a company, with their level.SQLHardRecursive queries 30 min
Timed mock tests
A mock test gives you a few problems and a time limit, like a first-round online screening. The clock runs while you work. Hints and solutions are off. At the end you see which problems you solved.
- JavaScript warm-upThree JavaScript problems in 60 minutes. Start with an easy one, and then work on two medium ones.JavaScript 3 problems 60 minEasyMediumMediumNot started
- Python screening roundThree Python problems in 60 minutes, like the first round of a hiring process.Python 3 problems 60 minEasyMediumMediumNot started
- SQL analyst checkThree SQL problems in 60 minutes: a join, an aggregate with a subquery, and a window function.SQL 3 problems 60 minMediumMediumHardNot started