Practice

Coding Challenges

Solve Kotlin interview problems in a focused workspace with a timer and AI-powered review after every submission.

#1Easy

Two Sum

Return the indices of two numbers whose sum matches a target.

arrayhashmap
#2Easy

Valid Parentheses

Check whether a string of brackets is balanced.

stackstring
#3Easy

Merge Two Sorted Lists

Merge two sorted linked lists into one sorted list.

linked-listrecursion
#4Easy

Best Time to Buy and Sell Stock

Find the maximum profit from one buy and one sell.

arraysliding-window
#5Easy

Contains Duplicate

Detect whether any value appears at least twice.

arrayhashset
#6Medium

Product of Array Except Self

Build an output array where each index holds the product of all other elements.

arrayprefix-suffix
#7Medium

Maximum Subarray

Find the contiguous subarray with the largest sum.

arraydynamic-programming
#8Medium

Maximum Product Subarray

Find the contiguous subarray with the maximum product.

arraydynamic-programming
#9Medium

Find Minimum in Rotated Sorted Array

Find the minimum value in a rotated sorted array with unique values.

arraybinary-search
#10Medium

Search in Rotated Sorted Array

Search a target in a rotated sorted array.

arraybinary-search
#11Medium

3Sum

Find all unique triplets that sum to zero.

arraytwo-pointerssorting
#12Medium

Container With Most Water

Choose two lines that hold the most water.

arraytwo-pointers
#13Medium

Sum of Two Integers

Compute a + b without using + or -.

bit-manipulation
#14Easy

Number of 1 Bits

Count how many set bits appear in an integer.

bit-manipulation
#15Easy

Counting Bits

Return the bit count for every number from 0 to n.

bit-manipulationdynamic-programming
#16Easy

Missing Number

Find the missing number from 0..n.

arraymathbit-manipulation
#17Easy

Reverse Bits

Reverse the bit order of a 32-bit unsigned integer.

bit-manipulation
#18Easy

Climbing Stairs

Count how many ways to climb to the top taking 1 or 2 steps.

dynamic-programming
#19Medium

Coin Change

Find the minimum number of coins to reach an amount.

dynamic-programming
#20Medium

Longest Increasing Subsequence

Return the length of the longest strictly increasing subsequence.

dynamic-programmingbinary-search
#21Medium

Longest Common Subsequence

Find the length of the longest common subsequence of two strings.

dynamic-programmingstring
#22Medium

Word Break

Determine if a string can be segmented into dictionary words.

dynamic-programmingstring
#23Medium

Combination Sum

Return all combinations of candidates that sum to a target.

backtracking
#24Medium

House Robber

Maximize robbed money without taking adjacent houses.

dynamic-programming
#25Medium

House Robber II

House Robber with houses arranged in a circle.

dynamic-programming
#26Medium

Decode Ways

Count how many ways a digit string can be decoded.

dynamic-programmingstring
#27Medium

Unique Paths

Count robot paths from top-left to bottom-right in a grid.

dynamic-programminggrid
#28Medium

Jump Game

Determine if you can reach the last index.

greedyarray
#29Medium

Clone Graph

Deep-copy a connected graph.

graphdfsbfs
#30Medium

Course Schedule

Check if all courses can be completed given prerequisites.

graphtopological-sort
#31Medium

Pacific Atlantic Water Flow

Find all cells that can flow to both oceans.

graphmatrixdfsbfs
#32Medium

Number of Islands

Count how many connected land masses exist in a grid.

graphdfsmatrix
#33Medium

Longest Consecutive Sequence

Find the longest run of consecutive integers.

arrayhashset
#34Hard

Alien Dictionary

Infer a character ordering from a sorted alien dictionary.

graphtopological-sortstring
#35Medium

Graph Valid Tree

Check whether an undirected graph is a tree.

graphunion-finddfs
#36Medium

Number of Connected Components in an Undirected Graph

Count connected components in an undirected graph.

graphunion-finddfs
#37Medium

Insert Interval

Insert a new interval into sorted non-overlapping intervals.

intervals
#38Medium

Merge Intervals

Merge all overlapping intervals.

intervalssorting
#39Medium

Non-overlapping Intervals

Remove the minimum number of intervals to eliminate overlaps.

intervalsgreedy
#40Easy

Meeting Rooms

Check if a person can attend all meetings.

intervalssorting
#41Medium

Meeting Rooms II

Compute the minimum number of meeting rooms required.

intervalsheapsorting
#42Easy

Reverse Linked List

Reverse a singly linked list.

linked-list
#43Easy

Linked List Cycle

Detect whether a linked list contains a cycle.

linked-listtwo-pointers
#44Hard

Merge k Sorted Lists

Merge many sorted linked lists into one sorted list.

linked-listheapdivide-and-conquer
#45Medium

Remove Nth Node From End of List

