Question Bank

Pick a prompt, then start a session.

170 of 170 prompts

Add Binary Strings

Add two binary numbers represented as strings; return the binary sum as a string.

Coding / Easy

Best Time to Buy and Sell Stock (single transaction)

Given daily prices, choose one buy day and one later sell day to maximize profit (or 0 if no profit).

Coding / Easy

Binary Search (classic)

Search for a target in a sorted array and return its index (or -1) using O(log n) time.

Coding / Easy

Climbing Stairs

Count distinct ways to reach step n if you can climb 1 or 2 steps at a time.

Coding / Easy

Contains Duplicate

Determine whether any value appears at least twice in an array.

Coding / Easy

Counting Bits

For each integer 0..n, compute the number of set bits efficiently.

Coding / Easy

Fibonacci (iterative + memoized)

Compute the nth Fibonacci number with F(0)=0, F(1)=1.

Coding / Easy

First Bad Version (binary search on predicate)

Find the first index where a monotonic predicate flips from good to bad using binary search.

Coding / Easy

House Robber (linear)

Maximize money robbed from a line of houses where adjacent houses cannot both be robbed (DP).

Coding / Easy

Implement Queue using Two Stacks

Build a FIFO queue with two LIFO stacks; support enqueue/dequeue/peek (amortized O(1)).

Coding / Easy

Implement Stack using Two Queues

Build a LIFO stack with one or two FIFO queues; support push/pop/top.

Coding / Easy

Intersection of Two Arrays (with duplicates)

Compute the multiset intersection: each element appears as many times as it shows in both arrays.

Coding / Easy

Invert Binary Tree

Swap left/right children for every node in a binary tree.

Coding / Easy

Kth Largest Element in a Stream (maintain heap)

Maintain the kth largest element as new numbers arrive.

Coding / Easy

Linked List Cycle (detect)

Detect whether a linked list contains a cycle (e.g., Floyd’s tortoise/hare).

Coding / Easy

Longest Common Prefix

Given a list of strings, return the longest prefix shared by all of them.

Coding / Easy

Lowest Common Ancestor in a BST

Find the LCA of two nodes in a BST by leveraging ordering invariants.

Coding / Easy

Majority Element

Find the element occurring more than floor(n/2) times.

Coding / Easy

Maximum Depth of Binary Tree

Compute the height of a binary tree (max root-to-leaf path length).

Coding / Easy

Merge Two Sorted Lists

Merge two sorted linked lists into one sorted list.

Coding / Easy

Min Stack

Implement a stack supporting push/pop/top and retrieving the minimum element in O(1).

Coding / Easy

Move Zeroes (in-place)

Move all zeros to the end while preserving relative order of non-zero elements.

Coding / Easy

Ransom Note (char counts)

Determine if one string can be constructed from another given character counts.

Coding / Easy

Remove Duplicates from Sorted Array

In-place compress a sorted array so each unique value appears once; return the unique array (for this harness).

Coding / Easy

Reverse Linked List

Reverse a singly linked list.

Coding / Easy

Same Tree

Determine whether two binary trees are structurally identical with equal node values.

Coding / Easy

Single Number (XOR)

Find the element that appears once when all others appear twice, using XOR properties.

Coding / Easy

Two Sum (return indices)

Return indices of two numbers that add up to a target.

Coding / Easy

Valid Anagram

Determine whether two strings are anagrams (same character multiset).

Coding / Easy

Valid Parentheses

Check whether brackets are properly nested and closed (stack matching).

Coding / Easy

3Sum

Find all unique triplets that sum to zero.

Coding / Medium

Accounts Merge (DSU)

Merge user accounts that share identifiers (e.g., emails) by building connected components.

Coding / Medium

Binary Tree Level Order Traversal

Return node values level-by-level (BFS).

Coding / Medium

Clone Graph

Deep-copy a graph given a starting node, preserving adjacency (DFS/BFS with a map).

Coding / Medium

Coin Change

Given coin denominations and an amount, return the minimum number of coins (or -1 if impossible).

Coding / Medium

Combination Sum

Find all combinations that sum to a target where candidates can be reused.

Coding / Medium

Course Schedule (topological sort)

Determine if all courses can be completed given prerequisites (detect cycles via topo sort).

