Interview practice question
Password hard-coded in a script
Data Engineering · Python · Beginner
During a code review you find a database password hard-coded in a Python script that's already in Git. What do you do?
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- Treat the password as compromised and rotate it immediately.
- Remove it from code and read it from env vars or a secrets manager.
- Removing the line doesn't erase Git history.
- Add secret scanning to CI and pre-commit hooks.
- Explain the fix kindly to the developer.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.