Questions › Technical PM › Top-Interview
Maximum Number of Visible Points
- Technical PM
- Top-Interview
- Easy
- 10 min
Focus on developing an algorithm that efficiently calculates the maximum number of distinct trees visible from a fixed position on the hill. Start by determining the angle of each tree relative to your position, using trigonometric functions to compute the angle based on their coordinates. Next, sort the trees by angle and iterate through them, keeping track of the maximum height encountered as you process each tree. If a tree's height is greater than the maximum height recorded for its angle, it is considered visible. Ensure your solution accounts for the specified viewing angle constraint, and discuss how you would handle edge cases, such as trees at the same angle or varying heights.
What this question tests
- Technical PM
- Structured problem solving
- Communication
- Trade-off reasoning
Practise this question under interview conditions. Answer it out loud against a timer with an AI interviewer that asks follow-ups, then review the scored report.
Related Technical PM questions
- How would you design Perplexity's system?Top-Interview · Technical PM · Hard
- What is an API and how does it work?Top-Interview · Technical PM · Hard
- Design the system architecture for WhatsApp.Top-Interview · Technical PM · Hard
- What happens when you navigate to a website?Top-Interview · Technical PM · Medium
- Design the backend architecture for Spotify.Top-Interview · Technical PM · Medium
- Design TikTok.Top-Interview · Technical PM · Medium
All Technical PM questions · Product manager interview questions by skill area