Coding / Medium

Daily Temperatures (monotonic stack)

For each day, compute how many days until a warmer temperature.

Coding / Medium

Decode String (stack)

Decode nested repetition encoding like k[encoded].

Coding / Medium

Find Minimum in Rotated Sorted Array

Find the minimum element in a rotated sorted array in O(log n).

Coding / Medium

Group Anagrams

Group strings that are anagrams.

Coding / Medium

Insert Interval

Insert a new interval into a list of non-overlapping sorted intervals, merging as needed.

Coding / Medium

Kth Largest Element in an Array

Find the kth largest element (heap or quickselect).

Coding / Medium

Letter Combinations of a Phone Number

Generate all strings from digit-to-letter mapping.

Coding / Medium

Longest Increasing Subsequence

Find LIS length.

Coding / Medium

Longest Palindromic Substring

Find the longest palindromic substring.

Coding / Medium

Longest Substring Without Repeating Characters

Find the longest substring with all unique characters (sliding window).

Coding / Medium

LRU Cache

Implement an LRU cache with get/put in O(1) (hash map + doubly linked list).

Coding / Medium

Lowest Common Ancestor in a Binary Tree (general)

Find LCA without BST ordering (DFS returning found status).

Coding / Medium

Merge Intervals

Merge overlapping intervals after sorting by start.

Coding / Medium

Next Greater Element II (circular)

For each element in a circular array, find the next greater element.

Coding / Medium

Non-overlapping Intervals (min removals)

Compute the minimum intervals to remove so the rest don’t overlap.

Coding / Medium

Number of Islands

Count connected components of land in a grid (DFS/BFS/Union-Find).

Coding / Medium

Pacific Atlantic Water Flow

Find cells that can flow to both oceans (multi-source BFS/DFS from borders).

Coding / Medium

Palindromic Substrings (count)

Count palindromic substrings.

Coding / Medium

Partition Equal Subset Sum

Decide if array can be partitioned into two subsets with equal sum (0/1 knapsack DP).

Coding / Medium

Permutations

Generate all permutations of distinct items.

Coding / Medium

Product of Array Except Self

For each index, return product of all other elements without division.

Coding / Medium

Rotate Image (in-place)

Rotate an n×n matrix 90° in-place.

Coding / Medium

Search in Rotated Sorted Array

Find target in rotated sorted array in O(log n) (modified binary search).

Coding / Medium

Serialize and Deserialize Binary Tree (basic)

Convert a binary tree to/from a string representation (e.g., BFS with null markers).

Coding / Medium

Set Matrix Zeroes (in-place)

If any cell is zero, set its entire row and column to zero using O(1) extra space markers.

Coding / Medium

Simplify Path

Canonicalize a Unix path handling . and .. (stack).

Coding / Medium

Sort Colors (Dutch national flag)

Sort an array with values {0,1,2} in one pass using three pointers.

Coding / Medium

Subarray Sum Equals K

Count subarrays summing to k using prefix sums + hash map.

Coding / Medium

Subsets

Generate the power set.

Coding / Medium

Top K Frequent Elements

Return the k most frequent values.

Coding / Medium

Validate Binary Search Tree

Check BST validity using bounds (min/max) or in-order traversal.

Coding / Medium

Word Break

Determine if a string can be segmented into dictionary words (DP).

Coding / Medium

Zigzag Level Order Traversal

Traverse tree levels alternating left-to-right and right-to-left.

Coding / Medium

Alien Dictionary (toposort with edge cases)

Infer character order from a sorted dictionary of words; build constraints and topologically sort.

Coding / Hard

Burst Balloons (interval DP)

Maximize coins by choosing burst order; classic interval DP on ranges.

Coding / Hard

Concurrent Rate Limiter / Token Bucket (thread-safe design + implementation)

Design and implement a token bucket with thread-safe updates and correct refill semantics.

Coding / Hard

Critical Connections in a Network (bridges / Tarjan)

Find all bridges in an undirected graph using DFS low-link values (Tarjan).

Coding / Hard

Decode Ways II (DP with wildcards)

Count decodings of a digit string that may contain * wildcards; DP with modular arithmetic.

Coding / Hard

Design In-Memory File System (trie + ops)

