FastPrepStable Robot Configurations
Problems/Stable Robot Configurations

Stable Robot Configurations

Amazon logoAmazon● MediumINTERNNEW GRADOA

Updated Nov 2026

QuestionFunctionExamples

Problem statement

In Amazon's warehouse robotics system, multiple robots operate simultaneously to transport packages efficiently. Each robot can be in one of two states: Standby or Operating.

For smooth coordination, each robot i has a predefined coordination threshold, coordinationThreshold[i]. This threshold determines the conditions under which a robot malfunctions:

  • A robot i malfunctions if it is in the Operating state but the total number of other robots in the Operating state is less than coordinationThreshold[i].
  • A robot i malfunctions if it is in the Standby state but the total number of robots in the Operating state is greater than or equal to coordinationThreshold[i].

If any robot malfunctions, the system is considered unstable. Return the total number of distinct valid configurations where no robot malfunctions.

A configuration is an assignment of each of the n robots to either Operating or Standby. A configuration is considered valid if no robot malfunctions under that arrangement. Two configurations are distinct if at least one robot is in a different state.

Function

countStableConfigurations(coordinationThreshold: int[]) → int

Examples

Example 1

coordinationThreshold = [6, 0, 3, 3, 6, 7, 2, 7]return = 3

There are three valid ways to select robots to be in the Operating state. Two of them are:

  1. Only the robot at index 1 is Operating. Its threshold is 0, so it has at least 0 other operating robots. All other robots remain in Standby, and their thresholds exceed the one operating robot.
  2. Robots at indices 1, 2, 3, and 6 are Operating, with threshold values 0, 3, 3, and 2. Each operating robot has at least its threshold number of other operating robots, and every standby robot has fewer operating robots than its threshold.

So the total number of valid configurations is 3.

More Amazon Online Assessment questions

  • Get Smallest Base SegmentOA · Seen Nov 2026
  • Minimum Cost of Left and Right PropagationOA · Seen Nov 2026
  • Minimum Grid InconvenienceOA · Seen Nov 2026
  • Maximize K-Element AND with an Increment BudgetOA · Seen Nov 2026
  • Maximize Shipment Order by Sorting One WindowOA · Seen Nov 2026
  • Maximum Equal-Bit Pairs in a SubsequenceOA · Seen Nov 2026
  • First Non-Repeating CharacterOA · ONSITE INTERVIEW · Seen Nov 2026
  • Two SumOA · PHONE SCREEN · Seen Nov 2026
  • Minimum Merge ConflictsOA · Seen Nov 2026
  • Shopping Cart BillingOA · Seen Nov 2026

Similar questions at other companies

  • Sum of Pipeline Response TimesBloomberg LP · OABloomberg LP interview questions
  • Increasing-Value Triplets Under a ThresholdIBM · OAIBM interview questions
  • Product of Subset MaximaArcesium · OAArcesium interview questions
  • Count Triplets With Sum at Most TargetGoogle · ONSITE INTERVIEWGoogle interview questions
  • Reduce Array Size to At Most HalfMicrosoft · ONSITE INTERVIEWMicrosoft interview questions
  • Partition into Equal-Sum GroupsPalo Alto Networks · ONSITE INTERVIEWPalo Alto Networks interview questions
  • Count Overlapping Square PairsRamp · OARamp interview questions
  • Capping Portfolio WeightsCapstone Investment Advisors · OA
  • Find Valid SET Card TriplesSnowflake · OA · PHONE SCREENSnowflake interview questions
  • Largest Team Where Every Pair OverlapsWalmart · OAWalmart interview questions

Amazon interview experiences

  • Amazon SWE OA with AI Coding: 1 Experience
  • Amazon SWE Intern Phone Screen Interview Experience: 1 Experience
  • Amazon New Grad SDE I OA and Virtual Onsite: 1 Experience
  • Amazon BIE Intern SQL and Interview Questions: 17 Experiences
  • Amazon Experienced SWE AI-Assisted Debugging OA: 1 Experience
  • Amazon SDE II (L5) Interview Questions: 5 Experiences
See Amazon hiring insights
Saved
class Solution {
    public int countStableConfigurations(int[] coordinationThreshold) {
      // write your code here
    }

}
Checking account…