Frage im Vorstellungsgespräch bei Booking.com

Given a array data structure, merge the array based on common keys AKA merge intervals