Implement an in-memory filesystem API (mkdir/ls/addContent/readContent) using a trie-like structure.

Coding / Hard

Distinct Subsequences

Count how many distinct subsequences of s equal t (DP on prefixes).

Coding / Hard

Edit Distance

Compute minimum insert/delete/replace operations to transform one string into another.

Coding / Hard

Find the Duplicate Number (cycle detection / binary search)

Find one duplicate in an array of n+1 integers in range 1..n without modifying array.

Coding / Hard

LFU Cache

Implement an LFU cache with get/put in near O(1) using frequency buckets + linked lists.

Coding / Hard

Largest Rectangle in Histogram

Compute largest rectangle area in a histogram using a monotonic stack.

Coding / Hard

Longest Valid Parentheses

Find length of longest well-formed parentheses substring.

Coding / Hard

Max Flow / Min Cut (implement or reason about)

Implement or reason about max flow (e.g., Dinic/Edmonds–Karp) and apply to a modeling problem.

Coding / Hard

Maximal Rectangle (in binary matrix)

Largest rectangle of 1s in a binary matrix by treating rows as histograms.

Coding / Hard

Median of Two Sorted Arrays

Find median of two sorted arrays in O(log(min(m,n))) via partitioning.

Coding / Hard

Merge K Sorted Lists

Merge k sorted linked lists (min-heap or divide-and-conquer).

Coding / Hard

Minimum Cost to Connect Sticks / Optimal Merge Pattern (heap)

Repeatedly merge smallest items to minimize total cost (min-heap greedy).

Coding / Hard

Minimum Number of Refueling Stops

Minimize stops to reach destination with stations; greedy with max-heap of fuel.

Coding / Hard

Minimum Window Substring

Find the smallest substring containing all required chars (with multiplicity) via sliding window.

Coding / Hard

N-Queens (return all solutions)

Place n queens on an n×n board so none attack each other; return all valid boards.

Coding / Hard

Palindrome Partitioning II (min cuts)

Partition a string into palindromes with minimum cuts.

Coding / Hard

Regular Expression Matching (DP)

Match a string against a pattern with . and * using DP over indices.

Coding / Hard

Reverse Nodes in k-Group

Reverse nodes of a linked list in groups of size k (in-place pointer manipulation).

Coding / Hard

Serialize/Deserialize N-ary Tree (or generic object graph)

Encode/decode a tree with variable number of children while preserving structure.

Coding / Hard

Shortest Path in Grid with Obstacles Elimination

Find shortest path in a grid where you can remove up to k obstacles.

Coding / Hard

Sliding Window Maximum

Compute max in each window of size k (deque monotonic queue).

Coding / Hard

Sudoku Solver

Solve a Sudoku by filling digits consistently (backtracking with constraints).

Coding / Hard

Trapping Rain Water

Compute trapped water between bars (two pointers or stack).

Coding / Hard

Wildcard Matching

Match string against pattern with ? (single char) and * (any sequence).

Coding / Hard

Word Ladder II (all shortest paths)

Return all shortest transformation sequences from begin to end word via one-letter changes.

Coding / Hard

Design a globally distributed URL shortener with custom domains, analytics, and abuse prevention.

System Design (Staff/Principal) / Global & Multi-region

Design a multi-region active-active service with strong consistency requirements (choose one domain).

System Design (Staff/Principal) / Global & Multi-region

Design an API gateway + auth platform (rate limiting, quotas, key management, mTLS/OAuth).

System Design (Staff/Principal) / Identity, security, and governance

Design a privacy-aware user data deletion system (GDPR “right to be forgotten”) across services.

System Design (Staff/Principal) / Identity, security, and governance

Design an experimentation (A/B testing) platform with assignment, analysis, and guardrails.

System Design (Staff/Principal) / Experimentation and product platforms

Design a feature flag system with targeting rules, gradual rollout, and auditability.

System Design (Staff/Principal) / Experimentation and product platforms

Design a collaborative document editor (Google Docs style) with conflict resolution and permissions.

System Design (Staff/Principal) / Messaging, collaboration, and user-facing systems

Design a feed ranking + serving system (home feed) with freshness, personalization, and caching.

System Design (Staff/Principal) / Messaging, collaboration, and user-facing systems

Design a real-time chat system (1:1 + groups) with delivery receipts, presence, and offline sync.

