EXPLAIN YOUR THINKING
Prepare with purpose.
Browse questions by experience level. Open the workspace for language and category filters, bookmarks and timed practice.
Open question explorer →Fresher / Entry-Level
Two Sum
Given an array of integers nums and an integer target, return the indices of two distinct elements that add up to target. Return an empty array if there is no solution. Return the
20 min · Coding challenge →JavaScript · Stacks & queuesValid Parentheses
Given a string containing only (), {}, and [], determine whether every opening bracket is closed in the correct order. The empty string is valid.
15 min · Coding challenge →JavaScript · Arrays & hashingRemove Duplicate Values
Return the unique numbers from an array in their original order. Do not mutate the input.
10 min · Coding challenge →Python · Language conceptsGenerators vs. Lists
Compare a list comprehension with a generator when processing a large file. Explain iteration, laziness, and resource lifetime.
15 min · Discussion →Java · Language conceptsEquals and HashCode Contract
Explain the equals/hashCode contract. Describe what happens when a key changes after insertion into a HashMap.
15 min · Discussion →JavaScript · Binary searchBinary Search · Find a Sorted Value
Given strictly increasing integers, return the index of target or -1. Do not mutate the array. Explain why each comparison can discard half of the remaining interval.
25 min · Coding challenge →JavaScript · Two pointersPalindrome · Compare from Both Ends
For an ASCII string, ignore non-alphanumeric characters and case. Return whether the remaining characters read the same in both directions. An empty normalized string is a palindro
25 min · Coding challenge →JavaScript · Arrays & hashingBest Single Buy and Sell
Return the maximum profit from buying once and selling on a later day. Return 0 if no positive profit exists. Prices are nonnegative integers; leave the input unchanged.
25 min · Coding challenge →JavaScript · TreesMaximum Depth of a Binary Tree
A node is {value, left, right}; missing children are null. Return the number of nodes on the longest root-to-leaf path. An empty tree has depth 0. The input is a finite tree with n
25 min · Coding challenge →JavaScript · Linked listsReverse a Singly Linked List
Nodes have shape {value, next}; the final next is null. Return a reversed list using new nodes and preserve the original list. Values are numbers and the input has no cycles.
25 min · Coding challenge →Mid-Level
Explain the Event Loop
Predict the order of synchronous code, promise microtasks, and timers. Explain why a long-running callback can delay every timer.
20 min · Discussion →TypeScript · Language conceptsModel API States with Unions
Model idle, loading, success, and error states with a discriminated union. Prevent impossible combinations and exhaustively render each state.
20 min · Discussion →C# · ConcurrencyAsync, Await & Cancellation
Design an asynchronous HTTP operation that propagates cancellation, handles failures, and avoids blocking the request thread.
25 min · Discussion →Go · ConcurrencyDesign a Bounded Worker Pool
Design a worker pool with bounded concurrency, cancellation, error handling, and a clear channel ownership model.
30 min · Discussion →Rust · ConcurrencyOwnership Across Threads
Explain when to use Arc, Mutex, and message passing to share data safely across threads. Discuss deadlock and lock scope.
25 min · Discussion →SQL · DatabasesDiagnose a Slow SQL Query
An orders query filters by customer_id, sorts by created_at DESC, and returns 20 rows. Propose an index and describe how to verify it.
25 min · Discussion →JavaScript · AlgorithmsFind the longest unique-character window
Return the maximum number of distinct consecutive Unicode code points in the input string.
25 min · Coding challenge →TypeScript · Language conceptsValidate untrusted JSON at the boundary
Accept unknown input. Return {ok:true,value:{name,age}} only for a non-array object whose name trims to nonempty text and age is an integer from 0 through 130. Otherwise return {ok
25 min · Coding challenge →Python · AlgorithmsRank frequent events with a bounded heap
Input {words:list[str],k:nonnegative integer}. Return up to k unique words by descending frequency, breaking ties alphabetically.
30 min · Coding challenge →SQL · DatabasesKeep every row tied for first place
Return id, customer, amount for every sale tied for the largest non-null amount within its customer. Order by customer then id.
25 min · Coding challenge →JavaScript · Sliding windowLongest Substring without Repeats
Return the length of the longest contiguous substring with no repeated characters. Input is ASCII; the empty string returns 0. Describe what makes your current window valid.
25 min · Coding challenge →JavaScript · Prefix sumsCount Subarrays with a Target Sum
Count nonempty contiguous subarrays whose sum equals target. Numbers may be negative or zero. Input values and all sums fit within JavaScript safe integers. Do not mutate input.
25 min · Coding challenge →JavaScript · Sorting & intervalsMerge Overlapping Intervals
Merge closed numeric intervals [start, end], where start <= end. Touching endpoints overlap. Return intervals sorted by start and do not mutate any input array.
25 min · Coding challenge →JavaScript · Stacks & queuesDays until a Warmer Temperature
For each daily temperature return the number of days until a strictly warmer temperature. Use 0 if there is no warmer future day. Equal temperatures do not qualify.
25 min · Coding challenge →JavaScript · GraphsShortest Path in an Unweighted Graph
graph is an adjacency list indexed 0..n-1; each entry contains valid neighbor indices. Return the fewest directed edges from start to target, or -1 if unreachable. Start and target
25 min · Coding challenge →JavaScript · Dynamic programmingFewest Coins for an Amount
Given distinct positive integer coin values and an amount from 0 to 50, return the minimum coin count using unlimited copies, or -1 when impossible. A greedy choice is not always o
25 min · Coding challenge →Advanced / Senior / Staff
Design a URL Shortener
Design a globally available URL shortener. Cover requirements, capacity estimates, identifiers, storage, caching, abuse controls, and failure modes.
45 min · Discussion →Java · System designHandle a Cache Stampede
A popular cache key expires and overwhelms the database. Design protections for hot keys, concurrent refresh, and cache failures.
35 min · Discussion →Python · Production debuggingDebug a Latency Regression
After a deployment, p99 latency triples while p50 stays stable. Outline a safe investigation and mitigation using metrics, traces, logs, and controlled rollback.
40 min · Discussion →JavaScript · Two pointersTrapping Rain Water
Given nonnegative integer bar heights of unit width, return the total trapped water. Empty input traps 0. Explain why the smaller boundary determines a safe amount to accumulate.
35 min · Coding challenge →