FastPrepOptimal Office Placement
Problems/Optimal Office Placement

Optimal Office Placement

Roblox logoRoblox● HardNEW GRADOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The candidate reports Optimal Office Placement with the number of offices, a width, a height, and Manhattan distances. The linked task reference is not available. We chose to pick office cells that make the worst distance to the nearest office as small as possible, a small board, and the interface. Our version is about 75% the same as the reported question.

For this exercise, assume a width by height rectangular grid has no obstacles and every cell may contain an office. Place exactly offices offices in distinct cells.

The distance from cell (x,y) to office (a,b) is |x-a| + |y-b|. A cell is served by its nearest office. For a placement, find each cell’s distance to its nearest office. The largest of these distances is the placement’s radius. Include the office cells themselves in this calculation.

Place the offices so this radius is as small as possible, and return that radius. Office identities and the order in which they are placed do not matter.

Function

minOfficeRadius(width: int, height: int, offices: int) → int

Examples

Example 1

width = 3height = 3offices = 1return = 2

Put the office in the center. Every corner is at Manhattan distance 2.

Example 2

width = 4height = 1offices = 2return = 1

Offices at positions 0 and 2 serve every cell within distance 1.

Example 3

width = 2height = 2offices = 4return = 0

Every cell contains an office, so every nearest distance is zero.

Constraints

  • 1 <= width, height <= 4, so there are at most 16 cells.
  • 1 <= offices <= width * height.
  • Exactly one office may occupy a chosen cell; all grid cells are eligible.

More Roblox Online Assessment questions

  • Centered Block Placement QueriesOA · Seen Oct 2026
  • Robot Navigation Around LasersOA · Seen Oct 2026
  • Factory Batch Profit (Game Adaptation)OA · Seen Sep 2026
  • Nested Recipe Blocks (Game Adaptation)OA · Seen Sep 2026
  • Vehicle Builds for Required Terrain (Game Adaptation)OA · Seen Sep 2026
  • Track Received Byte RangesOA · Seen Sep 2026
  • Break a PalindromeOA · Seen Jun 2026
  • Count Pairs Differing in One DigitOA · Seen Oct 2025
  • Find Zero Cells in a 2×2 GridOA · Seen Oct 2025
  • Cat Route Budget Planning (Game Adaptation)OA · Seen Aug 2025

Similar questions at other companies

  • Count Valid A-B-C Sequences Under a Modulo-Four RuleInfosys · OAInfosys interview questions
  • Empty ShelfSquarepoint Capital · OASquarepoint Capital interview questions
  • Cave AdvantureMeta · OAMeta interview questions
  • The Three Knights 🎠TikTok · OATikTok interview questions
  • Complete a Sudoku BoardJP Morgan Chase · OAJP Morgan Chase interview questions
  • Word SearchBloomberg LP · OA · PHONE SCREEN · ONSITE INTERVIEWBloomberg LP interview questions
  • Four-by-Four Boundary GridSusquehanna International Group (SIG) · OASusquehanna International Group (SIG) interview questions
  • Alternating Parity PermutationsGoldman Sachs · OAGoldman Sachs interview questions
  • Minimum Changes to Draw a YZipRecruiter · OAZipRecruiter interview questions
  • Count L-Shaped PlotsUber · OAUber interview questions

Interview reports that mention this question

  • Roblox New Grad Early OA Tasks: 10 Experiences (Part 7 of 7)

Roblox interview experiences

  • Roblox New Grad Engineer Rounds: 13 Experiences (Part 6 of 7)
  • Roblox New Grad HackerRank OA: 18 Experiences (Part 5 of 7)
  • Roblox New Grad CodeSignal Finals: 23 Experiences (Part 4 of 7)
  • Roblox New Grad Games and BQ: 25 Experiences (Part 3 of 7)
  • Roblox New Grad Coding Rounds: 23 Experiences (Part 2 of 7)
All Roblox interview questionsSee Roblox hiring insights
Saved
class Solution {
    public int minOfficeRadius(int width, int height, int offices) {
        // write your code here
    }

}
Checking account…