Pulsenics Interview Question

Some weird brain teaser and algorithm question