Recruitment Test – Stage 1

In this test, you need to Parse the JSON file attached (on right hand side). Read specifications below and see explainer video.  

 
 Time limit:
– 20 minutes to watch the test explainer video (on your right)
– 25 minutes to crack the test
– Total: 45 minutes  

Steps to perform in this assignment :

Parse the JSON file
Go inside ‘Body > Recommendations’
 Print name of Restaurant
Go inside ‘Body > Recommendations’
 Go inside menu
Loop for each menu (there can be multiple menus)
Check whether type=sectionheader. If it is – go inside its ‘children
Check whether type=item. If it is, check whether selected=1. If both are true, print the name of item, and go inside its children
Check whether selected=1 (no need to pay attention to the ‘type’ now that we are inside children of ‘item’). If selected was 1 then print the name of child, and go further deep inside the children
Repeat the last step infinitely – until we have reached the deepest child

The output should look like this :
Restaurant1
–> Item1
—–> Child1
———-> Child1.1
———-> Child1.2
——> Child2
——> Child3
———-> Child3.1
Take note of length of arrows in each line above. Your output should also contain these arrows to depict the indentation of each child.

Submit your test

1 + 2 =

JSON file to parse

Test Explainer Video

You may like to maximize this video to see clearly.

Frequently asked questions


Which programming language to use?

Any language that you like.

My time limit was over. Can I still submit?
Yes, sure. However, the time limit plays a role in our selection criteria for this job.

When can I hear back from you?
If you submitted your test, you will hear from us within 2 business days. 

Can I take someone’s help?
You may research on internet as much as you like. However, taking help of a human is not allowed.

What happens after this test?
If you clear this test, you qualify for Round 2, which may involve telephonic or voice conference interview, followed by an another coding test assignment.