Google L4 Coding Round 3 Question

Difficulty: MEDIUMCategory: InterviewExperienceFrequency: 1Asked On 2025-08-30Added By Anonymous
Source: Link

Company: Google
Role: L4
Interview Stage: Onsite
Location: unknown
Year: unknown

Original Post Content:

Question: Given a list of addresses as a set of tuples/lists: street_number, street_name, city_name, state_name; and a list of queries where each query is of length 4 but a possibility of NULL in the query. Example: ("A", NULL, "B", "C"). NULL matches any address here. We want to design an address matcher and return a list of matched addresses like True/False for each query.

I used Trie based solution for this, got negative feedback. Is there a better approach? TIA.

Edit: I think I forgot to mention a few points. There can be multiple null values per query. Also the address might not be just characters, they can be strings. Also by trie I meant 4 hashmaps each for street_number, street_name, city_name, state_name..etc.. and then querying it in a DFS fashion...

Comments