How do you handle resource hierarchy in URIs, and when should you use nesting versus flat structures with query parameters?

Last updated 29 June 2026

  • Nest only for true parent-child ownership and keep it shallow (one level), e.g. /users/42/orders. Deep nesting is brittle and hard to read.

  • Go flat once a resource has its own global ID: /orders/7 beats /users/42/orders/7.

  • Use the path for identity and query params for filtering, sorting and paging, e.g. /orders?user_id=42&status=open.

  • https://www.sendowl.com/s/job-search
  • https://www.ashokit.in/blog/top-microservices-interview-questions-and-answers
  • https://www.resumeadapter.com/blog/full-stack-developer-resume-keywords
  • https://meduzzen.com/hire/backend-developers/
  • https://www.greatfrontend.com/blog/latest
  • https://prepfully.com/interview-guides/hubspot-software-engineer
  • https://www.getsmartresume.com/article/netflix-internship-new-grad-opportunities
All REST API interview questions