Klaviyo interview question

I was asked to flatten a dictionary