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

  1. Read the vague prompt (just like a real interview)
  2. Ask clarifying questions to the AI interviewer
  3. Write your sql solution with real code execution
  4. Get instant feedback and a hire/no-hire decision