Pregunta de entrevista de Two Sigma

two pretty basic coding questions and one focused on stats and numerical stability