Whatnot interview question

Karat LC 2 Qs - Grid and Graph Based