Pipedrive Interview Question

Simple algorithm questions in live coding.