Quick Overview

Compute the smallest axis-aligned bounding rectangle for a nonempty set of two-dimensional integer points. Track minimum and maximum coordinates in one pass, then return the lower corner, width, and height without mutating the input.

Compute a Point Set's Bounding Rectangle

Company: Upstart

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: easy

Interview Round: Online Assessment

Overview: Compute the smallest axis-aligned bounding rectangle for a nonempty set of two-dimensional integer points. Track minimum and maximum coordinates in one pass, then return the lower corner, width, and height without mutating the input.

Read the full Upstart Software Engineer interview experience this question came from

Loading…