IMC Trading Interview Question

Two easy medium coding questions.