Atlassian interview question

In Browser coding interview I was asked to develop a dynamic hierarchical menu where it can have multiple levels. In Javascript coding interview, I was asked to develop an API that retrieves the Menu option and according to access rights route to the specific page.