Tencent interview question

Algorithm to calculate IOU.