Pipedrive interview question

Simple algorithm questions in live coding.