FastPrepFind Minimum Time
Problems/Find Minimum Time

Find Minimum Time

Rippling logoRippling● HardNEW GRADFULLTIMEOA

Updated Nov 2026

QuestionFunctionExamples

Problem statement

Source note: 🐣 2026-07-18. One displayed source image renders Sample 2 capacity as [4,1,4], which cannot process the task of size 6. This version uses [4,7,4], matching the complete sample input and output 3.

There are n processes to execute. Process i has size processSize[i]. There are m processors, and processor i has capacity capacity[i].

A processor completes a process whose size is at most its capacity in 1 second. It cannot execute a process whose size exceeds its capacity.

A processor may execute multiple processes one after another, but it must pause for 1 second after completing a process before starting its next one. Different processors may work simultaneously.

Return the minimum time needed to execute every process, or -1 if completing all processes is impossible.

Function

findMinimumTime(processSize: int[], capacity: int[]) → int

Examples

Example 1

processSize = [2, 5, 3]capacity = [6, 2, 4]return = 1

The optimal assignment gives:

  • The first processor the second process
  • The second processor the first process
  • The third processor the third process

All three processors work simultaneously and finish in 1 second.

Example 2

processSize = [1, 2, 3, 4, 6]capacity = [4, 7, 4]return = 3

Assign process sizes 2 and 3 to the first processor, sizes 1 and 6 to the second processor, and size 4 to the third processor. Each processor with two processes works for 1 second, pauses for 1 second, and works for 1 more second. Therefore, all processes finish in 3 seconds.

Example 3

processSize = [2, 5, 8]capacity = [6, 7, 4]return = -1

No processor has enough capacity for the process of size 8, so completing every process is impossible.

More Rippling interview questions

  • Filter, Sort, and Deduplicate Scheduled TasksPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Stateful Log Transform and SearchPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Dependency-Aware Task SchedulerPHONE SCREEN · Seen Nov 2026
  • Delivery Cost Tracker with Effective-Dated RatesPHONE SCREEN · Seen Nov 2026
  • Most Segments That Sort the ArrayOA · Seen Nov 2026
  • Palindromic Paths to the RootOA · Seen Nov 2026
  • Server InvestmentOA · Seen Nov 2026
  • Camel CardsPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Best and Worst Camel Card CompletionsPHONE SCREEN · Seen Nov 2026
  • Corporate Card Expense RulesOA · PHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026

Similar questions at other companies

  • Minimum Days to Target EngagementTikTok · OA
  • Job ExecutionSnowflake · OA
  • Maximizing Difference in Array Elements with Moves 🐹Microsoft · OA
  • Job ExecutionAdobe · OA
  • Minimum Time to Publish Comic BooksNutanix · OA
  • Find Minimum TimeAlphaSense · OA
  • Find Minimum TimeBlackRock · OA
  • Minimize Maximum Group DifferenceDRW · OA
  • Minimum-Cost Solar Rooftop AllocationDeloitte · OA
  • K-Means ClusteringFortinet · OA
See Rippling hiring insights
Saved
class Solution {
    public int findMinimumTime(int[] processSize, int[] capacity) {
      // write your code here
    }

}
Checking account…