This is not a system design question, but a general coding question that was asked in a Google onsite. I am trying to figure out what is the best solution. Any help would be appreciated!
Design a study buddy system for a university (again, not system design question) that helps group together students that are close to each other. The goal is to identify groups of exactly 3 students that can form a study group.
The system will be queried with one student at a time. When a student is added into the sytem, the program must return groupings of students that will be eligible to form a study group (i.e. based on proximity). For proximity, imagine you have a function that takes in two students and tells you if they are eligible to be paired with each other based on proximity (i.e. function returns a boolean). All students in the group must be elgible to work with each other.
Any ideas?