Databricks phone screen, moving to onsite
Result: Pending (moving to onsite) Number of Rounds: 1
Databricks phone screen, 45 minutes.
Got IP CIDR Firewall, given a set of firewall rules in CIDR notation and an IP address, determine whether the IP is allowed or blocked based on priority ordering. Rules can have overlapping ranges.
The core approach is parsing CIDR notation into a subnet mask: convert the IP to a 32-bit integer, create a mask from the prefix length by shifting bits, AND them together to get the network address, then do the same comparison for the incoming IP. If the network bits match, the rule applies. Worked through the bit manipulation step by step with the interviewer, they seemed engaged.
First follow-up was IPv6 handling. Noted the address space is 128 bits instead of 32, structurally the same approach with wider integers. Second follow-up was about scaling to thousands of rules evaluated per second. Talked through a trie-based approach on the binary representation of IPs, where each bit becomes a branching node, but acknowledged I'd need more time to work through trie construction fully.
Interviewer said we'd go deeper in the onsite loop. Onsite scheduled next week.