Pergunta de entrevista da empresa KAYAK

Write a function in java that validates items in a list and checks for duplicates, but the definition of "valid" can change.

Resposta da entrevista

Sigiloso

21 de out. de 2015

Two ways - either write the function so that one of its arguments is a function that validates list items, or write a stub validateItem() function and package both in an abstract class. Then whoever defines item validity can implement class with their desired function.