FastPrepDonut Challenge
Problems/Donut Challenge

Donut Challenge

Airbnb logoAirbnb● MediumINTERNOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

A bakery is having a donut eating challenge! In order to win, you must eat all numBoxes boxes of donuts, with the i-th box having donutBoxes[i] number of donuts. To make things more difficult, the challenge has a time limit of numMinutes minutes.

Your plan is to eat d donuts per minute, but in each minute you will only eat donuts from a single box. If a box contains fewer than d donuts, you will only eat the number of donuts in that box and you will wait until the next minute to eat more donuts.

You know you can win the challenge, but you want to pace yourself. What is the smallest number of donuts d you need to eat per minute in order to eat all the donuts within the time limit?

Input Format

The first line of the input will be an integer, numBoxes, representing the total number of boxes. The following numBoxes lines of the input will be integers, representing the number of donuts in each box. The i-th line will be donutBoxes[i], the number of donuts in the i-th box. The last line of the input will be an integer, numMinutes, representing the time limit of the challenge.

Output Format

The output will be an integer, representing the smallest number of donuts (d) that you need to eat per minute in order to complete the challenge within the time limit.

Function

minDonutsPerMinute(donutBoxes: int[], numMinutes: int) → int

Examples

Example 1

donutBoxes = [4, 9, 11, 17]numMinutes = 8return = 6

:)

Constraints

  • The time limit of the challenge in minutes (numMinutes) will always be equal to, or greater than, the number of donut boxes (numBoxes).
  • There will be at least one donut to eat in each box.

More Airbnb interview questions

  • Bouncing DiagonalsOA · Seen Dec 2026
  • Count Numbers Not Equal to the First TwoOA · Seen Dec 2026
  • Garden Sprinkler PlacementOA · Seen Dec 2026
  • Theme Park Shuttle Wait TimeOA · Seen Dec 2026
  • Merge Event PreferencesPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Run-Length Encoding and DecodingPHONE SCREEN · Seen Nov 2026
  • Count Card Duel RoundsOA · Seen Nov 2026
  • Count Lamps Lighting Each PointOA · Seen Nov 2026
  • Simulate Orchard Rot SpreadOA · Seen Nov 2026
  • Sort Adjacent PairsOA · Seen Nov 2026

Similar questions at other companies

  • Minimum Non-Adjacent Selection CapabilityMicrosoft · OAMicrosoft interview questions
  • Count Pairs of Overlapping SquaresCapital One · OACapital One interview questions
  • Bank Accounts with Balance HistoryMeta · OAMeta interview questions
  • Index of the Maximum After Left RotationsChubb · OAChubb interview questions
  • Rolling MetricsAkuna Capital · OAAkuna Capital interview questions
  • Longest Increasing Price SubsequenceOpenAI · OAOpenAI interview questions
  • Linear InterpolatorTwo Sigma · OATwo Sigma interview questions
  • Rock JumpingIMC Trading · OAIMC Trading interview questions
  • Find Sum of BeautiesAmazon · OA
  • Minimum Cost to Attend Required CoursesVisa · OAVisa interview questions

Interview reports that mention this question

  • Airbnb Intern OA, Donut Challenge: 22 Experiences (Part 2 of 7)
  • Airbnb SWE Intern OA / Interviews: 122 Experiences (Part 1 of 7)

Airbnb interview experiences

  • Airbnb OA · November 2026
  • Airbnb Campus and Full-Time SWE OA / Interviews: 9 Experiences
  • Airbnb Intern Phone Interviews: 21 Experiences (Part 7 of 7)
  • Airbnb Intern OA and Phone Screens: 17 Experiences (Part 6 of 7)
All Airbnb interview questionsSee Airbnb hiring insights
Saved
class Solution {
    public int minDonutsPerMinute(int[] donutBoxes, int numMinutes) {
      // write your code here
    }

}
Checking account…