Available question text
Given an integer array and a target value, find the element in the array that is closest to the target (minimum absolute difference). If two elements are equally close to the target, return the larger of the two. Example: arr = [3, 11, 13, 23, 65, 22], target = 12 → output 13 (both 11 and 13 are distance 1 away, but 13 is larger).
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
Walmart
Find the Closest Element to a Target in an Array
Reported Jul 17, 2026 · 1 source report
SENIOR
Source snapshot: Nov 12, 2026
View source