Implement a trie with autocomplete

by ripple1953
Goldman Sachs
junior
coding
medium
pending
2
262

The interview began with the prompt to implement a trie with autocomplete functionality. I started by outlining the structure of the trie, explaining that it would use a series of nodes where each node represents a character in a word.

I was initially confident, and it felt like I could articulate my thought process well. However, I stumbled a bit while setting up the insert method, forgetting to consider edge cases for empty strings.

The interviewer was patient and asked clarifying questions that helped me realign my focus. After implementing basic operations like insert and search, I moved on to the autocomplete function using prefix matching.

Discussing the complexity was easier since I had practiced that part. At the end, I felt relieved but also realized I hadn't optimized for memory usage as well as I could have, which left me feeling slightly uneasy.

The interviewer thanked me for my effort and said they appreciated my problem-solving approach, but I didn’t get a clear indication of how well I did overall.


Markdown supported