Build an end-to-end ML classification pipeline

Quick Overview

This question evaluates a candidate's competency in building end-to-end tabular classification pipelines, including data loading and splitting, missing-value handling, categorical encoding, feature scaling, model training and comparison, hyperparameter tuning, metric-based evaluation, model persistence, and batch inference.

Build an end-to-end ML classification pipeline

Company: Nextdoor

Role: Machine Learning Engineer

Category: ML System Design

Difficulty: medium

Interview Round: Technical Screen

Given a tabular dataset in a CSV file, implement an end-to-end pipeline to perform a classification task. Requirements: ( 1) load the data; ( 2) create stratified train/validation/test splits; ( 3) handle missing values and encode categorical features; ( 4) standardize numeric features; ( 5) train a simple baseline (e.g., logistic regression) and at least one stronger model (e.g., gradient boosting or a small neural network); ( 6) tune key hyperparameters with cross-validation; ( 7) report accuracy, precision, recall, and ROC-AUC on validation and test; ( 8) persist the trained model and preprocessing steps; ( 9) implement batch inference via a predict(input_csv_path, output_csv_path) function or CLI. If using a neural network, write a correct training loop with optimizer initialization, forward pass, loss computation, backward pass, and an explicit optimizer step. Briefly explain design choices and how you would productionize this pipeline.

Overview: This question evaluates a candidate's competency in building end-to-end tabular classification pipelines, including data loading and splitting, missing-value handling, categorical encoding, feature scaling, model training and comparison, hyperparameter tuning, metric-based evaluation, model persistence, and batch inference.

|Home/ML System Design/Nextdoor
Nextdoor logo
Nextdoor
Sep 6, 2025
mediumMachine Learning EngineerTechnical ScreenML System Design
17
0

End-to-End Tabular Classification Pipeline (Python)

Context

You are given a tabular dataset in a CSV file and asked to build an end-to-end machine learning pipeline for a classification problem. Assume the dataset contains a column named target (binary classification by default). You may extend to multiclass if desired.

Requirements

  1. Load the data from CSV.
  2. Create stratified train/validation/test splits (e.g., 60/20/20).
  3. Handle missing values and encode categorical features.
  4. Standardize numeric features.
  5. Train a simple baseline model (e.g., Logistic Regression) and at least one stronger model (e.g., Gradient Boosting or a small neural network).
  6. Tune key hyperparameters with cross-validation.
  7. Report accuracy, precision, recall, and ROC-AUC on validation and test sets.
  8. Persist the trained model and preprocessing steps.
  9. Implement batch inference via a predict(input_csv_path, output_csv_path) function or CLI.

If you choose a neural network, include a correct training loop with optimizer initialization, forward pass, loss computation, backward pass, and optimizer step.

Deliverables

  • Clear, well-structured Python code (preferably using scikit-learn for classical models) with docstrings/comments.
  • A short explanation of design choices and how you would productionize this pipeline.

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...