Reported February 2024
Meta

Closest Landmark

Reported by candidates from Meta's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.

Get StealthCoderRuns invisibly during the live Meta OA. Under 2s to a working solution.
Founder's read

Meta's Closest Landmark question hit assessments in February 2024, and it's testing your ability to handle spatial logic under pressure. You're likely dealing with coordinate geometry or distance calculations, which sounds simple until you're staring at the problem cold and your brain stalls on edge cases. StealthCoder sits invisible during your OA and feeds you the pattern in real time, so you're never stuck guessing whether to use Euclidean distance, Manhattan distance, or some custom metric the problem defines.

Pattern and pitfall

This problem revolves around finding the nearest point or landmark in a dataset relative to a query position. The pattern typically involves either brute-force distance calculation with a sorted result, or spatial indexing if the dataset is large. Common pitfalls: candidates forget to handle ties (multiple landmarks at the same distance), misread the distance formula, or fail to consider negative coordinates. The trick is almost always in the distance metric itself. Read the problem statement three times to confirm whether it's Euclidean (square root of sum of squared differences), Manhattan (sum of absolute differences), or something custom. StealthCoder will parse the exact definition from the screen and surface the right formula, so you avoid the derailment that costs most candidates here.

StealthCoder is the hedge for the one pattern you didn't drill. It runs invisibly during the screen share.

If this hits your live OA

You can drill Closest Landmark 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. If you're reading this with an OA window open, you're who this was built for.

Get StealthCoder

Related leaked OAs

⏵ The honest play

You've seen the question. Make sure you actually pass Meta's OA.

Meta reuses patterns across OAs. If you're reading this with an OA window open, you're who this was built for. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Closest Landmark FAQ

What distance formula does Meta usually ask for?+

It depends on the exact problem text, but Euclidean distance is most common for 'landmark' problems. Always confirm in the problem statement itself. If it says 'closest' without specifying, assume Euclidean. Manhattan distance is less common but still appears.

How do I handle ties if two landmarks are equidistant?+

The problem will specify tiebreaker logic, often by lexicographic order, by landmark ID, or by a secondary attribute. Don't assume. Skim the problem for 'in case of a tie' or 'if distance is equal'. That clause is always there.

Is this a brute-force or advanced data structure question?+

Brute-force (iterate all landmarks, compute distance, return min) will pass most constraint sizes. Only optimize to KD-tree or similar if the problem explicitly states 'multiple queries' and large datasets. Meta usually accepts the simpler approach.

Should I precompute distances or calculate on demand?+

For a single query, calculate on demand. For multiple queries on a static landmark set, precompute and sort once, then answer queries in O(1). The problem will hint at this. Read the input format carefully.

Can I skip negative coordinates or edge case testing?+

No. Landmarks can be in any quadrant. Test with negative x, negative y, origin (0,0), and identical coordinates. Off-by-one errors and sign mistakes are the killers here.

Problem reported by candidates from a real Online Assessment. Sourced from a publicly-available candidate-aggregated repository. Not affiliated with Meta.

OA at Meta?
Invisible during screen share
Get it