Ramp Coding Interview Questions
26 Ramp coding interview problems with full optimal solutions — 12 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 Ramp interviewer values, and a FAQ section.
Showing 26 problems of 26
- #1easyfoundational
1. Two Sum
Given an array of integers and a target, return indices of two numbers that add to the target.
- #2easyfoundational
2. Valid Parentheses
Determine if a string of brackets is valid (every open has a matching close in the right 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
In-place dedupe a sorted array; return the new length.
- #5easyfoundational
5. Remove Element
In-place remove all occurrences of a value from an array; return the new length.
- #6easyfoundational
6. Search Insert Position
Given a sorted array and a target, return the index it would be inserted at to keep order.
- #7easyfoundational
7. Plus One
Increment a number represented as a digit array by one.
- #8easyfoundational
8. Merge Sorted Array
Merge two sorted integer arrays in-place into the first.
- #9easyfoundational
9. Best Time to Buy and Sell Stock
Maximize profit from a single buy and a single sell across a price series.
- #10easyfoundational
10. Single Number
Find the one element that appears exactly once when every other element appears twice.
- #11easyfoundational
11. Linked List Cycle
Detect whether a singly linked list contains a cycle.
- #12easyfoundational
12. Contains Duplicate
Determine whether any value appears at least twice in an array.
- #13mediumfoundational
13. Add Two Numbers
Add two numbers whose digits are stored in reverse-order linked lists.
- #14mediumfoundational
14. Longest Substring Without Repeating Characters
Find the length of the longest substring with all unique characters.
- #15mediumfoundational
15. Container With Most Water
Find two heights that hold the largest area of water.
- #16mediumfoundational
16. 3Sum
Find all unique triplets in the array that sum to zero.
- #17mediumfoundational
17. Generate Parentheses
Generate all combinations of well-formed parentheses for n pairs.
- #18mediumfoundational
18. Permutations
Return all possible orderings of distinct integers.
- #19mediumfoundational
19. Group Anagrams
Bucket strings that are anagrams of each other together.
- #20mediumfoundational
20. Merge Intervals
Collapse a list of intervals into the minimum set of non-overlapping intervals.
- #21mediumfoundational
21. Unique Paths
Count distinct paths in an m x n grid moving only right or down.
- #22mediumfoundational
22. Word Search
Determine if a word exists in a grid following adjacent cell moves.
- #23mediumfoundational
23. LRU Cache
Design a data structure with O(1) get and put plus least-recently-used eviction.
- #24hardfoundational
24. Median of Two Sorted Arrays
Find the median of two sorted arrays in logarithmic time.
- #25hardfoundational
25. Merge k Sorted Lists
Merge k sorted linked lists into one sorted linked list.
- #26hardfoundational
26. Trapping Rain Water
Compute the total water trapped between bars of varying heights.