PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCareers
|Home/Coding & Algorithms/Atlassian

Design a trie-based URL router with wildcards

Last updated: Mar 29, 2026

Quick Overview

This question evaluates proficiency with trie-based data structures, string/segment pattern matching, and API design for route management (addRoute, removeRoute, match), including support for single-segment wildcards, precedence among overlapping patterns, and edge cases such as leading/trailing slashes and duplicate routes.

  • Medium
  • Atlassian
  • Coding & Algorithms
  • Software Engineer

Design a trie-based URL router with wildcards

Company: Atlassian

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Technical Screen

Implement a URL routing matcher that supports adding route patterns and matching request paths. Use a trie as the core data structure. Support static segments (e.g., /a/b/c) and a single-segment wildcard as in /a/*/c. Design APIs addRoute(pattern, handler), removeRoute(pattern), and match(path) -> matchedHandler (and the matched pattern). Define precedence rules when multiple patterns could match (e.g., prefer more specific over wildcard). Analyze time and space complexity and provide unit tests covering edge cases such as leading/trailing slashes, duplicate routes, and overlapping wildcard patterns.

Quick Answer: This question evaluates proficiency with trie-based data structures, string/segment pattern matching, and API design for route management (addRoute, removeRoute, match), including support for single-segment wildcards, precedence among overlapping patterns, and edge cases such as leading/trailing slashes and duplicate routes.

Related Interview Questions

  • Find a secret word using match feedback - Atlassian (hard)
  • Compute a moving average on a stream - Atlassian (hard)
  • Implement sliding-window rate limiter function - Atlassian (medium)
  • Implement sequential and parallel URL requests - Atlassian (medium)
  • Merge intervals and design rating APIs - Atlassian (medium)
Atlassian logo
Atlassian
Jul 31, 2025, 12:00 AM
Software Engineer
Technical Screen
Coding & Algorithms
4
0

Implement a URL routing matcher that supports adding route patterns and matching request paths. Use a trie as the core data structure. Support static segments (e.g., /a/b/c) and a single-segment wildcard as in /a/*/c. Design APIs addRoute(pattern, handler), removeRoute(pattern), and match(path) -> matchedHandler (and the matched pattern). Define precedence rules when multiple patterns could match (e.g., prefer more specific over wildcard). Analyze time and space complexity and provide unit tests covering edge cases such as leading/trailing slashes, duplicate routes, and overlapping wildcard patterns.

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Atlassian•More Software Engineer•Atlassian Software Engineer•Atlassian Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • Careers
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.