PearlThoughts interview question

Asked to solve real-time project issue