Capital One·Data Scientist·Technical Phone Screen
Apr 2026
Capital One data scientist interview that was basically a live code review session on a buggy Python cart module. They handed you a repo, told you to run the tests, and then asked you to diagnose, fix, and restructure everything. Pretty thorough for what I expected to be a lighter technical screen.
- Walk through what this add_item function does on a single call versus across multiple calls, and identify at least three concrete design problems that could cause flaky tests or poor readability.
- Write a minimal pytest test that reliably exposes the shared mutable default bug for the discounts parameter. No external files, just plain asserts.
- Refactor add_item to remove global state and mutable defaults. Improve type safety and readability, maybe using dataclasses or typed dicts. Justify your API changes.
- How would you organize the test suite and fixtures for this module? How do you handle mocking time or randomness to keep tests deterministic?
- What exact shell commands would you run to set up the environment, pin dependencies for reproducibility, and run tests with coverage both locally and in CI?
“This was the meaty one.” The rest of the author's notes on Data Scientist interview at Capital One, Technical Phone Screen round, covers how they worked through the question, what the panel pushed back on, and what they would do differently.
View Post