Statusneo Interview Question

There was a technical question regarding the coding part