Identify Bugs in Python Script for User Assignment
OpenAIData Scientist · Online AssessmentLast 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.
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.