Evaluate piecewise linear function at x | Two Sigma Interview Question