Katkat

Identify Bugs in Python Script for User Assignment

OpenAIData Scientist · Online Assessment

Last updated

This question evaluates a candidate's ability to detect bugs and data-quality risks in a Python script, testing competencies in code review, reproducible randomization, idempotency, logging, duplicate-exposure safeguards, and safe experiment-assignment logic.

Scenario

A simple Python script assigns users to experiment groups and triggers the free-trial offer.

Question

Inspect the script and list any bugs or data-quality risks you notice. Suggest concrete refactors or additional checks that would make the assignment and triggering logic safer and more reproducible.

Hints

Think about seeding randomness, idempotency, logging and duplicate exposure safeguards.