System Design (Staff/Principal) / Messaging, collaboration, and user-facing systems

Design a search autocomplete + suggestions service (latency + relevance + updates).

System Design (Staff/Principal) / Messaging, collaboration, and user-facing systems

Design a data platform for event streaming → warehouse/lake → BI, with governance and SLAs.

System Design (Staff/Principal) / Data, observability, and analytics

Design a logs ingestion + search system (indexing, retention tiers, cost controls).

System Design (Staff/Principal) / Data, observability, and analytics

Design a metrics + alerting platform (high-cardinality time series, SLOs, multi-tenant).

System Design (Staff/Principal) / Data, observability, and analytics

Design a distributed job scheduler (cron + ad-hoc), retries, idempotency, backpressure.

System Design (Staff/Principal) / Compute, workflows, and operations

Design an incident management + reliability program for a critical service (SLOs, oncall, tooling).

System Design (Staff/Principal) / Compute, workflows, and operations

Design a microservice migration plan from a monolith (strangling pattern, reliability, org/process).

System Design (Staff/Principal) / Compute, workflows, and operations

Design a large-scale notification system (push/email/SMS) with preference management and deduping.

System Design (Staff/Principal) / Notifications and payments

Design a payment processing system (idempotency, reconciliation, fraud, chargebacks).

System Design (Staff/Principal) / Notifications and payments

Design a file storage + sharing system (Drive/Dropbox) with versioning and access controls.

System Design (Staff/Principal) / Media and storage

Design a large-scale image/video upload + transcoding pipeline with moderation and CDN delivery.

System Design (Staff/Principal) / Media and storage

Tell me about a time you led without authority across multiple teams.

Behavioural (Staff/Principal) / Leadership & influence (12)

Describe a situation where you changed the direction of a project that was already underway.

Behavioural (Staff/Principal) / Leadership & influence (12)

What’s the hardest stakeholder to work with you’ve had, and how did you handle it?

Behavioural (Staff/Principal) / Leadership & influence (12)

Tell me about a time you had to align teams with conflicting priorities.

Behavioural (Staff/Principal) / Leadership & influence (12)

Describe a time you had to say “no” to leadership or a partner team.

Behavioural (Staff/Principal) / Leadership & influence (12)

When have you successfully driven adoption of a platform/tool you built?

Behavioural (Staff/Principal) / Leadership & influence (12)

Tell me about a time you mentored or grew a senior engineer.

Behavioural (Staff/Principal) / Leadership & influence (12)

Describe how you handle disagreement in technical direction at staff level.

Behavioural (Staff/Principal) / Leadership & influence (12)

Tell me about a time you influenced a roadmap to prioritize reliability/security/privacy.

Behavioural (Staff/Principal) / Leadership & influence (12)

Describe a time you took over a failing project—what did you change first?

Behavioural (Staff/Principal) / Leadership & influence (12)

Tell me about a time you created clarity in a highly ambiguous problem space.

Behavioural (Staff/Principal) / Leadership & influence (12)

Describe your approach to setting technical vision for a team/org.

Behavioural (Staff/Principal) / Leadership & influence (12)

Tell me about the best architecture decision you made—why was it right?

Behavioural (Staff/Principal) / Technical judgment & architecture (12)

Tell me about an architecture decision you regret—what did you learn?

Behavioural (Staff/Principal) / Technical judgment & architecture (12)

Describe a time you deliberately chose a “simpler” solution over a “more scalable” one.

Behavioural (Staff/Principal) / Technical judgment & architecture (12)

How do you evaluate build vs buy at staff level? Give an example.

Behavioural (Staff/Principal) / Technical judgment & architecture (12)

Tell me about a time you reduced operational complexity significantly.

Behavioural (Staff/Principal) / Technical judgment & architecture (12)

Describe a time you designed for multi-region or high availability—tradeoffs you made.

Behavioural (Staff/Principal) / Technical judgment & architecture (12)

Tell me about a time you introduced a major dependency—how did you mitigate risk?

Behavioural (Staff/Principal) / Technical judgment & architecture (12)

Describe a time you managed data consistency tradeoffs (latency vs correctness).

Behavioural (Staff/Principal) / Technical judgment & architecture (12)

