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.
No account needed. Progress and drafts are saved on this device.
All challenges
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
Validate a team handle
Validate a proposed team handle and return {valid, reason}.
Validation · Conditionals · Strings
Split a notification inbox
Given notifications with an id string and a read boolean, return {unreadIds: [...], readIds: [...]}.
Arrays · Objects · Conditionals
Group a support queue
Given tickets with an id string and status string, return an array of {status, ids} groups.
Maps · Grouping · Ordering
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
Build reliable pagination
Return {items, page, totalPages, hasNext} for a requested page of a results array.
Array slicing · Boundary conditions · Pagination
Parse a settings export
Parse an array of settings lines into [{key, value}, ...].
Parsing · Maps · Strings
Merge calendar busy windows
A calendar export contains unsorted busy windows [start, end], measured in integer minutes, with start < end.
Intervals · Sorting · Immutability
Rank a command palette
Given command objects {id, title} and a query string, return matching ids for a command palette.
Filtering · Sorting · Stable ordering
Plan a dependency build
Given modules [{id, deps}], return {order, blocked}.
Graphs · Dependency ordering · Cycle detection · Sets
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
Format a recording duration
Turn a nonnegative whole number of seconds into a string in H:MM:SS format.
Integer division · divmod · Formatted strings
Track changes between sensor readings
Return a list showing the change from each reading to the reading immediately before it: current minus previous.
Lists · Indexing · None
Choose a profile display name
A profile may contain nickname, full_name, and username.
Dictionaries · dict.get · String methods
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
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
Plan permission changes
Compare current permission names with target permission names.
Sets · Set difference · Sorting
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
Generate a product option matrix
options is a list of {"name": string, "values": [strings]} objects.
itertools.product · zip · Dictionaries
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
Resolve nested configuration overrides
Combine a list of configuration dictionaries from left to right, with later layers taking precedence.
Recursion · Dictionary merging · copy.deepcopy
Find the shortest dependency link path
links is a list of directed [from_node, to_node] pairs with string node names.
Breadth-first search · collections.deque · Sets · Tie-breaking
Choose a minimal regression test suite
tests is a list of {"id": string, "features": [strings]} objects with unique ids.
itertools.combinations · Sets · Exhaustive search · Deterministic ties
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
Find contacts missing an email
Return contacts whose email is SQL NULL, an empty string, or a string made only of ordinary space characters.
NULL · String cleanup · Aliases
Prepare a replenishment list
From inventory, return sku and units_needed for items whose stock is below reorder_level.
Computed columns · Filtering · Deterministic ordering
Find customers needing invoice follow-up
Using invoices, report customers with at least two unpaid invoices and total unpaid amount of at least 10000 cents.
Aggregates · GROUP BY · HAVING · Filtering
List production deployments for active services
Join deployments to services by service_id = services.id.
INNER JOIN · Filtering · Aliases
Include zero-ticket accounts in a support report
For every row in accounts, count support_tickets whose status is exactly "open".
LEFT JOIN · COUNT · NULL · Grouping
Audit missing security training
Return active employees who have no training_completions row for course_code "SEC-101" with passed = 1.
NOT EXISTS · Correlated subqueries · NULL
Report error rates without hiding unknown statuses
Group request_logs by service.
Conditional aggregates · NULL · Numeric division · Rounding
Find the latest check for every repository
From repository_checks, return one latest check for each repository.
Window functions · Latest per group · Tie-breaking · CTEs
Explore a manager's reporting tree
Find every direct or indirect report beneath the employee whose id is 100 in org_people.
Recursive CTEs · Hierarchies · Joins · Depth