Autodesk interview question

How to detect if two rectangles overlap?