PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Zipline

Compute Maximum Area Under Adjacent Bars

Last updated: May 6, 2026

Quick Overview

This question evaluates proficiency in array algorithms, range-based aggregation, and algorithmic optimization, including efficient data structure usage and complexity analysis for large inputs.

  • medium
  • Zipline
  • Coding & Algorithms
  • Software Engineer

Compute Maximum Area Under Adjacent Bars

Company: Zipline

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Onsite

You are given an array `heights` of `n` non-negative integers. Each value represents the height of a vertical bar of width `1`, and the bars are placed next to each other. Choose any contiguous range of bars. Within that range, you may form a rectangle whose height is at most the minimum bar height in the range and whose width is the number of bars in the range. Return the maximum possible rectangle area. Constraints: - `1 <= n <= 100000` - `0 <= heights[i] <= 1000000000` - The answer may require 64-bit integer arithmetic. Example: - Input: `heights = [2, 1, 5, 6, 2, 3]` - Output: `10` - Explanation: Choosing the bars with heights `5` and `6` gives height `5`, width `2`, and area `10`.

Quick Answer: This question evaluates proficiency in array algorithms, range-based aggregation, and algorithmic optimization, including efficient data structure usage and complexity analysis for large inputs.

Related Interview Questions

  • Implement a Maximum-Tracking Stack - Zipline (medium)
Zipline logo
Zipline
Jan 25, 2026, 12:00 AM
Software Engineer
Onsite
Coding & Algorithms
0
0

You are given an array heights of n non-negative integers. Each value represents the height of a vertical bar of width 1, and the bars are placed next to each other.

Choose any contiguous range of bars. Within that range, you may form a rectangle whose height is at most the minimum bar height in the range and whose width is the number of bars in the range. Return the maximum possible rectangle area.

Constraints:

  • 1 <= n <= 100000
  • 0 <= heights[i] <= 1000000000
  • The answer may require 64-bit integer arithmetic.

Example:

  • Input: heights = [2, 1, 5, 6, 2, 3]
  • Output: 10
  • Explanation: Choosing the bars with heights 5 and 6 gives height 5 , width 2 , and area 10 .

Submit Your Answer

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Zipline•More Software Engineer•Zipline Software Engineer•Zipline Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 8,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.