Question Bank
Every question, one list
Sandboxed coding rounds that run against a hidden test suite, and written questions graded against a rubric — side by side, because when you are drilling a topic you want both.
Topicimplementation (105)system-design (24)hld (20)trees (11)distributed-systems (10)arrays-hashing (9)concurrency (9)graphs (9)binary-search (8)consistency (8)dp-1d (8)linked-list (8)reliability (8)storage (8)
Clear filters9 questions · browse by bank instead
- Contains DuplicateWrite `has_duplicate(nums)` that returns `True` when any value appears more than once in the list, and `False` when every value is distinct. has_duplicate([1, 2, 3, 1]) -> True has_duplicateasyCoderpad#arrays-hashing#implementation
- Two SumWrite `two_sum(nums, target)` that returns the indices of the two values summing to `target`, as a tuple `(i, j)` with `i < j`. Exactly one such pair exists. two_sum([2, 7, 11, 15], 9) -> (0, 1easyCoderpad#arrays-hashing#implementation
- Valid AnagramWrite `is_anagram(a, b)` that returns `True` when the two strings contain exactly the same characters with the same multiplicities. is_anagram("listen", "silent") -> True is_anagram("rat", easyCoderpad#arrays-hashing#implementation
- Encode and Decode StringsImplement `encode(strings)` and `decode(text)` so that `decode(encode(xs)) == xs` for any list of strings, including empty strings and strings containing any character at all. encode(["hi", "thermediumCoderpad#arrays-hashing#implementation
- Group AnagramsWrite `group_anagrams(words)` that groups the input into lists of mutual anagrams. Return a list of groups; order within a group and between groups does not matter. group_anagrams(["eat", "tea", mediumCoderpad#arrays-hashing#implementation
- Longest Consecutive SequenceWrite `longest_consecutive(nums)` returning the length of the longest run of consecutive integers present in the list. The values are unsorted and may repeat. longest_consecutive([100, 4, 200, 1,mediumCoderpad#arrays-hashing#implementation
- Product of Array Except SelfWrite `product_except_self(nums)` returning a list where each position holds the product of every other element. product_except_self([1, 2, 3, 4]) -> [24, 12, 8, 6] Division is banned, and themediumCoderpad#arrays-hashing#implementation
- Top K Frequent ElementsWrite `top_k_frequent(nums, k)` returning the `k` most frequent values, in any order. top_k_frequent([1, 1, 1, 2, 2, 3], 2) -> [1, 2] Sorting by count is O(n log n) and a size-k heap is O(n lomediumCoderpad#arrays-hashing#implementation
- Valid SudokuWrite `is_valid_sudoku(board)` for a 9x9 board given as a list of 9 lists of single-character strings, where `"."` marks an empty cell. Return `True` if no row, column, or 3x3 box contains a repeated mediumCoderpad#arrays-hashing#implementation