PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Moveworks

Find a secret word via match feedback

Last updated: Mar 29, 2026

Quick Overview

This question evaluates algorithmic search, pattern-matching, and information-elimination skills in an interactive Mastermind-style word-guessing scenario, testing string comparison and combinatorial reasoning under constrained feedback.

  • medium
  • Moveworks
  • Coding & Algorithms
  • Software Engineer

Find a secret word via match feedback

Company: Moveworks

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Onsite

## Word Guessing Game (Mastermind-style) You are given a list of **unique** candidate words `wordlist`. All words have the same length `L` and contain only lowercase letters. There is an unknown **secret** word that is guaranteed to be in `wordlist`. You can make a guess by choosing any word from `wordlist`. After each guess, you receive an integer `k` meaning: - `k` = the number of positions `i` where `guess[i] == secret[i]` (exact position matches). ### Task Design a strategy/function that finds the secret word using at most `G` guesses. ### Interface (conceptual) - You can call `match(guess) -> int` to get the feedback `k`. - You must output the secret word (or stop once identified). ### Constraints - `1 <= |wordlist| <= 1000` - `1 <= L <= 10` - Maximum allowed guesses `G` (e.g., `G = 10`) ### Notes - The interviewer may simulate `match()`. - Your approach should be efficient enough to work within the guess limit.

Quick Answer: This question evaluates algorithmic search, pattern-matching, and information-elimination skills in an interactive Mastermind-style word-guessing scenario, testing string comparison and combinatorial reasoning under constrained feedback.

Related Interview Questions

  • Compute Jaccard similarity between two strings - Moveworks (medium)
  • Select next Hangman letter - Moveworks (Medium)
Moveworks logo
Moveworks
Dec 15, 2025, 12:00 AM
Software Engineer
Onsite
Coding & Algorithms
7
0

Word Guessing Game (Mastermind-style)

You are given a list of unique candidate words wordlist. All words have the same length L and contain only lowercase letters.

There is an unknown secret word that is guaranteed to be in wordlist. You can make a guess by choosing any word from wordlist. After each guess, you receive an integer k meaning:

  • k = the number of positions i where guess[i] == secret[i] (exact position matches).

Task

Design a strategy/function that finds the secret word using at most G guesses.

Interface (conceptual)

  • You can call match(guess) -> int to get the feedback k .
  • You must output the secret word (or stop once identified).

Constraints

  • 1 <= |wordlist| <= 1000
  • 1 <= L <= 10
  • Maximum allowed guesses G (e.g., G = 10 )

Notes

  • The interviewer may simulate match() .
  • Your approach should be efficient enough to work within the guess limit.

Submit Your Answer

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Moveworks•More Software Engineer•Moveworks Software Engineer•Moveworks Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 8,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.