Quantcast interview question

HackerRank challenge related to query by example.