PracHub
QuestionsLearningGuidesInterview Prep
|Home/Software Engineering Fundamentals/Capital One

Test and Run a Reproducible Data Science Pipeline

Last updated: Jul 21, 2026

Quick Overview

Design unit and integration tests for a Python data science pipeline that loads data, builds features, trains a model, and writes predictions. Add a reproducible command-line interface with schema checks, explicit configuration, versioned artifacts, structured logs, and safe failure behavior.

  • medium
  • Capital One
  • Software Engineering Fundamentals
  • Data Scientist

Test and Run a Reproducible Data Science Pipeline

Company: Capital One

Role: Data Scientist

Category: Software Engineering Fundamentals

Difficulty: medium

Interview Round: Technical Screen

You inherit a Python data-science pipeline that loads a file, builds features, trains a model, and writes predictions. Describe the unit tests you would add and the command-line interface you would provide so the workflow can run reproducibly in local development and automation. ### Constraints & Assumptions - Tests must use small synthetic fixtures rather than production data. - The pipeline should fail clearly on invalid input and should be runnable without editing source code. - The goal is to test the team's logic, not third-party library internals. ### Clarifying Questions to Ask - Which stages are pure functions, and which read files or external resources? - What schema and invariants must input data satisfy? - Which artifacts should a run produce, and how should they be versioned? - Does the command need separate train, evaluate, and predict modes? ### What a Strong Answer Covers - Unit tests for transformations, joins, leakage boundaries, edge cases, and deterministic metric calculations. - Integration tests for a tiny end-to-end run, with external I/O isolated or mocked appropriately. - Assertions for schema, uniqueness, row counts, ranges, missing values, and feature/target alignment. - A command-line design with explicit inputs, outputs, configuration, seeds, useful exit codes, and safe defaults. - Reproducible environments, structured logging, artifact metadata, and automation in continuous integration. ### Follow-up Questions 1. How would you test that a join does not duplicate observations? 2. What should happen when a required column is missing? 3. Which tests would detect training-serving preprocessing drift? 4. When is mocking harmful in a data pipeline test?

Quick Answer: Design unit and integration tests for a Python data science pipeline that loads data, builds features, trains a model, and writes predictions. Add a reproducible command-line interface with schema checks, explicit configuration, versioned artifacts, structured logs, and safe failure behavior.

Related Interview Questions

  • Reason About and Validate Virtual Card Transactions - Capital One (medium)
  • How would you improve card-type detection? - Capital One (easy)
  • Design a transaction class for deposits/withdrawals - Capital One (medium)
|Home/Software Engineering Fundamentals/Capital One

Test and Run a Reproducible Data Science Pipeline

Capital One logo
Capital One
May 31, 2026, 12:00 AM
mediumData ScientistTechnical ScreenSoftware Engineering Fundamentals
1
0

You inherit a Python data-science pipeline that loads a file, builds features, trains a model, and writes predictions. Describe the unit tests you would add and the command-line interface you would provide so the workflow can run reproducibly in local development and automation.

Constraints & Assumptions

  • Tests must use small synthetic fixtures rather than production data.
  • The pipeline should fail clearly on invalid input and should be runnable without editing source code.
  • The goal is to test the team's logic, not third-party library internals.

Clarifying Questions to Ask Guidance

  • Which stages are pure functions, and which read files or external resources?
  • What schema and invariants must input data satisfy?
  • Which artifacts should a run produce, and how should they be versioned?
  • Does the command need separate train, evaluate, and predict modes?

What a Strong Answer Covers Guidance

  • Unit tests for transformations, joins, leakage boundaries, edge cases, and deterministic metric calculations.
  • Integration tests for a tiny end-to-end run, with external I/O isolated or mocked appropriately.
  • Assertions for schema, uniqueness, row counts, ranges, missing values, and feature/target alignment.
  • A command-line design with explicit inputs, outputs, configuration, seeds, useful exit codes, and safe defaults.
  • Reproducible environments, structured logging, artifact metadata, and automation in continuous integration.

Follow-up Questions Guidance

  1. How would you test that a join does not duplicate observations?
  2. What should happen when a required column is missing?
  3. Which tests would detect training-serving preprocessing drift?
  4. When is mocking harmful in a data pipeline test?
Loading comments...

Browse More Questions

More Software Engineering Fundamentals•More Capital One•More Data Scientist•Capital One Data Scientist•Capital One Software Engineering Fundamentals•Data Scientist Software Engineering Fundamentals

Write your answer

Your first approved answer each day earns 20 XP.

Sign in to write your answer.
PracHub

Master your tech interviews with 8,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • AI Coding Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.