PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Dropbox

Build a hit/miss word guessing game

Last updated: Mar 29, 2026

Quick Overview

This question evaluates implementation skills in managing stateful systems and data structures for pattern matching, as well as algorithmic and adversarial reasoning about information gain and search strategies when the secret can change.

  • medium
  • Dropbox
  • Coding & Algorithms
  • Software Engineer

Build a hit/miss word guessing game

Company: Dropbox

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Technical Screen

Two players play a word guessing game. - Player A chooses a **secret word**. - Player B repeatedly guesses **single letters**. - After each guess, the game reports: - **hit** if the secret word contains the guessed letter, and all occurrences of that letter are revealed in the current pattern - **miss** otherwise, and the letter is added to a `misses` list The interviewer will provide an example interaction to confirm behavior. ## Part 1 — Implement the game engine Design and implement data structures and functions to support: - Initializing a game with a secret word - Processing a guessed letter and returning updated state - Tracking revealed letters (e.g., pattern like `_ _ a _ a`) - Tracking missed letters (in insertion order) ### Inputs/Outputs (one possible shape) - Input: `secretWord`, then a sequence of guessed letters - Output after each guess: `{ result: "hit"|"miss", pattern, misses }` ## Part 2 (Follow-up) — Secret word may change mid-game Now Player A is allowed to **change the secret word during the game**, as long as it remains consistent with all previous responses (hits/misses and revealed pattern). Player B wants to **minimize the number of guesses** needed to fully determine the word. Discuss an approach and write high-level pseudocode for the strategy Player B should use. Assumptions you may make (state clearly): - There is a known dictionary/set of candidate words of the same length. - Only letter guesses are allowed (no full-word guesses), unless you explicitly add that rule. - Letters may or may not be repeated in guesses (specify behavior).

Quick Answer: This question evaluates implementation skills in managing stateful systems and data structures for pattern matching, as well as algorithmic and adversarial reasoning about information gain and search strategies when the secret can change.

Related Interview Questions

  • Compute worst-case guesses for adaptive hangman - Dropbox (medium)
  • Return all files under a path - Dropbox (medium)
  • Implement feedback for word guessing game - Dropbox (medium)
  • Implement hierarchical folder access check - Dropbox (medium)
  • Review checkout code for defects and privacy - Dropbox (Medium)
Dropbox logo
Dropbox
Jan 22, 2026, 12:00 AM
Software Engineer
Technical Screen
Coding & Algorithms
6
0
Loading...

Two players play a word guessing game.

  • Player A chooses a secret word .
  • Player B repeatedly guesses single letters .
  • After each guess, the game reports:
    • hit if the secret word contains the guessed letter, and all occurrences of that letter are revealed in the current pattern
    • miss otherwise, and the letter is added to a misses list

The interviewer will provide an example interaction to confirm behavior.

Part 1 — Implement the game engine

Design and implement data structures and functions to support:

  • Initializing a game with a secret word
  • Processing a guessed letter and returning updated state
  • Tracking revealed letters (e.g., pattern like _ _ a _ a )
  • Tracking missed letters (in insertion order)

Inputs/Outputs (one possible shape)

  • Input: secretWord , then a sequence of guessed letters
  • Output after each guess: { result: "hit"|"miss", pattern, misses }

Part 2 (Follow-up) — Secret word may change mid-game

Now Player A is allowed to change the secret word during the game, as long as it remains consistent with all previous responses (hits/misses and revealed pattern).

Player B wants to minimize the number of guesses needed to fully determine the word.

Discuss an approach and write high-level pseudocode for the strategy Player B should use.

Assumptions you may make (state clearly):

  • There is a known dictionary/set of candidate words of the same length.
  • Only letter guesses are allowed (no full-word guesses), unless you explicitly add that rule.
  • Letters may or may not be repeated in guesses (specify behavior).

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Dropbox•More Software Engineer•Dropbox Software Engineer•Dropbox 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.