Frontend System Design

When designing a menu with nested items, how would you configure it to close open sub-menus when selecting another parent, and keep sub-menus open when interacting with nested items?

Frontend Engineer

Shopify

Spotify

Dropbox

ByteDance

Slack

Atlassian

Did you come across this question in an interview?

  • When designing a menu with nested items, how would you configure it to close open sub-menus when selecting another parent, and keep sub-menus open when interacting with nested items?
  • In a menu system with hierarchical items, what approach would you take to ensure sub-menus close upon selecting a different parent, while keeping them open when engaging with deeper nested items?
  • How would you program a menu that automatically closes its sub-menus when a different parent item is selected, yet retains the open state of sub-menus during nested interactions?
  • What is your strategy for a menu design where clicking a parent item closes its open sub-menus, but navigating through nested children keeps them open?
  • How would you implement a menu structure that collapses open sub-menus when a new parent is selected, while maintaining the expanded state when interacting with nested sub-menus?
  • In creating a dynamic menu, how would you ensure sub-menus close when a different parent is clicked, and remain open when interacting with child items?
  • What method would you use to construct a menu where selecting a new parent item closes any open sub-menus, but navigating child items keeps them open?
  • How would you develop a menu that automatically closes its sub-menus upon selecting another parent, but keeps them open when clicking on sub-items?
  • What technique would you apply to a menu where clicking a new parent closes open sub-menus, yet allows nested sub-menus to stay open during interaction?
  • Create Menu with children as per image. How would you close opened children when you click on another parent? How would you keep your children opened when you click on child's children?
Try Our AI Interviewer

Prepare for success with realistic, role-specific interview simulations.

Try AI Interview Now

Interview question asked to Frontend Engineers interviewing at Spotify, Atlassian, Shopify and others: When designing a menu with nested items, how would you configure it to close open sub-menus when selecting another parent, and keep sub-menus open when interacting with nested items?.