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
Coding & Algorithms
Software Engineer
Meta
November 29, 2026
Software Engineer
Phone Screen
Coding & Algorithms
Medium

0

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
two pointers
string parsing
pattern matching
code search
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. 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 Problems
Sample 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...


Submit Your Answer
Markdown supported