Citadel
More Experiences
Recent Experiences
Latest from community
Microsoft SDE Intern Interview Experience
microsoft4 reads
💼 LTIMindtree Interview Experience (On-Campus) | Fresher | 2026
ltimindtree5 reads
Salesforce SMTS | Interview Experience | Rejected
salesforce6 reads
JPMC | SDE2 (Associate) - Java Backend - Interview Experience + Compensation
jp morgan chase4 reads
Microsoft - SDE2 - Coding Round
microsoft7 reads
Citadel phone screen
June 10, 2025 • 4 reads
Summary
I had a phone screen with Citadel where I was asked to implement a Trie and its supporting functions, followed by an optimization question and a bonus question to find the longest prefix. I cleared the round.
Full Experience
Implement Trie and it's supporting functions -
* insert(word) - Insert a word in the trie,
- search(word) - search if the word exists in the trie, and
startsWith(prefix) - search if there exist any word which starts with <prefix>.
Clarified if we are only dealing with lowercase alphabets. Yes.
I implemented
TrieNode like below.class TrieNode{
int val;
vector<TrieNode*> children;
};
Follow up question.
Currently, we are occupying 26 space for children. How can we optimize it ?
Suggested to use a Map instead of vector.
class TrieNode{ int val; unordered_map<int, TrieNode*> child; };
// int denotes 0 for 'a', 1 for 'b', or you can do char too in this case. // I chose int.
Looks good.
Bonus question.
Implement
longestPrefixWhichStartsWithPrefix(prefix) - find the longest prefix which starts with a given prefix.
prefix = abc
words = [abcdef, abcdeg] -> abcde
Cleared the round.
Interview Questions (2)
Q1
Implement Trie and its Supporting Functions
Data Structures & AlgorithmsMedium
Implement Trie and it's supporting functions -
* insert(word) - Insert a word in the trie,
- search(word) - search if the word exists in the trie, and
startsWith(prefix) - search if there exist any word which starts with <prefix>.
Clarified if we are only dealing with lowercase alphabets. Yes.
Q2
Longest Prefix Which Starts With Prefix
Data Structures & AlgorithmsMedium
Implement
longestPrefixWhichStartsWithPrefix(prefix) - find the longest prefix which starts with a given prefix.
prefix = abc
words = [abcdef, abcdeg] -> abcde