Stupa interview question

Asked to write code for a specific requirement