Pergunta de entrevista da empresa StockX

You are given paths representing categories and subcategories, each ending with a category ID. Design a data structure to efficiently store, insert, and search categories along their hierarchy.