Tell me about a time you improved developer velocity via platform or tooling.

Behavioural (Staff/Principal) / Technical judgment & architecture (12)

Describe a time you handled a major version migration across many services/clients.

Behavioural (Staff/Principal) / Technical judgment & architecture (12)

Tell me about a time you prevented a serious incident through design review.

Behavioural (Staff/Principal) / Technical judgment & architecture (12)

How do you balance near-term delivery with long-term architecture? Example.

Behavioural (Staff/Principal) / Technical judgment & architecture (12)

Tell me about a time you delivered a large cross-team project end-to-end.

Behavioural (Staff/Principal) / Execution, delivery, and program management (10)

Describe how you break down an ambiguous goal into milestones and ownership.

Behavioural (Staff/Principal) / Execution, delivery, and program management (10)

Tell me about a time you missed a deadline—what happened and what changed after?

Behavioural (Staff/Principal) / Execution, delivery, and program management (10)

Describe a time you managed scope creep without damaging relationships.

Behavioural (Staff/Principal) / Execution, delivery, and program management (10)

Tell me about a time you used metrics to drive execution or decision-making.

Behavioural (Staff/Principal) / Execution, delivery, and program management (10)

Describe a time you shipped an MVP quickly—how did you ensure it was safe to iterate?

Behavioural (Staff/Principal) / Execution, delivery, and program management (10)

Tell me about a time you had to make a high-stakes decision with incomplete data.

Behavioural (Staff/Principal) / Execution, delivery, and program management (10)

Describe a time you improved execution by changing process (planning, reviews, oncall, etc.).

Behavioural (Staff/Principal) / Execution, delivery, and program management (10)

Tell me about a time you handled dependencies that were outside your control.

Behavioural (Staff/Principal) / Execution, delivery, and program management (10)

Describe how you run technical reviews to keep quality high and timelines realistic.

Behavioural (Staff/Principal) / Execution, delivery, and program management (10)

Tell me about the worst production incident you’ve been involved in—what was your role?

Behavioural (Staff/Principal) / Reliability, incidents, and ops excellence (8)

Describe a time you improved an oncall experience materially (pages, runbooks, tooling).

Behavioural (Staff/Principal) / Reliability, incidents, and ops excellence (8)

Tell me about a time you established or improved SLOs/SLAs and error budgets.

Behavioural (Staff/Principal) / Reliability, incidents, and ops excellence (8)

Describe a time you identified and fixed a systemic reliability issue.

Behavioural (Staff/Principal) / Reliability, incidents, and ops excellence (8)

Tell me about a time you handled a tricky rollback or mitigation under pressure.

Behavioural (Staff/Principal) / Reliability, incidents, and ops excellence (8)

Describe a time you addressed observability gaps (logs/metrics/traces) at scale.

Behavioural (Staff/Principal) / Reliability, incidents, and ops excellence (8)

Tell me about a time you reduced cost without harming reliability or performance.

Behavioural (Staff/Principal) / Reliability, incidents, and ops excellence (8)

Describe how you decide what to automate vs what to leave manual in operations.

Behavioural (Staff/Principal) / Reliability, incidents, and ops excellence (8)

Tell me about a time you resolved conflict within or between teams.

Behavioural (Staff/Principal) / Team health, culture, and communication (8)

Describe your approach to communicating complex technical topics to non-technical audiences.

Behavioural (Staff/Principal) / Team health, culture, and communication (8)

Tell me about a time you improved engineering culture (review quality, ownership, docs, etc.).

Behavioural (Staff/Principal) / Team health, culture, and communication (8)

Describe a time you gave difficult feedback to a high-performing peer.

Behavioural (Staff/Principal) / Team health, culture, and communication (8)

Tell me about a time you received tough feedback—what did you do with it?

Behavioural (Staff/Principal) / Team health, culture, and communication (8)

Describe a time you hired/interviewed for senior roles—how did you calibrate?

Behavioural (Staff/Principal) / Team health, culture, and communication (8)

Tell me about a time you improved inclusion/accessibility in a product or process.

Behavioural (Staff/Principal) / Team health, culture, and communication (8)

What do you do when a team is burned out but expectations haven’t changed?

Behavioural (Staff/Principal) / Team health, culture, and communication (8)