Studybuddy Interview Question

Help me solve this math question