Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Classify Support Tickets with TF-IDF

MediumNLP00:00
Practice interviewer
In session
5 left
00:00

Your question is Classify Support Tickets with TF-IDF. Take a moment with it on the right.

Talk me through your thinking if you like. When you're confident, submit your answer and I'll grade it like a real screen (7/10 or better passes).

You need to log in / sign up to chat or submit.

Problem

Business Context

ShopFlow, an e-commerce platform, receives thousands of customer support tickets each day. The operations team wants a lightweight text classification system that routes tickets to the correct queue without using large transformer models.

Data

You are given 420,000 historical support tickets labeled into 5 categories: Refund, Shipping Issue, Account Access, Product Defect, and Other.

  • Text source: ticket subject + message body
  • Text length: 5-350 words, median 42 words
  • Language: English only
  • Label distribution: Refund 28%, Shipping Issue 24%, Account Access 18%, Product Defect 15%, Other 15%
  • Noise: HTML fragments, order IDs, URLs, repeated punctuation, misspellings, and copied email signatures

Success Criteria

A production-ready baseline should achieve:

  • Macro F1 >= 0.82 on a held-out test set
  • Recall >= 0.90 for Account Access tickets
  • Inference latency < 20ms per ticket in batch scoring on CPU
  • Clear feature interpretability for support operations review

Constraints

  • Use a TF-IDF-based approach, not embeddings or transformers
  • Solution must run in a standard Python service on CPU
  • The pipeline should be reproducible and easy to retrain weekly

Requirements

  1. Build an end-to-end multi-class text classification pipeline using TF-IDF features.
  2. Define a realistic preprocessing strategy for noisy support text.
  3. Choose and justify an appropriate classifier (for example, Logistic Regression or Linear SVM).
  4. Show how you would tune TF-IDF parameters such as n-gram range, min_df, max_df, and sublinear_tf.
  5. Evaluate the model with class-level metrics and confusion analysis.
  6. Explain how you would inspect top weighted terms to validate routing behavior and detect spurious correlations.