FastPrepMinimum Time to Publish Comic Books
Problems/Minimum Time to Publish Comic Books

Minimum Time to Publish Comic Books

Nutanix logoNutanix● HardINTERNOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The screenshots show the full task from a 2021 Nutanix online test for interns. A second intern report from the same year gives the same task as text. In one step it says the printer is busy rather than free, which looks like a typo, so we used the screenshot wording.

The original reads several test cases and prints one answer for each. Here each call gets one test case, and the number of printing machines is the length of printTimes. You return the answer.

Our version is about 95% the same as the reported question.

A publisher has to produce comics comic books. It has printTimes.length printing machines and bindingMachines binding machines. Printing machine i needs printTimes[i] minutes to print all pages of one comic. Every binding machine needs bindTime minutes to bind all pages of one comic. At any moment, each machine works on the pages of at most one comic.

Each comic goes through these steps in order:

  1. A printing machine i that is free starts printing the comic.
  2. After printTimes[i] minutes, the printed pages come out of that machine.
  3. After waiting any amount of time, possibly zero, the pages go into a binding machine that is free.
  4. After bindTime minutes, the bound comic comes out and is done.

Putting pages into a machine or taking them out takes no time. All machines are free at time 0.

Return the minimum time, in minutes, by which all comics comic books can be done.

Function

minPublishTime(comics: int, bindingMachines: int, bindTime: int, printTimes: int[]) → long

Examples

Example 1

comics = 2bindingMachines = 1bindTime = 34printTimes = [1100]return = 2234

There is one printer and one binder.

  • The first comic is printed during [0, 1100] and bound during [1100, 1134].
  • The second comic is printed during [1100, 2200] and bound during [2200, 2234].

All comics are done at 2234.

Example 2

comics = 2bindingMachines = 2bindTime = 10printTimes = [10,16,1]return = 12

Printer 2 needs only 1 minute per comic, so it prints both comics: the first during [0, 1] and the second during [1, 2].

  • The first comic goes to one binder and is bound during [1, 11].
  • The second comic goes to the other binder and is bound during [2, 12].

All comics are done at 12. If printer 0 printed the second comic instead, its printing would end at 10 and its binding at 20.

Example 3

comics = 3bindingMachines = 2bindTime = 5printTimes = [5,7]return = 15
  • The first comic is printed on printer 0 during [0, 5] and bound during [5, 10].
  • The second comic is printed on printer 1 during [0, 7] and bound during [7, 12].
  • The third comic is printed on printer 0 during [5, 10] and bound during [10, 15], on the binder that the first comic freed at 10.

All comics are done at 15.

Constraints

  • 1 <= comics <= 10^6
  • 1 <= printTimes.length <= 10^5
  • 1 <= bindingMachines <= 10^9
  • 1 <= bindTime <= 10^9
  • 1 <= printTimes[i] <= 10^9

More Nutanix Online Assessment questions

  • Good SubsequencesOA · Seen Jul 2026
  • Min Cost to Connect All PointsOA · Seen Jun 2026
  • Digit Changes for a Multiple of 9OA · Seen Aug 2025
  • Gas Station Loop StartOA · Seen Aug 2025
  • Number of Players (for MTS2)OA · Seen Oct 2024
  • Work Schedules (for MTS2)OA · Seen Oct 2024
  • Minimum Operations to Convert ArrayOA · Seen Apr 2024
  • No Adjacent CharactersOA · Seen Apr 2024
  • Build a BST From a ListOA · Seen Nov 2022
  • Delete Even-Valued Nodes From a Linked ListOA · Seen Nov 2022

Similar questions at other companies

  • Initial Public OfferingPoint72 · OAPoint72 interview questions
  • Find Minimum TimeRippling · OARippling interview questions
  • Maximum Quality SumAmazon · OA
  • Minimum Days to Target EngagementTikTok · OATikTok interview questions
  • Job ExecutionSnowflake · OASnowflake interview questions
  • Maximizing Difference in Array Elements with Moves 🐹Microsoft · OAMicrosoft interview questions
  • Job ExecutionAdobe · OAAdobe interview questions
  • Find Minimum TimeAlphaSense · OA
  • Find Minimum TimeBlackRock · OABlackRock interview questions
  • Maximize Revenue from Decreasing InventoryChubb · OAChubb interview questions
All Nutanix interview questionsSee Nutanix hiring insights
Saved
class Solution {
    public long minPublishTime(int comics, int bindingMachines, int bindTime, int[] printTimes) {
        // Write your code here.
    }
}
Checking account…