Uber I4 LeetCode leak

A fresh Uber I4 screening question circulating on social is the LeetCode hard problem 'Find the Closest Palindrome', recommended as pattern practice for advanced interviewers. Candidates aiming for higher‑level coding screens may want to add palindrome‑construction and string‑manipulation hard problems to their rotation. (x.com)

A coding question that just surfaced in an Uber interview leak is not about graphs, rides, or maps. It is LeetCode problem 564, “Find the Closest Palindrome,” a hard string problem where the input is a number written as text and the answer must be the nearest different palindrome. (x.com) (leetcode.com) A palindrome is a number like 121 or 1331 that reads the same forward and backward. This problem asks you to take a string like “123” and return “121,” because 121 is 2 away and 131 is 8 away. (leetcode.com) The trap is that the obvious solution is too slow. If you check 124, 125, 126, and keep walking outward until you hit a palindrome, you are brute-forcing one number at a time instead of constructing the answer directly. (algo.monster) (walkccc.me) The usual fast approach starts from the middle digits, because a palindrome is just one half mirrored onto the other half. If the input is “12345,” you copy the left side into the right side to get “12321,” then also try the nearby prefixes that come from adding 1 or subtracting 1 from the middle. (algo.monster) (github.com) That middle-mirroring trick still misses the ugly edge cases that make the problem hard. Inputs like “1000” can collapse to “999,” and inputs like “999” can jump to “1001,” so strong solutions also test boundary candidates built from powers of ten. (github.com) (leetcode.ca) LeetCode’s official statement adds two rules that punish sloppy implementations. You cannot return the input itself if it is already a palindrome, and if two answers are equally close, you must return the smaller one. (leetcode.com) That is why this kind of question shows up in higher-level screens. It tests whether a candidate can spot structure, reason about corner cases like “1” and “10,” and write careful string code without getting lost in off-by-one errors. (hellointerview.com) (leetcode.com) Uber’s current hiring pages describe a general process with a talent screen followed by role-specific technical interviews, and the company’s engineering careers pages span software engineer, senior software engineer, staff software engineer, and senior staff software engineer roles. The leaked post matters because it suggests at least one screen is pulling from the same hard-problem pool candidates already know from LeetCode. (jobs.uber.com 1) (jobs.uber.com 2) (x.com) For candidates, the prep signal is narrow and concrete. If you are aiming at advanced coding rounds, it is worth adding palindrome construction, numeric string manipulation, and “generate a small set of smart candidates instead of searching everything” problems to your rotation. (leetcode.com) (algo.monster)

Get your own daily briefing

Scout delivers personalized news, insights, and conversations tailored to your role and industry.

Download on the App Store

Shared from Scout - Be the smartest in the room.