FastPrepHeaters for Every Integer House
Problems/Heaters for Every Integer House

Heaters for Every Integer House

Intuit logoIntuit● MediumINTERNOA

Updated Oct 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The source explicitly replaces house positions with all integers 1..n and requests nine-decimal output. In-range heater positions and limits are practice assumptions; about 95% match.

A house stands at every integer position from 1 through n. The heaters are at the integer positions in heaters. All heaters use the same nonnegative radius and cover houses at distance at most that radius. Return the minimum radius that covers every house, formatted with exactly nine digits after the decimal point.

Function

minimumRadius(n: int, heaters: int[]) → String

Examples

Example 1

n = 5heaters = [2,4]return = "1.000000000"

Every integer house is within one unit of a heater.

Example 2

n = 6heaters = [1,6]return = "2.000000000"

Houses 3 and 4 are two units from their nearest heater; a real midpoint is not a house.

Constraints

  • For this exercise, assume 1 <= n <= 10^9, 1 <= heaters.length <= 200000, and every heater lies in [1,n]. Duplicate heaters are allowed.

More Intuit Online Assessment questions

  • Employee Promotion OpportunitiesOA · Seen Oct 2026
  • Next Pascal Row CoefficientOA · Seen Oct 2026
  • Parse Router LogsOA · Seen Oct 2026
  • Longest Repeated Letter Block with Adjacent SwapsOA · Seen Oct 2026
  • Maximum Square-Free DivisorOA · Seen Oct 2026
  • Two Tribes from Taller-Person CountsOA · Seen Oct 2026
  • Shortest Path from an Encoded GraphOA · Seen Sep 2026
  • Oldest and Youngest EmployeesOA · Seen Sep 2026
  • Pressure-Isolation Shutdown OrderOA · Seen Sep 2026
  • Submask Sum QueriesOA · Seen Sep 2026

Similar questions at other companies

  • Find Minimum TimeAlphaSense · OA
  • Subscription and Usage-Based Billing CalculatorStripe · OAStripe interview questions
  • Find Minimum TimeBlackRock · OABlackRock interview questions
  • Maximum Interactive Team SizeMicrosoft · OAMicrosoft interview questions
  • Count Proper Prefix MatchesAT&T · OAAT&T interview questions
  • Linear InterpolatorTwo Sigma · OATwo Sigma interview questions
  • Find Sum of BeautiesAmazon · OA
  • Choose ContainersIMC Trading · OAIMC Trading interview questions
  • Minimize Maximum Group DifferenceDRW · OADRW interview questions
  • Maximum Riders in CarUber · OAUber interview questions

Interview reports that mention this question

  • Intuit OA: What It Tests (2026)

Intuit interview experiences

  • Intuit Software Engineering Intern - Full Stack OA Format
All Intuit interview questionsSee Intuit hiring insights
Saved
class Solution {
    public String minimumRadius(int n, int[] heaters) {
        // Write your code here
    }
}
Checking account…