Amazon Interview Question

Given two intervals, check if they intersect.