Nuvalence interview question

Write a solution that will detect intersection, adjacency and containment of rectangles.