Pergunta de entrevista da empresa Green By Phone

There are two rectangles on screen. How can you determine if the rectangles are touching/overlapping?