adifinem / coaches

Distribution Algorithm Test

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problem 1 Using your favorite language, please model a Coach, a Student, and the relationship between them. Given a list of students and a list of coaches, please create an algorithm to distribute the students evenly between the coaches. For example, given 3 coaches and 20 students, the distribution should be as follows: Coach 1: 7 Coach 2: 7 Coach 3: 6

Problem 2 Some coaches may already have students. Please change your distribution algorithm so that the distribution correctly distributes the students even if the coaches already have students on their list. For example, given 3 coaches: Coach 1: 7 students Coach 2: 7 students Coach 3: 6 students And given a new list of 10 students, the final distribution would be: Coach 1: 10 students Coach 2: 10 students Coach 3: 10 students

Notes The solution can be database driven – or not Tests can help prove your solution works Some solutions are more performant

About

Distribution Algorithm Test


Languages

Language:Ruby 100.0%