Skip to main content
All Questions

Maximum Number of Visible Points

Unlock detailed company stats for this questionUpgrade
You are standing at the top of a hill at a fixed position. Around you are several trees, each located at a specific (x, y) coordinate and with a certain height. You want to take a photo that captures as many trees as possible within a single frame. Given your position and the positions of the trees, write an algorithm to determine the maximum number of trees visible within a given viewing angle. Trees that lie in the same direction (same line of sight) should count as one visible tree, since nearer trees block the view of those behind them.

Community answers

No answers contributed by the community yet.

Related courses

Course

Engineering Management Interview Prep

Land your dream engineering manager role at Meta, Google, Amazon, Microsoft, Stripe, and other top companies. Learn from mock interviews, frameworks, and advice from senior candidates. Explore system design, people management, project retros, behavioral interviews, and more.

Course

System Design Interviews

Learn how to answer the latest system design questions across product, infrastructure, and AI domains. Features in-depth video examples, written breakdowns, and helpful reference patterns. Watch senior engineers and managers answer these questions in mock interview videos.