Riskified Interview Question

Read code and explain its problems, how to improve it