test
{
“@context”: “https://schema.org”,
“@type”: “FAQPage”,
“mainEntity”: [
{
“@type”: “Question”,
“name”: “What is a tag and taxonomy service?”,
“acceptedAnswer”: {
“@type”: “Answer”,
“text”: “A tag and taxonomy service manages the creation, normalization, and organization of labels attached to content objects. It stores tags as first-class entities with metadata (slug, display name, parent, usage count) and maintains many-to-many relationships between tags and taggable resources via a taggings junction table. A taxonomy layer adds hierarchical structure, grouping tags into trees or DAGs for browse navigation, faceted search, and semantic queries.”
}
},
{
“@type”: “Question”,
“name”: “How is tag normalization implemented to avoid duplicate tags?”,
“acceptedAnswer”: {
“@type”: “Answer”,
“text”: “Normalization runs at write time: input is lowercased, trimmed, Unicode-NFKC-normalized, and stripped of special characters, producing a canonical slug (e.g., ‘JavaScript’ and ‘ javascript ‘ both become ‘javascript’). The slug is used as the unique key in the tags table; the human-readable display name is stored separately. Fuzzy duplicate detection (e.g., Levenshtein distance or phonetic matching) can surface near-duplicates for admin review. Alias records map retired or misspelled slugs to the canonical tag so historical taggings remain valid.”
}
},
{
“@type”: “Question”,
“name”: “How does a hierarchical taxonomy enable ancestor and descendant queries efficiently?”,
“acceptedAnswer”: {
“@type”: “Answer”,
“text”: “The taxonomy tree is stored using a closure table: a separate tag_ancestors table holds every (ancestor_id, descendant_id, depth) triple. Inserting a new tag copies all ancestor rows of its parent and adds one row for itself. Querying all descendants of a tag is a single SELECT on tag_ancestors WHERE ancestor_id = ?; querying ancestors is the reverse. This makes subtree reads O(1) SQL with no recursion. Materialized paths are an alternative that trades write complexity for even simpler queries via LIKE ‘/root/science/%’.”
}
},
{
“@type”: “Question”,
“name”: “How are tag suggestions and trending tags generated?”,
“acceptedAnswer”: {
“@type”: “Answer”,
“text”: “Suggestions at input time use prefix search on the normalized slug index (a trie or B-tree index with LIKE ‘prefix%’) combined with a co-occurrence model: tags that frequently appear together with already-selected tags are ranked higher. Trending tags are computed by a batch job that counts tag usage over a rolling window (e.g., last 24 hours vs. baseline), applies a decay function, and writes results to a Redis sorted set. Real-time trending can supplement the batch score with a Count-Min Sketch over a sliding window stream.”
}
}
]
}
See also: Atlassian Interview Guide