FastPrepFuzzy Word Lookup With One Misspelled Letter
Problems/Fuzzy Word Lookup With One Misspelled Letter

Fuzzy Word Lookup With One Misspelled Letter

Meta logoMeta● MediumNEW GRADPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a Meta phone screen (new grad, research scientist), as the second question of a coding round. The task was a dictionary lookup that tolerates one misspelled letter, where the query and the word must have the same length. A simple loop over the words came first, and the interviewer then asked for a faster lookup.

The report does not give examples, limits or the input and output format, and does not say whether an exact match counts. Here, the dictionary and the queries are lists of lowercase words, each query gets true or false, an exact match counts, and there are up to 5000 words and 1800 queries.

Our version is about 80% the same as the reported question.

You are given a list of words dictionary and a list of words queries. A query may have one misspelled letter. For each query, decide whether it matches a word in dictionary.

A query matches a word when both have the same length and differ in at most one position. An exact match counts. Inserting or deleting a letter changes the length, so a query of a different length never matches.

Return a boolean array answer where answer[j] is true if queries[j] matches at least one word in dictionary, and false otherwise.

Try to answer each query without comparing it with every word in dictionary.

Function

fuzzyLookup(dictionary: List<String>, queries: List<String>) → boolean[]

Examples

Example 1

dictionary = ["apple","apply","banana","grape"]queries = ["appla","banana","grope","bananas","aplpe"]return = [true,true,true,false,false]

"appla" differs from "apple" only in the last letter, "banana" is in the dictionary, and "grope" differs from "grape" only in the third letter. No dictionary word has seven letters, so "bananas" has no match. "aplpe" differs from "apple" in two positions and from "apply" in three.

Example 2

dictionary = ["cat"]queries = ["cut","cat","dog","ca"]return = [true,true,false,false]

"cut" has one wrong letter and "cat" has none, so both match. "dog" differs in all three positions, and "ca" is shorter than "cat".

Example 3

dictionary = ["mind","bond"]queries = ["bint","bind"]return = [false,true]

"bint" differs from "mind" in the first and last letters and from "bond" in the second and last letters, so it needs two fixes against either word. "bind" differs from "mind" only in the first letter.

Constraints

  • 1 <= dictionary.length <= 5 * 10^3
  • 1 <= queries.length <= 1800
  • 1 <= dictionary[i].length, queries[j].length <= 20
  • dictionary[i] and queries[j] consist of lowercase English letters.
  • Words may repeat in dictionary and in queries.

More Meta Phone Screen questions

  • Multi-Head Attention Forward PassPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Run-Length Encoded Vector Dot ProductPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Mutual-Friend RecommendationsPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Best Time to Buy and Sell StockPHONE SCREEN · Seen Nov 2026
  • First Element Greater Than KPHONE SCREEN · Seen Nov 2026
  • Count Events in Rolling Minute WindowsPHONE SCREEN · Seen Oct 2026
  • Valid Word AbbreviationPHONE SCREEN · Seen Oct 2026
  • Shortest Path in a Binary MatrixPHONE SCREEN · Seen Sep 2026
  • Deterministic K-Means AssignmentsPHONE SCREEN · ONSITE INTERVIEW · Seen Sep 2026
  • Values Exclusive to the Current UserPHONE SCREEN · Seen Sep 2026

Similar questions at other companies

  • Design File SystemGoogle · PHONE SCREENGoogle interview questions
  • Maximum Move ScoreAmazon · PHONE SCREEN
  • Detect Blocked Chat PhrasesWhatNot · PHONE SCREEN · ONSITE INTERVIEWWhatNot interview questions
  • Phrase Covering the Most WordsZip · PHONE SCREENZip interview questions
  • Indexed API Field Pattern QueriesStripe · PHONE SCREENStripe interview questions
  • Find Repeated Substrings Ignoring CaseDatadog · PHONE SCREENDatadog interview questions
  • Common Words from Two ReadersAkuna Capital · PHONE SCREENAkuna Capital interview questions
  • Design a File System with PathsAirbnb · PHONE SCREENAirbnb interview questions
  • Highlight and Rank Overlapping CitationsHarvey · PHONE SCREEN · ONSITE INTERVIEWHarvey interview questions
  • Word Break IIWex · PHONE SCREEN

Meta interview experiences

  • Meta PhD SWE Intern AI Coding Phone Screen: 1 Experience
  • Meta Business Support Engineer Phone Screen: 1 Experience
  • Meta Software Engineer Onsite Questions: 3 Experiences
  • Meta AI Native Engineer OA and Onsite: 1 Experience
  • Meta AI-Native Coding Interview: 3 Experiences
  • Meta Production Engineer Intern Questions: 6 Experiences
All Meta interview questionsSee Meta hiring insights
Saved
class Solution {
    public boolean[] fuzzyLookup(List<String> dictionary, List<String> queries) {
        // Write your code here.
    }
}
Checking account…