# One in Five

> Green, green, red, green.

Canonical URL: <https://datadriven.io/problems/dbt-test-flake>

Domain: ai_coding · Difficulty: easy · Seniority: L4

## Problem

Analytics ships fct_payments through dbt nightly. The unique test on payment_id passes locally every time, fails in CI ~20% of runs. Same input fixtures, same model SQL. Run tests/test_uniqueness.py to reproduce, then fix the model so the test is deterministic. The fix is in the SQL, not the test.

## Related

- [All practice problems](https://datadriven.io/problems)
- [Mock interview mode](https://datadriven.io/interview/dbt-test-flake)
- [Data Engineering Interview Prep Guide](https://datadriven.io/data-engineer-interview-prep)
- [Daily Challenge](https://datadriven.io/daily)

---

Source: DataDriven (https://datadriven.io). 100% free data engineering interview prep. Live code execution against Postgres 16, Python 3.11, and Spark sandboxes. No paywall, no premium tier, no signup gate.