Dataford
Interview QuestionsInterview GuidesExperiencesCoaching
New
Pricing
Get started
Dataford
Popular roles
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Browse
Browse All RolesEvery role hub, from analyst to MLBrowse All CompaniesCompany-specific interview loopsAll Interview GuidesThe full guide library
Top questions by role
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Top questions by skill
SQLPythonStatisticsMachine LearningA/B TestingSystem DesignGenerative AIProduct SenseMetricsBehavioral
Browse all questions →Try a mock interview
ExperiencesCoaching
New
Practice
Mock InterviewsTimed interview simulations with feedbackSuccess PathYour 6-week structured planModulesCurated lessons by topicWebinarsTalks from ex-Big Tech data leadsPlaygroundA free-form scratch editor
Learn
BlogInterview strategy and career adviceTech Job Market ReportHiring trends across data and AI rolesFor UniversitiesDataford for career centersAbout DatafordWho we are and how we build
Pricing
Get started

Preprocess E-commerce Reviews for Classification

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

Your question is Preprocess E-commerce Reviews for Classification. 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

ShopSphere wants to standardize text preprocessing for customer reviews before training downstream sentiment and topic classifiers. Your task is to design and implement a practical preprocessing pipeline using tokenization, stemming, and lemmatization, then justify when each technique should be used.

Data

  • Volume: 250,000 English product reviews collected over 18 months
  • Text length: 5-300 words per review, median length 42 words
  • Language: Primarily English, with minor noise from emojis, URLs, HTML fragments, and misspellings
  • Labels: 3 sentiment classes — positive (62%), neutral (18%), negative (20%)
  • Text characteristics: Informal language, repeated punctuation, contractions, product codes, and domain terms such as SKU names

Success Criteria

A good solution should produce a reusable preprocessing pipeline that improves consistency of model inputs, preserves sentiment-bearing terms, and supports a baseline classifier with macro-F1 >= 0.80 on a held-out validation set.

Constraints

  • Pipeline must run on CPU for batch preprocessing of daily review uploads
  • Preprocessing should be reproducible and easy to swap between stemming and lemmatization modes
  • Avoid aggressive normalization that removes important sentiment cues such as negation

Requirements

  1. Build a preprocessing pipeline that includes tokenization and compares stemming vs lemmatization.
  2. Explain which cleaning steps should happen before and after tokenization.
  3. Train a simple baseline sentiment classifier using the processed text.
  4. Show how preprocessing choices affect vocabulary size and classification quality.
  5. Provide Python code using modern NLP libraries such as nltk, spaCy, and scikit-learn.
  6. Describe trade-offs between stemming, lemmatization, and minimal normalization for production use.