Match Camel Case Symbol Queries in an Internal Code Search Tool
Last updated: November 29, 2026
Quick Overview
Given a list of code symbols and a pattern like FoBa, return for each symbol whether it matches: the symbol must be obtainable by inserting only lowercase letters anywhere into the pattern.
Meta
November 29, 20260
0
0 solved
Given a list of code symbols and a pattern like FoBa, return for each symbol whether it matches: the symbol must be obtainable by inserting only lowercase letters anywhere into the pattern.
Meta engineers search a huge monorepo, and abbreviation matching like typing FBR for FeedBackRanker is a familiar tool feature. The interviewer checks a clean two-pointer scan and precise rules about which extra characters are allowed.
What the Interviewer Expects
- Use a two-pointer walk over symbol and pattern
- Allow skipping only lowercase characters in the symbol
- Fail on any unmatched uppercase character
- Require the whole pattern to be consumed
- Discuss how a trie of patterns could batch many patterns
Key Topics to Cover
How to Approach This
- Clarify input constraints and edge cases before writing code.
- Walk through your approach verbally and confirm with the interviewer before coding.
- Start with a brute force solution, then optimize. Mention time and space complexity.
- Test your solution with examples, including edge cases like empty input or duplicates.
- Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
- How would you rank matches by how compact they are?
- How would you let digits and underscores be skipped too?
- What if users type the pattern case-insensitively?
- How would you index millions of symbols for this query?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
- Symbols and pattern contain English letters.
- A symbol matches if deleting some lowercase letters from it yields exactly the pattern.
- Output: list of booleans, one per symbol....
High-Level Design
For each symbol, walk it with index i while a pointer j tracks the pattern. If symbol[i] == pattern[j], advance j. Otherwise the character must be an insertable lowercase letter; if it is uppe...