0 day streak
Anonymous · shared experience20 Jul 2026 · 5 views

Hudson River Trading: Coordinate lit by the most street lamps

Interview question #Hudson River Trading SDE 1 Online assessment

Problem. Each street lamp has a centre c and a radius r and lights every point from c - r to c + r. Find the coordinate lit by the largest number of lamps. If several coordinates tie, return the smallest one.

Setting. The fourth of four problems in a 70-minute new grad assessment.

Approach. Turn each lamp into a +1 event at c - r and a -1 event just after c + r, sort the events, and sweep while tracking the running count. Record the first coordinate where the count hits a new maximum, taking care to process starts before ends at the same point so inclusive ranges are counted correctly.

0 comments

Comments 0

No comments yet. Ask the author something, or add what happened in your own round.