Loading...

The Hash Stamper

A easy Python interview practice problem on DataDriven. Write and execute real python code with instant grading.

Domain
Python
Difficulty
easy
Seniority
junior, mid

Problem

A user provisioning system needs to generate deterministic tokens from seed values for password initialization. Given a seed string and a desired length, return the first `length` characters of the SHA-256 hex digest of the seed. Use Python's built-in hashlib module.

Practice This Problem

Solve this Python problem with real code execution. DataDriven runs your Python code in a sandboxed Docker environment and grades it instantly.