REST API: Highest International Students
Reported by candidates from Rippling's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.
The mistake that sinks a first attempt on this Rippling OA, reported September 2026, is comparing the student counts as strings. "9,000" beats "15,075" lexicographically, and you fail hidden tests without knowing why. The task looks like a REST API problem, but the data is already handed to you in universityRecords. It's a filter, parse, and max-with-tiebreak problem over up to 100000 rows. You need to strip commas, compare numbers, break ties by name, and fall back to the second city only when the first has zero matches. StealthCoder sits invisibly on your screen as a safety net if you blank mid-assessment.
The problem
The original task retrieves every page from a global university API. For deterministic practice, all fetched records are supplied in universityRecords. Each row has exactly three fields: university: the university name city: the university city internationalStudents: a nonnegative decimal count that may contain comma separators First consider records whose city exactly equals firstCity. If at least one exists, return the university name with the largest parsed international-student count. Otherwise, perform the same selection for secondCity. If several universities in the selected city have the same maximum count, return the lexicographically smallest university name. Function highestInternationalStudents(firstCity: String, secondCity: String, universityRecords: String[][]) → String Examples Example 1 firstCity = "London" secondCity = "Boston" universityRecords = [["King's College London","London","15,075"],["University College London","London","21,500"],["Boston Tech","Boston","8,000"]] return = "University College London" London has records, so Boston is not considered. 21,500 is larger than 15,075, so University College London is returned. Example 2 firstCity = "Seattle" secondCity = "Boston" universityRecords = [["Beta University","Boston","12,000"],["Alpha University","Boston","12,000"],["Gamma College","Chicago","25,000"]] return = "Alpha University" Seattle has no record, so the search falls back to Boston. The two Boston universities tie at 12,000, and Alpha University is lexicographically smaller. Constraints For this exercise, assume 1 <= universityRecords.length <= 100000. For this exercise, assume every row has exactly three nonempty strings in the order [university, city, internationalStudents]. For this exercise, assume each parsed international-student count is between 0 and 10^9, inclusive. For this exercise, assume at least one record matches firstCity or secondCity. City matching is exact and case-sensitive.
Reported by candidates. Source: FastPrep
Pattern and pitfall
The pattern is a single pass over the array with a running best. Filter rows where city equals firstCity. If none match, rerun for secondCity. Parse the count by removing commas, then converting to a number. The max is 10^9, so use a 64-bit integer if your language needs one. Track the best count and best name. Replace the best when the count is strictly higher, or when it's equal and the name is lexicographically smaller. The pitfalls are real. Don't compare counts as strings. Don't merge both cities into one pool, because the fallback only triggers when the first city has no records at all. Don't lowercase cities, since matching is case-sensitive. You can track both cities in one loop with two best slots, then pick at the end. If you freeze on the tie rule or the fallback logic, StealthCoder can give you a working solution in the live OA.
Drill it cold or hedge it with StealthCoder. Either way, don't walk into the OA hoping you remember the trick.
You can drill REST API: Highest International Students cold, or you can hedge it. StealthCoder runs invisibly during screen share and surfaces a working solution in under 2 seconds. The proctor sees the IDE. They don't see what's behind it. Made for the candidate who got the OA invite this morning and has 72 hours, not six months.
Get StealthCoderRelated leaked OAs
You've seen the question.
Make sure you actually pass Rippling's OA.
Rippling reuses patterns across OAs. Made for the candidate who got the OA invite this morning and has 72 hours, not six months. Works on HackerRank, CodeSignal, CoderPad, and Karat.
REST API: Highest International Students FAQ
How hard is the Rippling highest international students problem really?+
Easy. It's a linear scan with string parsing and a tiebreak rule. The difficulty is in the details: comma stripping, numeric comparison, and the fallback to the second city. Most failures come from skipping one of those, not from the algorithm.
What's the trick to getting it right the first time?+
Parse counts to integers before comparing. Then handle ties by choosing the lexicographically smaller name. Only use secondCity when zero records match firstCity. Those three rules cover nearly every hidden test case.
Do I need to call a real REST API?+
No. The problem says all fetched records are supplied in universityRecords. You only write highestInternationalStudents with the given parameters. Treat it as a pure function over a 2D string array and ignore any networking.
What's the time complexity I should aim for?+
O(n) over the records, with n up to 100000. No sorting is needed. A single pass tracking the best candidate per city is enough, and the extra space is O(1) beyond the input.
How do I prepare for this in 48 hours?+
Practice array scans with a running max and custom tiebreaks. Write a small comma-stripping parse and test edge cases: ties, zero counts, only the second city matching, and counts like 1,000,000,000. Run the two examples from the prompt before submitting.