PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Moveworks

Select next Hangman letter

Last updated: Mar 29, 2026

Quick Overview

This question evaluates algorithm design and string-processing skills, specifically pattern filtering, frequency analysis across candidate words, set operations for excluding guessed letters, deterministic tie-breaking, and complexity reasoning.

  • Medium
  • Moveworks
  • Coding & Algorithms
  • Software Engineer

Select next Hangman letter

Company: Moveworks

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Technical Screen

Given the current state of a Hangman game, implement a function that selects the next letter with the highest likelihood of appearing in the secret word. Inputs: ( 1) the current pattern string showing revealed letters and placeholders (e.g., '_' for unknowns), ( 2) the set of letters already guessed (both correct and incorrect), and ( 3) a dictionary (word list). Compute the set of candidate words consistent with the pattern and excluding any letters known to be absent; then, among letters not yet guessed, choose the one that maximizes aggregate frequency across the candidate set. Clearly describe preprocessing of inputs, your algorithm, and time/space complexity. Specify and implement a deterministic tie-breaking policy for letters with equal frequency.

Quick Answer: This question evaluates algorithm design and string-processing skills, specifically pattern filtering, frequency analysis across candidate words, set operations for excluding guessed letters, deterministic tie-breaking, and complexity reasoning.

Related Interview Questions

  • Find a secret word via match feedback - Moveworks (medium)
  • Compute Jaccard similarity between two strings - Moveworks (medium)
Moveworks logo
Moveworks
Sep 6, 2025, 12:00 AM
Software Engineer
Technical Screen
Coding & Algorithms
14
0

Given the current state of a Hangman game, implement a function that selects the next letter with the highest likelihood of appearing in the secret word. Inputs: (

  1. the current pattern string showing revealed letters and placeholders (e.g., '_' for unknowns), (
  2. the set of letters already guessed (both correct and incorrect), and (
  3. a dictionary (word list). Compute the set of candidate words consistent with the pattern and excluding any letters known to be absent; then, among letters not yet guessed, choose the one that maximizes aggregate frequency across the candidate set. Clearly describe preprocessing of inputs, your algorithm, and time/space complexity. Specify and implement a deterministic tie-breaking policy for letters with equal frequency.

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.