Meta SWE Interview - 2021 November | Sweep Line Algorithm & Heaps | Off-campus

Question · Posted Jun 2026

Question 1: The Skyline Problem Problem Statement A city's skyline is the outer contour of the silhouette formed by all the buildings in that city when viewed from a distance. You are given the locations and heights of all the buildings, where buildings[i] = [left_i, right_i, height_i]. The buildings are solid rectangles resting on the ground (y=0). Return the skyline formed by these buildings collectively. The skyline should be represented as a list of "key points" [[x1, y1], [x2, y2], ...

The full answer & interview discussion are available to premium members.

Log in Create a free account