Pulsenics interview question

Some weird brain teaser and algorithm question