Pocket Gems interview question

Standard, easy run time analysis + needle & haystack