Dynata interview question

Coding questions that require logical thinking