THE PRACTICE LIBRARY

Find your next coding challenge.

Write JavaScript, Python, or SQL and run real tests in your browser. Begin with a small problem, compare the results, then build up to the next challenge.

Try a beginner challengeLearn the concepts first

No account needed. Progress and drafts are saved on this device.

All challenges

34 of 34
JavaScriptIntermediate

Deduplicate issue labels

Given an array of strings, return the issue labels after trimming their edges, dropping empty labels, and removing case-insensitive duplicates.

Arrays · Sets · Normalization

Open challenge
JavaScriptIntermediate

Group a support queue

Given tickets with an id string and status string, return an array of {status, ids} groups.

Maps · Grouping · Ordering

Open challenge
JavaScriptIntermediate

Update a cart without mutation

Given an items array with unique sku strings and positive integer quantity fields, update the item matching sku.

Immutability · Arrays · Object copying

Open challenge
JavaScriptIntermediate

Build reliable pagination

Return {items, page, totalPages, hasNext} for a requested page of a results array.

Array slicing · Boundary conditions · Pagination

Open challenge
JavaScriptAdvanced

Merge calendar busy windows

A calendar export contains unsorted busy windows [start, end], measured in integer minutes, with start < end.

Intervals · Sorting · Immutability

Open challenge
JavaScriptIntermediate

Rank a command palette

Given command objects {id, title} and a query string, return matching ids for a command palette.

Filtering · Sorting · Stable ordering

Open challenge
JavaScriptAdvanced

Find the busiest event window

Given unsorted nonnegative integer event timestamps and a positive integer windowMs, find the busiest fixed-length time window.

Sliding windows · Sorting · Boundary conditions · Data analysis

Open challenge
PythonIntermediate

Map an import row to field names

Given a list of unique column-name strings and a list of values, return a dictionary that pairs each column with the value at the same position.

Dictionaries · enumerate · Positional data

Open challenge
PythonIntermediate

Read a quoted CSV export

Parse CSV text into a list of dictionaries, using the first row as field names and keeping data rows in their original order.

csv.DictReader · Standard library · Text parsing

Open challenge
PythonIntermediate

Fill missing days in an activity report

Given events of the form {"date": "YYYY-MM-DD", "count": integer}, return one {"date", "count"} dictionary for every date from start_date through end_date, inclusive and ascending.

datetime.date · timedelta · Dictionaries · Date ranges

Open challenge
PythonIntermediate

Compress consecutive status events

Given a list of status strings, replace each consecutive run of equal statuses with {"status": string, "count": integer}.

itertools.groupby · Iteration · Run-length encoding

Open challenge
SQLBeginner

Build a support priority queue

From tickets, return id, subject, and priority for tickets whose status is exactly "open" and priority is at least 3.

Filtering · Multi-column ordering · Projection

Open challenge