The Most Specific Rule Wins
A medium Python mock interview question on DataDriven. Practice with AI-powered feedback, real code execution, and a hire/no-hire decision.
- Domain
- Python
- Difficulty
- medium
- Seniority
- mid
Interview Prompt
Your edge proxy screens inbound traffic against a firewall table, where each rule pairs a CIDR block with either `allow` or `block`. A source IP's verdict comes from the most specific rule whose range contains it: when two equally specific rules both match, the one later in the table wins, and an address no rule covers is allowed through. Walk the request log and return each source IP's verdict in arrival order.
Summary
Every packet asks the same question of the firewall. Answer it the way the table intends.
How This Interview Works
- Read the vague prompt (just like a real interview)
- Ask clarifying questions to the AI interviewer
- Write your python solution with real code execution
- Get instant feedback and a hire/no-hire decision