Interview Question

Senior Software Engineer Interview San Mateo, CA

Detecting if periods of time intersect.

Answer

Interview Answer

1 Answer

0

ANSWER:

If end time of one is greater than the start time of the other AND vice-versa then "YES" else "NO"

Example.. Does Policy covers loss?
i.e. Does Policy Coverage Period (PCP) intersect with Loss Period (LP)?
STS = Start-Time-Stamp; ETS = End-Time-Stamp

If PCPETS >= LPSTS and LPETS >= PCPSTS then "YES" Else "NO".

Umesha N Shetty on Jun 15, 2011

Add Answers or Comments

To comment on this Question, Sign In with Facebook or Sign Up