Loading interview...
Unique Hostnames per Region
A medium SQL mock interview question on DataDriven. Practice with AI-powered feedback, real code execution, and a hire/no-hire decision.
- Domain
- SQL
- Difficulty
- medium
- Seniority
- senior
Interview Prompt
Our infrastructure inventory uses hostnames that share prefixes. Count unique hostnames per region, using only the first word of the hostname (case insensitive), so entries like 'web-server-01' and 'Web-server-02' share the same prefix. If reversed forms exist (like 'prod-db' and 'db-prod'), count them as the same. Return results by count descending, then region ascending.
How This Interview Works
- Read the vague prompt (just like a real interview)
- Ask clarifying questions to the AI interviewer
- Write your sql solution with real code execution
- Get instant feedback and a hire/no-hire decision