Mercury Coding Interview Questions
25 Mercury coding interview problems with full optimal solutions — 11 easy, 11 medium, 3 hard. Every problem ships with multiple approaches (brute-force first, then the optimal), complexity tables for each, company-specific tips on what an Mercury interviewer values, and a FAQ section.
Showing 11 problems of 25
- #12mediumfoundational
12. Binary Tree Level Order Traversal
Return a binary tree's nodes grouped by level from top to bottom.
- #13mediumfoundational
13. Validate Binary Search Tree
Check that a binary tree obeys the BST ordering property.
- #14mediumfoundational
14. LRU Cache
Design a cache with O(1) get and put that evicts the least recently used entry on overflow.
- #15mediumfoundational
15. Group Anagrams
Group strings into buckets where each bucket contains anagrams of each other.
- #16mediumfoundational
16. Longest Substring Without Repeating Characters
Find the length of the longest substring of a string with all distinct characters.
- #17mediumfoundational
17. 3Sum
Find all unique triplets in an array that sum to zero.
- #18mediumfoundational
18. Container With Most Water
Pick two lines that, together with the x-axis, contain the largest amount of water.
- #20mediumfoundational
20. Coin Change
Compute the fewest coins needed to make a target amount from given denominations.
- #21mediumfoundational
21. Number of Islands
Count the number of disjoint islands of '1's in a 2D grid.
- #22mediumfoundational
22. Course Schedule
Determine if all courses can be finished given a list of prerequisites.
- #24mediumfoundational
24. Top K Frequent Elements
Return the k most frequent elements from an integer array.