Design a scalable tagging system
AtlassianSoftware Engineer · Technical ScreenLast updated
This question tests a candidate's ability to design scalable data models and distributed indexing strategies for a multi-tenant tagging system. It evaluates system design competency across storage, caching, sharding, and consistency trade-offs — core skills assessed in senior software engineering interviews.
Question
Design a scalable tagging system that lets users attach multiple tags to arbitrary resources (items) and query them efficiently. The system must support creating and managing tags, attaching/removing tags, and high read/write traffic. Address the following:
- Tag lifecycle: Create / get-or-create tags, attach and remove tags from items, and prevent duplicate (item, tag) assignments.
- Single-tag query: Return all items for a given tag, with pagination and sorting (e.g., by recency).
- Multi-tag query (AND / OR): Return items matching a combination of tags, supporting both intersection (AND) and union (OR).
- Top-N per tag: Efficiently list the top-N items for a tag (e.g., by recency or score).
- Counts: Return the number of items per tag.
- Autocomplete / suggestions: Prefix-based tag autocomplete and (optionally) related-tag suggestions.
- Data model & storage: Specify the data model and storage choices for tags, items, and assignments.
- Indexing: Indexing strategy for fast writes and reads, including an inverted index (tag → items) and forward index (item → tags), plus secondary indexes to handle high-cardinality / skewed tags.
- Caching: What to cache, cache-invalidation strategy, and hot-key handling.
- Sharding / partitioning: How to partition the OLTP store and the index, including multi-tenancy isolation and hot-tag mitigation.
- Consistency: Choose and justify a consistency model (eventual vs. strong) and explain how to support read-your-writes.
- De-duplication, rename, and merge: How tag de-duplication, renaming, and merging two tags are handled.
- Access control: Tenant isolation and per-resource ACL filtering.
- Pagination: A stable, scalable pagination strategy.
- Backfill & cleanup: Reindex/backfill jobs and cleanup of orphan tags and drifted counters.
- Capacity, monitoring, and SLAs: Provide order-of-magnitude capacity estimates and describe the key metrics, alerts, and SLOs.
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.