← Microsoft Interview Insights

Microsoft·Software Engineer·Onsite - System Design / Architecture·Senior

Senior
May 2026

Summary

Microsoft system design round for a software engineering role. One meaty question about normalizing messy city name data, which sounds straightforward until you actually have to think through all the edge cases live.

Questions Asked (1)

Q1

Voting data contains city names in inconsistent formats like 'NYC', 'New York', and 'New York City'. How would you normalize these into canonical entities so votes aggregate correctly? Walk through both rules-based and ML-based approaches, how you'd pick similarity thresholds, what you'd do with ambiguous names like 'Springfield', and how you'd keep the mapping accurate over time.

System DesignTechnical Trade-offsData Modeling
Author's notes

This one had more surface area than I expected.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by framing the problem as entity resolution and canonicalization, then walk through a hybrid approach: rules-based normalization for deterministic cases, ML-based clustering for fuzzy matches, and a human-in-the-loop for ambiguous cases. Emphasize threshold selection via precision-recall trade-offs and a feedback loop to keep the mapping accurate over time.

Pro tip: Mention that you'd maintain a canonical entity table with versioning and audit logs, and use active learning to prioritize ambiguous cases for human review, which balances automation with accuracy.

1. Data Profiling and Preprocessing

Analyze the distribution of city name variations, identify common patterns (abbreviations, misspellings, suffixes), and standardize basic formatting (case, punctuation, whitespace).

2. Rules-Based Normalization

Apply deterministic rules: expand known abbreviations (NYC -> New York City), remove generic suffixes (City, Town), and use a curated alias dictionary for high-confidence mappings.

3. ML-Based Entity Resolution

For remaining variations, use similarity metrics (Jaro-Winkler, Levenshtein, token-based) and clustering algorithms (e.g., DBSCAN, hierarchical) to group similar names, then assign canonical entities based on cluster centroids or most frequent variant.

4. Threshold Selection and Ambiguity Handling

Choose similarity thresholds by evaluating precision/recall on a labeled validation set; for ambiguous names like 'Springfield', use context (state, zip code) or flag for human review to avoid incorrect merges.

5. Ongoing Maintenance and Feedback Loop

Implement a feedback mechanism where human corrections are fed back into the rules and ML models, and periodically re-evaluate the mapping to adapt to new variations.

Key Points to Mention

  • Entity resolution and canonicalization techniques
  • Hybrid approach: rules for precision, ML for recall
  • Similarity metrics and threshold tuning using precision-recall curves
  • Handling ambiguity with context (e.g., state, zip) or human-in-the-loop
  • Versioning and audit trails for canonical mappings
  • Active learning and feedback loops for continuous improvement

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.