Honeywell Interview Question

Asked me to solve the DSA question to find the second largest number in Array. Check two rectangles are overlapping or not