Pergunta de entrevista da empresa Two Sigma

Q: given an array of 2d points and an x-input query, return the corresponding y using linear interpolations.