Microsoft Interview Question

Ive already explained that there was a dynamic problem