FastPrepMinimize the Maximum Pages Allocated
Problems/Minimize the Maximum Pages Allocated

Minimize the Maximum Pages Allocated

Google logoGoogle● MediumINTERNPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The report names the Page Allocation problem and its binary-search solution, but leaves out the full statement and the limits. Our version is about 85% the same as the reported question.

You are given an integer array pages, where pages[i] is the number of pages in the i-th book. The books are arranged in their original order.

Allocate every book to exactly students students under these rules:

  • Each student must receive at least one book.
  • Each student receives one contiguous segment of books.
  • The order of the books cannot change.

The load of a student is the total number of pages in that student's segment. Return the minimum possible value of the maximum student load.

If there are more students than books, return -1.

Function

minimizeMaximumPages(pages: int[], students: int) → long

Examples

Example 1

pages = [12,34,67,90]students = 2return = 113

Allocate books [12,34,67] to the first student and [90] to the second. Their loads are 113 and 90, so the maximum load is 113. No valid allocation has a smaller maximum.

Example 2

pages = [10,20,30,40]students = 2return = 60

The allocation [10,20,30] and [40] has loads 60 and 40. Every other split produces a maximum load of at least 60.

Example 3

pages = [5,10,15]students = 4return = -1

There are more students than books, so it is impossible to give every student a non-empty segment.

Constraints

  • 1 <= pages.length <= 10^5
  • 1 <= pages[i] <= 10^9
  • 1 <= students <= 10^5

More Google Phone Screen questions

  • Best Stock Trade with Buy and Sell DaysPHONE SCREEN · Seen Nov 2026
  • Word Chain Jumps in a GridPHONE SCREEN · Seen Nov 2026
  • Dice-Walk Winning ProbabilityPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Lowest Common Ancestor in an N-ary TreePHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Apartment Housemate PreferencesPHONE SCREEN · Seen Nov 2026
  • Price at Query TimestampsPHONE SCREEN · Seen Nov 2026
  • Course Schedule Cycle DetectionPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Logger Rate Limiter with Every-Arrival HistoryPHONE SCREEN · Seen Nov 2026
  • Minimum Total Layover WaitPHONE SCREEN · Seen Nov 2026
  • Reach a Destination Through Scheduled FlightsPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026

Similar questions at other companies

  • Aggressive CowsAmazon · PHONE SCREEN
  • Maximize the Minimum Cone DistanceSumo Logic · PHONE SCREEN
  • Split Array to Minimize the Largest SumNation with NaMo · PHONE SCREEN
  • Maximize Fish over Limited HoursByteDance · PHONE SCREENByteDance interview questions
  • Minimize the Largest Part BeautyAdobe · PHONE SCREENAdobe interview questions
  • Capacity to Ship Packages Within DaysMicrosoft · OA · ONSITE INTERVIEWMicrosoft interview questions
  • Minimum Daily Printing LimitAgoda · ONSITE INTERVIEWAgoda interview questions
  • Minimize the Longest Hike Between Rest StopsPinterest · ONSITE INTERVIEWPinterest interview questions
  • Rock JumpingIMC Trading · OAIMC Trading interview questions
  • Minimize Maximum Pilot WorkloadSpotnana · ONSITE INTERVIEWSpotnana interview questions

Interview reports that mention this question

  • Google SWE Intern OA and Interviews: 42 Experiences (Part 1 of 3)

Google interview experiences

  • Google L4 SWE Phone Screen: 1 Experience
  • Google ML Engineering Manager Onsite: 1 Experience
  • Google Experienced SWE First Round and Onsite: 1 Experience
  • Google AI Coding Interview and AI OA: 2 Experiences
  • Google SWE Intern Interview Results Timeline: 13 Experiences
All Google interview questionsSee Google hiring insights
Saved
class Solution {
    public long minimizeMaximumPages(int[] pages, int students) {
        // write your code here
    }
}
Checking account…