Remove the nth node from the end in one pass.

linked-listtwo-pointers
#46Medium

Reorder List

Reorder a list by alternating front and back nodes.

linked-listtwo-pointers
#47Medium

Set Matrix Zeroes

Set rows and columns to zero when a cell is zero.

matrixarray
#48Medium

Spiral Matrix

Return matrix elements in spiral order.

matrix
#49Medium

Rotate Image

Rotate an n x n matrix 90 degrees clockwise in place.

matrix
#50Medium

Word Search

Find whether a word exists in a board by adjacent traversal.

backtrackingmatrix
#51Medium

Longest Substring Without Repeating Characters

Find the longest substring with all unique characters.

stringsliding-window
#52Medium

Longest Repeating Character Replacement

Maximize repeating characters by replacing at most k characters.

stringsliding-window
#53Hard

Minimum Window Substring

Find the smallest substring containing all target characters.

stringsliding-window
#54Easy

Valid Anagram

Check whether two strings are anagrams.

stringhashmap
#55Medium

Group Anagrams

Group words that are anagrams of each other.

stringhashmap
#56Easy

Valid Palindrome

Check if a string is a palindrome ignoring punctuation and case.

stringtwo-pointers
#57Medium

Palindromic Substrings

Count all palindromic substrings.

stringtwo-pointers
#58Medium

Longest Palindromic Substring

Find the longest palindromic substring.

stringtwo-pointers
#59Medium

Encode and Decode Strings

Encode a list of strings to one string and decode it back.

stringdesign
#60Easy

Maximum Depth of Binary Tree

Return the height of a binary tree.

treedfs
#61Easy

Same Tree

Check whether two binary trees are structurally identical.

treedfs
#62Easy

Invert Binary Tree

Swap left and right children throughout a tree.

treedfs
#63Hard

Binary Tree Maximum Path Sum

Find the maximum path sum anywhere in a binary tree.

treedfs
#64Medium

Binary Tree Level Order Traversal

Traverse a tree level by level.

treebfs
#65Hard

Serialize and Deserialize Binary Tree

Convert a binary tree to a string and back.

treedesignbfsdfs
#66Easy

Subtree of Another Tree

Check whether one tree is a subtree of another.

treedfs
#67Medium

Construct Binary Tree from Preorder and Inorder Traversal

Reconstruct a binary tree from preorder and inorder traversals.

treedfs
#68Medium

Validate Binary Search Tree

Check whether a binary tree satisfies BST rules.

treebstdfs
#69Medium

Kth Smallest Element in a BST

Find the kth smallest value in a BST.

treebstinorder
#70Easy

Lowest Common Ancestor of a Binary Search Tree

Find the lowest common ancestor of two nodes in a BST.

treebst
#71Medium

Top K Frequent Elements

Return the k most frequent elements.

heaphashmapbucket-sort
#72Hard

Find Median from Data Stream

Maintain a running median as numbers are inserted.

heapdesign
#73Medium

K Closest Points to Origin

Return the k points closest to the origin.

heapgeometry
#74Medium

Task Scheduler

Schedule tasks with cooling intervals.

heapgreedy
#75Medium

Implement Trie (Prefix Tree)

Build a trie supporting insert, search, and prefix queries.

triedesign
#76Medium

Add and Search Word

Trie with wildcard search.

triedesignbacktracking
#77Hard

Word Search II

Find all dictionary words present in a board.

triebacktrackingmatrix
#78Hard

Word Ladder

Find the shortest transformation sequence length between words.

graphbfsstring
#79Medium

Maximum XOR of Two Numbers in an Array

Find the maximum XOR value of any pair in the array.

bit-manipulationtrie
#80Medium

Find the Duplicate Number

Find the repeated number without modifying the array.

arraytwo-pointers
#81Hard

Sliding Window Maximum

Return the maximum in every window of size k.

dequesliding-window
#82Medium

Min Stack

Design a stack that can return the minimum in constant time.

stackdesign
#83Medium

Evaluate Reverse Polish Notation

Evaluate an arithmetic expression in postfix notation.

stack
#84Medium

Generate Parentheses

Generate all valid parenthesis strings of length 2n.

backtrackingstring
#85Medium

Daily Temperatures

Find how many days until a warmer temperature.

stackmonotonic-stack
#86Medium

Car Fleet

Count how many car fleets reach the target.

stacksorting
#87Hard

Largest Rectangle in Histogram

Find the largest rectangle area in a histogram.

stackmonotonic-stack
#88Medium

Search a 2D Matrix

Search for a target in a row-wise sorted matrix.

matrixbinary-search
#89Medium

Time Based Key-Value Store

Store values by timestamp and query the latest valid one.

designbinary-search
#90Hard

Median of Two Sorted Arrays

Find the median of two sorted arrays in logarithmic time.

binary-searcharray