CaptivateIQ interview question

Create an algorithm to process the data.