PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Software Engineering Fundamentals/Waymo

Build a React naval board

Last updated: Apr 6, 2026

Quick Overview

This question evaluates proficiency in React component architecture, state management, event handling, and UI-state synchronization for interactive front-end interfaces.

  • medium
  • Waymo
  • Software Engineering Fundamentals
  • Frontend Engineer

Build a React naval board

Company: Waymo

Role: Frontend Engineer

Category: Software Engineering Fundamentals

Difficulty: medium

Interview Round: Technical Screen

Build a simplified naval-grid game board in React. Requirements: - Render an `N x N` grid, for example `10 x 10`. - Ignore multiplayer, turn-taking, and networking. - You are given a fixed list of ships, where each ship occupies a set of coordinates on the board. - Each cell can be clicked to cycle through three visual states: `empty`, `white`, and `red`. - Treat `red` as a hit on a ship segment and `white` as a miss. - Show a status panel listing all ships as `sunk` or `not sunk`. - A ship is considered `sunk` only if every coordinate occupied by that ship is currently marked `red`. Discuss and implement: 1. The React component structure for the grid and status panel. 2. State management for cell states and ship definitions. 3. The click handler that updates a cell's state. 4. The logic for computing whether each ship is sunk. 5. Edge cases such as repeated clicks, reset behavior, and keeping rendering logic separate from game logic.

Quick Answer: This question evaluates proficiency in React component architecture, state management, event handling, and UI-state synchronization for interactive front-end interfaces.

Related Interview Questions

  • Design a Ride Scheduler - Waymo (medium)
Waymo logo
Waymo
Apr 1, 2026, 12:00 AM
Frontend Engineer
Technical Screen
Software Engineering Fundamentals
4
0

Build a simplified naval-grid game board in React.

Requirements:

  • Render an N x N grid, for example 10 x 10 .
  • Ignore multiplayer, turn-taking, and networking.
  • You are given a fixed list of ships, where each ship occupies a set of coordinates on the board.
  • Each cell can be clicked to cycle through three visual states: empty , white , and red .
  • Treat red as a hit on a ship segment and white as a miss.
  • Show a status panel listing all ships as sunk or not sunk .
  • A ship is considered sunk only if every coordinate occupied by that ship is currently marked red .

Discuss and implement:

  1. The React component structure for the grid and status panel.
  2. State management for cell states and ship definitions.
  3. The click handler that updates a cell's state.
  4. The logic for computing whether each ship is sunk.
  5. Edge cases such as repeated clicks, reset behavior, and keeping rendering logic separate from game logic.

Solution

Show

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Software Engineering Fundamentals•More Waymo•More Frontend Engineer•Waymo Frontend Engineer•Waymo Software Engineering Fundamentals•Frontend Engineer Software Engineering Fundamentals
PracHub

Master your tech interviews with 7,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.