Question bank › Trie
Dsa Trie Easy

Subdomain Firewall

A firewall blocks traffic to specific domains. If 'badsite.com' is blocked, then 'mail.badsite.com' and 'api.v1.badsite.com' are also blocked. However, 'goodsite.com' or 'badsite.net' are not blocked. Given a list of blocked domains and a list of queries, determine if each query is 'BLOCKED' or 'ALLOWED'. Example: Input: 1 badsite.com 2 api.badsite.com google.com Output: BLOCKED ALLOWED

Key concepts

triesuffix-matchingreverse-strings

Practise this out loud — free

Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.

🎙 Practise this question now
Part of InterviewLab's verified interview question bank. We show the prompt and concepts to practise with — never a copy-paste solution.