Google | L4 | Onsite | Coding Question
Difficulty: MEDIUMCategory: InterviewExperienceFrequency: 1Asked On 2025-01-07Added By Anonymous
Source: Link
Company: Google
Role: L4
Interview Stage: Onsite
Location: unknown
Year: unknown
Original Post Content:
You have a list of trees coordinate (x, y) in a forest. You have a camera with a fixed degree (within 0 - 360) of visibility which can only be placed in origin (0, 0). You have also given with a predefined function that returns the degree of angle any tree's coordinate is making with x-axis (within 0 - 360). Return a list (of minimum size) of degrees your camera should be placed, so that it can capture all the trees.
Example1: list - [{1, 0}, {2, 1}, {3, 1}] degree of camera: 90 => ans = [0]
Example2: list - [{1, 1}, {1, -1}] degree of camera: 90 => ans = [315]