25 live Coding / DSA scenarios

Coding & DSA Interview Questions

Work through algorithm and data structure problems in a runnable editor while explaining your approach out loud, the way a real coding interview runs.

Easy Scenarios

2 challenges

Medium Scenarios

20 challenges
✈️
Coding / DSA

Cheapest Route Within a Stop Limit

Given one-way routes between cities each with a cost, find the cheapest total cost from a source city to a destination city using at most k intermediate stops.

#shortest-paths#graphs
🪙
Coding / DSA

Minimum Coins to Reach an Amount

Given a set of coin denominations and a target amount, find the minimum number of coins (with unlimited supply of each denomination) needed to make exactly that amount, or report it is impossible.

#dynamic-programming#arrays
🎓
Coding / DSA

Determine a Valid Course Completion Order

Given a number of courses and a list of prerequisite pairs, determine a valid order to complete all courses, or report that no valid order exists.

#graphs#topological-sort
📈
Coding / DSA

Maximum Sum Contiguous Subarray

Find the maximum sum of a contiguous subarray within a list of integers, with follow-up discussion of returning indices and handling a streaming variant.

#dynamic-programming#arrays
🔤
Coding / DSA

Group Words by Letter Composition

Given a list of lowercase words, group together the words that share the exact same multiset of letters.

#arrays#hash-maps
🏝️
Coding / DSA

Count Connected Land Regions in a Grid

Given a 2D grid of land and water cells, count the number of distinct connected land regions, where cells are connected horizontally or vertically.

#grid-traversal#dfs/bfs
📈
Coding / DSA

Longest Strictly Increasing Subsequence

Given a sequence of integers, find the length of the longest subsequence (not necessarily contiguous) whose elements are strictly increasing.

#dynamic-programming#binary-search
🪟
Coding / DSA

Longest Run of Non-Repeating Characters

Given a string, find the length of the longest contiguous substring in which no character repeats.

#strings#sliding-window
📅
Coding / DSA

Merge Overlapping Room Bookings

Given a list of room booking intervals, each with a start and end time, merge all overlapping or touching intervals into the minimal set of consolidated bookings.

#intervals#sorting
💡
Coding / DSA

Find the Breaking Floor with Two Bulbs

Given two identical bulbs and a building with F floors, find the minimum critical floor at which a bulb breaks when dropped, while minimising the worst-case number of drops.

#math-/-combinatorics#search-strategy
🔌
Coding / DSA

Track Connectivity Across a Growing Network

Given a number of servers and a sequence of direct connection events between pairs of servers, answer whether two given servers are connected after each event, processing many union and query operations efficiently.

#union-find#disjoint-set-union
🔗
Coding / DSA

Reverse a Segment of a Linked List

Given the head of a singly linked list and two positions m and n, reverse the nodes from position m to position n in place and return the new head.

#linked-lists#pointer-manipulation
🔄
Coding / DSA

Search in a Rotated Sorted Array

Given an array of distinct integers that was originally sorted ascending and then rotated at an unknown pivot, determine the index of a target value or report that it is absent.

#binary-search#arrays
🧫
Coding / DSA

Minimum Time for Contamination to Spread

Given a grid where each cell is empty, clean, or already contaminated, find the minimum time for all clean cells to become contaminated, spreading one step per unit time to adjacent cells, or report it is impossible.

#grid-traversal#multi-source-bfs
Coding / DSA

Count Contiguous Runs Summing to a Target

Given a sequence of integers (possibly negative) and a target sum, count how many contiguous subarrays sum exactly to the target.

#arrays#hash-maps
⚖️
Coding / DSA

Partition a Set into Two Equal-Sum Groups

Given a set of distinct positive integers, determine whether it can be partitioned into two groups with equal sums, and if so, identify one valid grouping.

#backtracking#recursion
🚫
Coding / DSA

Maximize Sum with No Adjacent Elements

Given a list of integers, find the maximum sum you can obtain by choosing elements such that no two chosen elements are adjacent in the list.

#dynamic-programming#arrays
💱
Coding / DSA

Currency Conversion via Exchange Rate Graph

Given a list of direct exchange rates, find the effective conversion rate between any two currencies by multiplying rates along a path in a directed graph.

#graphs#bfs-/-dfs
🌳
Coding / DSA

Validate the Binary Search Tree Property

Given the root of a binary tree, determine whether it satisfies the binary search tree ordering property across every subtree, not just immediate parent-child pairs.

#trees#binary-search-trees
🌲
Coding / DSA

Prefix Lookup Service for a Word Dictionary

Given a dictionary of words, build a structure that can efficiently answer whether any dictionary word starts with a given prefix, and how many words share that prefix.

#tries#strings

Hard Scenarios

3 challenges