Domanda di colloquio di Google

Given 2 intervals, get the overlapping between 2 intervals