Amazon interview question

Write a boolean search for this situation.