Filter by the role you are applying for, open a question, and practise explaining the answer out loud. Mark it practised when you can.
Why they ask this: The most common warm-up problem; it checks whether you can trade memory for speed with a hash map.
Given an array of integers nums and an integer target, return the indices of the two numbers that add up to target. Assume exactly one solution exists, and…
Why they ask this: A classic dynamic programming problem that shows whether you can improve an O(n²) idea to O(n).
Given an integer array nums with at least one element, find the contiguous subarray with the largest sum and return that sum. Example 1 Example 2
Why they ask this: Checks basic use of sets or hash maps, and whether you think about preserving order.
Given an array of integers, return a new array with duplicates removed, keeping the first occurrence of each value in its original order. Try it without a…
Why they ask this: Tests recursion and how you handle data of unknown depth, which is common with JSON from APIs.
Given an array that can contain numbers and other arrays nested to any depth, return a single flat array with all the values in their original order. Example