FastPrepLargest Plus Sign
Problems/Largest Plus Sign

Largest Plus Sign

xAI logoxAI● MediumFULLTIMEOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The assessment report explicitly names the Largest Plus Sign problem and links the standard form. Our statement keeps that form.

You have an n x n binary grid initially filled with ones. Every coordinate in mines is changed to zero.

An axis-aligned plus sign of order k has a center cell and four arms of ones extending k - 1 cells up, down, left, and right. Return the largest possible order. Return 0 if the grid contains no one.

Function

orderOfLargestPlusSign(n: int, mines: int[][]) → int

Examples

Example 1

n = 5mines = [[4,2]]return = 2

A plus centered at [2,2] has one cell in each arm, so its order is 2.

Example 2

n = 1mines = [[0,0]]return = 0

The only cell is zero.

Constraints

  • 1 <= n <= 500.
  • 0 <= mines.length <= n * n.
  • Every mine is a distinct pair [row, col] with 0 <= row, col < n.

More xAI interview questions

  • Longest Common SubstringOA · Seen May 2025
  • Sort Concentric Matrix RingsOA · Seen May 2025
  • Resumable List IteratorPHONE SCREEN · Seen Apr 2026
  • Earliest Dataset Readiness in a PipelinePHONE SCREEN · Seen Mar 2026
  • Live Top-K Spaces by Active UsersONSITE INTERVIEW · Seen Jan 2026
  • Total Active Time by SpaceONSITE INTERVIEW · Seen Jan 2026
  • Dynamic Batch Decode TraceONSITE INTERVIEW · Seen Dec 2025
  • Nested Transaction Key-Value StoreONSITE INTERVIEW · Seen Oct 2025
  • Weighted LRU CacheONSITE INTERVIEW · Seen Oct 2025
  • LFU CacheONSITE INTERVIEW · Seen Sep 2025

Similar questions at other companies

  • Largest Square of OnesOpenAI · OAOpenAI interview questions
  • Cherry PickupInfosys · OAInfosys interview questions
  • Maximum Sum RectangleDeloitte · OADeloitte interview questions
  • Assign Escalations to TeamsAmazon · ONSITE INTERVIEW
  • Find Robots by Blocker DistancesUber · PHONE SCREENUber interview questions
  • Factory Cost — Minimum Cost Across StagesStripe · PHONE SCREENStripe interview questions
  • Maximum All-Ones Square Side LengthOmnissa · ONSITE INTERVIEWOmnissa interview questions
  • Maximum Rocks on a North-or-East Grid PathGoldman Sachs · PHONE SCREENGoldman Sachs interview questions
  • Maximal SquareAirwallex · PHONE SCREENAirwallex interview questions
  • Maximal SquareSalesforce · PHONE SCREENSalesforce interview questions

xAI interview experiences

  • xAI New Grad AI Coding Interview and Take-Home: 3 Experiences
All xAI interview questionsSee xAI hiring insights
Saved
class Solution {
    public int orderOfLargestPlusSign(int n, int[][] mines) {
        // Write your code here.
    }
}
Checking account…