This is a verified interview question from Autodesk. Candidates reporting seeing this problem in recent Online Assessments (OAs) and onsite rounds. Mastering "Rectangle Area - Autodesk" covers key patterns like Other.
"You are given operations, an array containing the following two types of operations: - [0, a, b] - Create and save a rectangle of size a x b. - [1, a, b] - Answer the question: 'Could a box of size a x b fit inside of each of the earlier saved rectangles?' It is possible to rotate the rectangles by 90 degrees, i.e. a rectangle of dimensions a x b can be rotated so that its dimensions are b x a. Your task is to return an array of booleans, representing the answers to the second type of operation, in the order they appear. Note that the operations should proceed iteratively, so when operations[i] is executed, only the results of the previous operations 0, 1, ..., i - 1 are available."
Join thousands of developers practicing for Autodesk.