I was asked this question a few months back when I interviewed onsite with CreditKarma. Can someone help point me to a similar question on LC?
There's a store with different sections - Fruits, Veggies, Household etc. This data is in a tree with the root as Store. Your task if you choose to accept it, is to print out the tree like below -
Store
<tab>Fruits
<tab><tab>Apples
<tab><tab>Oranges
<tab><tab>Grapes
<tab>Veggies
<tab><tab>Tomatoes
<tab><tab>Potatoes
<tab>Household
<tab><tab>MedicinesAny clue? Thank you.