EGYM interview question

System Design questions, refactoring bad solution