Stupa Interview Question

Asked to write code for a specific requirement