New
ML System Design & SQL tracks just landed
See what's new
×
Question Bank
Pricing
Blog
Forum
HOT
Referral
Description
Solution
Discussion
Submissions
Ask AI
Question Bank
Coding Question
AI Insights
Quick Summary
Implement a firewall class that evaluates IPv4 addresses against an ordered list of ALLOW/DENY rules.
Rules can specify single hosts or CIDR blocks, with decision priority determined strictly by insertion order.
Return true or false based on the action of the first rule that matches the queried IP.
What This Tests
Bitwise manipulation and 32-bit integer arithmetic
Network addressing fundamentals and CIDR prefix matching
Ordered data structure traversal and priority-based filtering
String parsing and data normalization
Common Patterns
Bit Manipulation
Collapse
Hint 1
Hint 2
Hint 3
What Interviewers May Ask Next
Accepted
3.7k
/9.6k
Acceptance Rate
38.8%
Ask AI Assistant
Ask AI Assistant
Ask me anything about this coding question!
Qwen
Qwen3.6-Flash
0/2000
Auto
Debug
Run
Submit
Test Cases
Input
Output
Expected