FlyFin interview question

State management related, some puzzles