Object-Oriented Programming · Disney · Medium
You receive a List , where each ad has an id, a set of targetLocations, and an age. You also receive a Rule made up of an optional targetLocations criterion, an optional minAge, an optional maxAge, and an operator that is either AND or OR. Return the ids of all ads that satisfy the rule, keeping them in the same order in which they appear in the input list. Interview Notes This was asked as a phone-screen problem. The main thing being evaluated is how you define the way the…