Snap interview question

1 coding question and continue with follow up coding questions to extend/ modify existing code, not typical leetcode style