FastPrepMinimum Service Cold Starts
Problems/Minimum Service Cold Starts

Minimum Service Cold Starts

InMobi logoInMobi● HardNEW GRADOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in an InMobi new grad online assessment. The report gives the goal of spreading a change across service dependencies, and the graph limits. We added how a pair points, that the spread passes through chains, how duplicates work, and the function interface. Our version is about 96% the same as the reported question.

A platform contains services numbered from 1 through serviceCount. Each dependency pair [service, dependency] means that starting dependency automatically starts service. Automatic starts continue transitively.

You may cold-start any service directly. Return the minimum number of cold starts required to start every service.

Function

minimumColdStarts(serviceCount: int, dependencies: int[][]) → int

Examples

Example 1

serviceCount = 5dependencies = [[2,1],[3,2],[5,4]]return = 2

Cold-start services 1 and 4; they transitively start 2, 3, and 5.

Example 2

serviceCount = 3dependencies = [[2,1],[3,2],[1,3]]return = 1

Every service lies in one dependency cycle, so starting any one starts all three.

Constraints

  • 1 <= serviceCount <= 100000
  • 0 <= dependencies.length <= 200000
  • Each pair contains two valid service numbers.
  • Duplicate dependency pairs may appear and do not change the answer.

Source note: Interview prompt excerpt preserved as source evidence.

More InMobi Online Assessment questions

  • Validate a Bracket SequenceOA · Seen Oct 2026
  • Count Substrings Matching with One Adjacent SwapOA · Seen Oct 2026
  • Maximum Subarray with Start and End WindowsOA · Seen Oct 2026
  • Range Maximum Subarray Sum QueriesOA · Seen Oct 2026
  • Connected Components with Divisor ThresholdOA · Seen Aug 2026
  • Maximize Impression ValueOA · Seen Aug 2026
  • Supply Path OptimizationOA · Seen Aug 2026
  • Delivery ServiceOA · Seen Jun 2026
  • Shared InterestOA · Seen Jun 2026
  • Temporal AnomaliesOA · Seen Jun 2026

Similar questions at other companies

  • Disaster RecoveryHeadlands Technologies · OAHeadlands Technologies interview questions
  • Lowest Common Ancestor with a Changing RootInfosys · OAInfosys interview questions
  • Largest Consistent Visiting GroupAuxoAI · OA
  • Minimum Tree Diameter After Removing K LeavesMathWorks · OAMathWorks interview questions
  • Sum Dynamic Weighted Tree DistancesJuspay · OA
  • Recoverable Elements from Range-Sum MeasurementsEthos Life · OA
  • Optimal TransferVisa · OAVisa interview questions
  • Divide Tree NodesGoogle · OA · ONSITE INTERVIEWGoogle interview questions
  • Evolving Merchant Clusters and Persistent PinsStripe · OAStripe interview questions
  • Alien DictionaryIntuit · OAIntuit interview questions
All InMobi interview questionsSee InMobi hiring insights
Saved
class Solution {
    public int minimumColdStarts(int serviceCount, int[][] dependencies) {
        // Write your code here.
    }

}
Checking account…