FastPrepQuery Box Inside Every Saved Rectangle
Problems/Query Box Inside Every Saved Rectangle

Query Box Inside Every Saved Rectangle

ZipRecruiter logoZipRecruiter● EasyNEW GRADOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: A ZipRecruiter new-grad OA image describes save and query encodings, the direction where the query fits inside a saved one, independent fitting, rotation, a vacuously true result, and a worked example. We supplied limits and a function signature.

Process operations:

  • [0,a,b] saves an a by b rectangle.
  • [1,a,b] asks whether the query box can fit inside every saved rectangle separately.

Allow 90-degree rotation. Return query booleans in order; with no saved rectangles, return true.

Function

queryBoxesFitSavedRectangles(operations: int[][]) → boolean[]

Examples

Example 1

operations = [[0,3,3],[0,5,2],[1,3,2],[1,2,4]]return = [true,false]

3x2 fits both saved rectangles after rotation choices; 2x4 cannot fit inside 3x3.

Example 2

operations = [[1,100,100]]return = [true]

No rectangles have been saved.

Constraints

  • 1 <= operations.length <= 100000
  • All side lengths are positive.

More ZipRecruiter Online Assessment questions

  • Four-Level Banking System with Scheduled PaymentsOA · Seen Oct 2026
  • Count Three-Digit Numbers with Distinct DigitsOA · Seen Oct 2024
  • Longest Frequency-Bounded SubarrayOA · Seen Oct 2024
  • Minimum Changes to Draw a YOA · Seen Oct 2024
  • Apply Binary State OperationsOA · Seen Sep 2024
  • Simulate Orchard Rot SpreadOA · Seen Sep 2024
  • Compare Odd- and Even-Index SumsOA · Seen Sep 2024
  • Coordinate Removals with Column GravityOA · Seen Sep 2024
  • Lexicographically Smallest End ReversalOA · Seen Sep 2024
  • Recursively Expanded Shell Command CountsOA · Seen Sep 2024

Similar questions at other companies

  • Catch Fish with Reusable BaitsSusquehanna International Group (SIG) · OASusquehanna International Group (SIG) interview questions
  • Book Reading EveningsGoogle · OAGoogle interview questions
  • Basic Item DiscountsPalantir · OAPalantir interview questions
  • Wind-Blown Leaves Remaining in a GridAbridge · OAAbridge interview questions
  • Lift Total TravelInfosys · OAInfosys interview questions
  • Shell Command Counts with History ReferencesTikTok · OATikTok interview questions
  • Count Dropped RequestsJP Morgan Chase · OAJP Morgan Chase interview questions
  • Recursively Expanded Shell Command CountsHudson River Trading · OAHudson River Trading interview questions
  • Diagonal Bounce TraversalAutodesk · OAAutodesk interview questions
  • First Value Below Both NeighborsCapital One · OACapital One interview questions

ZipRecruiter interview experiences

  • ZipRecruiter SWE OA, Level Not Reported: 23 Experiences
  • ZipRecruiter SWE Intern OA Scores: 4 Experiences
  • ZipRecruiter SWE New Grad OA: 9 Experiences
All ZipRecruiter interview questionsSee ZipRecruiter hiring insights
Saved
class Solution {
    public boolean[] queryBoxesFitSavedRectangles(int[][] operations) {
        // Write your code here.
    }

}
Checking account…