Your question is Rectangular Containment Check. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Implement CGRectContainsRect(rect1, rect2): return true if rect1 fully contains rect2, otherwise false.
Asked in the technical phone screen stage. First of two questions in an iOS phone screen.
Represent each rectangle as [x, y, width, height], where (x, y) is its lower-left corner. Return True when every point of rect2 lies inside or on the boundary of rect1; otherwise return False.
def CGRectContainsRect(rect1, rect2):