Two Sum is probably the most asked interview question, and it shows clearly how hashing beats brute force. Instead of trying every pair in O(n²), you remember each value seen so far and check whether its partner target - x is already there. The same idea solves any problem where you look for a complement or a matching earlier value. If the array is already sorted, two pointers from both ends also work in O(n) without extra memory.