Implement monotonic x-y linear interpolation | Tradedesk Interview Question