AlgoMaster Logo
AlgoMasterPlan Reliability Recovery Targetseasy

Plan Reliability Recovery Targets

easy

Reliability improves when failures happen less often or recovery happens faster. Mean time between failures (MTBF) and mean time to repair (MTTR) connect those two operational levers to steady-state availability.

Design a ReliabilityRecoveryPlanner class:

  • ReliabilityRecoveryPlanner() creates a stateless planner.
  • double availability(double mtbfHours, double mttrHours) returns steady-state availability, rounded to 5 decimal places.
  • double maximumMttr(double mtbfHours, double targetAvailability) returns the largest MTTR that still meets the target, rounded to 5 decimal places.
  • boolean meetsTarget(double mtbfHours, double mttrHours, double targetAvailability) reports whether the current values meet or exceed the target.

Use these formulas:

Availability and target availability are fractions between 0 and 1, not percentages. meetsTarget must compare the unrounded availability. Each call is independent.

Example 1:

Input:

Output:

Explanation: The service is available for 720 / 721 of the cycle. To reach 0.999 availability without changing MTBF, mean repair time must fall to approximately 0.72072 hours or less.

Example 2:

Input:

Output:

Explanation: The current 0.5-hour MTTR is below the 0.87609-hour maximum for the target.

Constraints

  • 0 < mtbfHours <= 10^9
  • 0 <= mttrHours <= 10^9
  • 0 < targetAvailability <= 1
  • MTBF and MTTR use the same time unit.
  • Numeric answers are accepted within 10^-5 of the expected result.
  • At most 100 total method calls are made.
Hints

Loading...
CallReturns
new ReliabilityRecoveryPlanner()null
availability(720, 1)0.99861
maximumMttr(720, 0.999)0.72072
meetsTarget(720, 1, 0.999)false

The current availability is 720 / 721, below 99.9%. With the same MTBF, repair time must be at most about 0.72072 hours to meet the target.

Run checks these cases. Submit also runs a larger hidden set.