Gojek Coding Interview Questions
25 Gojek coding interview problems with full optimal solutions — 12 easy, 10 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 Gojek interviewer values, and a FAQ section.
- #1easyfoundational
1. Two Sum
Given an array of integers and a target, return indices of two numbers that add up to the target.
- #2easyfoundational
2. Valid Parentheses
Given a string containing brackets, determine if all brackets are properly closed in the correct order.
- #3easyfoundational
3. Merge Two Sorted Lists
Merge two sorted linked lists into one sorted list by splicing nodes together.
- #4easyfoundational
4. Remove Duplicates from Sorted Array
Remove duplicates in place from a sorted array and return the count of unique elements.
- #5easyfoundational
5. Remove Element
Remove all occurrences of a value in-place from an array and return the new length.
- #6easyfoundational
6. Search Insert Position
Given a sorted array and a target, return the index if found, else the index where it should be inserted.
- #7easyfoundational
7. Maximum Subarray
Find the contiguous subarray with the largest sum and return that sum.
- #8easyfoundational
8. Plus One
Increment a large integer represented as a digit array by one and return the resulting digit array.
- #9easyfoundational
9. Merge Sorted Array
Merge two sorted arrays into the first one in-place keeping the combined array sorted.
- #10easyfoundational
10. Binary Tree Inorder Traversal
Return the inorder traversal of a binary tree.
- #11easyfoundational
11. Same Tree
Decide whether two binary trees are structurally identical with matching node values.
- #12easyfoundational
12. Maximum Depth of Binary Tree
Return the maximum depth (number of nodes on the longest root-to-leaf path) of a binary tree.
- #13mediumfoundational
13. Add Two Numbers
Add two non-negative integers stored as linked lists in reverse digit order and return the sum as a list.
- #14mediumfoundational
14. Longest Substring Without Repeating Characters
Find the length of the longest substring of a string that contains no repeated characters.
- #15mediumfoundational
15. Longest Palindromic Substring
Return the longest substring of s that is a palindrome.
- #16mediumfoundational
16. Container With Most Water
Pick two vertical lines on a number line that together hold the most water and return that area.
- #17mediumfoundational
17. 3Sum
Return all unique triplets in the array that sum to zero.
- #18mediumfoundational
18. Letter Combinations of a Phone Number
Return every possible letter combination the digit string could represent on a phone keypad.
- #19mediumfoundational
19. Remove Nth Node From End of List
Remove the nth node from the end of a singly linked list in one pass.
- #20mediumfoundational
20. Generate Parentheses
Generate all combinations of n pairs of well-formed parentheses.
- #21mediumfoundational
21. Search in Rotated Sorted Array
Search for a target in a sorted array that has been rotated around some pivot, in logarithmic time.
- #22mediumfoundational
22. Permutations
Return all possible permutations of an array of distinct integers.
- #23hardfoundational
23. Median of Two Sorted Arrays
Find the median of the union of two sorted arrays in logarithmic time.
- #24hardfoundational
24. Merge K Sorted Lists
Merge k sorted linked lists into a single sorted linked list and return its head.
- #25hardfoundational
25. Trapping Rain Water
Given an elevation map, compute how much water can be trapped between the bars after raining.