Grab Coding Interview Questions
25 Grab coding interview problems with full optimal solutions — 13 easy, 9 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 Grab interviewer values, and a FAQ section.
- #1easyfoundational
1. Two Sum
Find two numbers in an array that sum to a target — a Grab phone-screen warm-up for hash map fluency.
- #2easyfoundational
2. Valid Parentheses
Validate matched brackets using a stack — a Grab classic for testing data-structure intuition.
- #3easyfoundational
3. Merge Two Sorted Lists
Merge two sorted linked lists into one — a Grab favorite for testing pointer hygiene.
- #4easyfoundational
4. Remove Duplicates from Sorted Array
Compact a sorted array in-place — Grab uses this to probe two-pointer fluency.
- #5easyfoundational
5. Remove Element
Remove every occurrence of a value in-place — Grab uses this as a two-pointer drill.
- #6easyfoundational
6. Search Insert Position
Binary-search an insertion index in a sorted array — Grab uses this as a binary-search warmup.
- #7easyfoundational
7. Plus One
Increment a digit-array integer by one — Grab uses this to test carry-propagation handling.
- #8easyfoundational
8. Climbing Stairs
Count distinct ways to climb n stairs taking 1 or 2 steps — a Grab warm-up for DP fluency.
- #9easyfoundational
9. Best Time to Buy and Sell Stock
Find the max profit from a single buy and single sell — Grab uses this as a warm-up for one-pass scanning.
- #10easyfoundational
10. Single Number
Find the lone element in an array where every other element appears twice — Grab uses this to test bitwise fluency.
- #11easyfoundational
11. Linked List Cycle
Detect whether a linked list has a cycle — Grab uses this as a two-pointer fluency check.
- #12easyfoundational
12. Reverse Linked List
Reverse a singly linked list — Grab uses this as a pointer-manipulation warm-up.
- #13easyfoundational
13. Maximum Subarray
Find the contiguous subarray with the largest sum — Grab uses this as a Kadane's algorithm fluency check.
- #14mediumfoundational
14. Add Two Numbers
Add two linked-list digits with carry — Grab uses this to test pointer + arithmetic handling in one shot.
- #15mediumfoundational
15. Longest Substring Without Repeating Characters
Find the longest substring without repeats — Grab uses this as a sliding-window fluency check.
- #16mediumfoundational
16. Container With Most Water
Pick two lines forming the largest water container — Grab uses this as a two-pointer optimization test.
- #17mediumfoundational
17. 3Sum
Find all unique triplets that sum to zero — Grab uses this as a sort-plus-two-pointer fluency check.
- #18mediumfoundational
18. Generate Parentheses
Generate all well-formed parenthesis strings of length 2n — Grab uses this as a backtracking fluency check.
- #19mediumfoundational
19. Permutations
Return all permutations of a distinct-element array — Grab uses this as a backtracking and state-tracking check.
- #20mediumfoundational
20. Group Anagrams
Bucket strings that are anagrams of one another — Grab uses this to test hash-key selection.
- #21mediumfoundational
21. Merge Intervals
Merge overlapping intervals — Grab uses this as a sort-plus-sweep classic for scheduling problems.
- #22mediumfoundational
22. Word Break
Decide whether a string can be segmented into dictionary words — Grab uses this as a DP-on-strings warm-up.
- #23hardfoundational
23. Median of Two Sorted Arrays
Find the median of two sorted arrays in O(log) time — Grab uses this as a binary-search-on-answer signal.
- #24hardfoundational
24. Trapping Rain Water
Compute how much water an elevation map traps — Grab uses this as a two-pointer optimization signal.
- #25hardfoundational
25. Merge k Sorted Lists
Merge k sorted linked lists into one — Grab uses this to test heap + divide-conquer fluency.