There are interfaces
interface Male {
boolean likes(Female female);
}
interface Female {
boolean likes(Male male);
}
There’s also interface
interface GoodCouple {
Male getMale();
Female getFemale();
}
You’re given 2 sets:
Iterable<Male> males = ...;
Iterable<Female> females = ...;
And you’re asked to build the set of GoodCouples:
Iterable<GoodCouple> couples = XXXXXXXXXXXX(males, females);
The question is, how would you define XXXXXXXXXXXX? It’s not about algorithm, it’s about architecture: what is XXXXXXXXXXXX? Is it some class’ method? What name would you give to that class? What are responsibilities of this class?
If it matters, languages are either C# or Java.
It might be part of a
GoodCoupleFactory:CreateGoodCouples(males, females)