Openhouse Interview Question

Asked for a real time assignment