PracHub
QuestionsCoachesLearningGuidesInterview Prep
|Home/Software Engineering Fundamentals/Zoox

Build a Stateful Calculator

Last updated: May 11, 2026

Quick Overview

This question evaluates a candidate's ability to model and manage UI state, handle event-driven input, and implement correct operator chaining in a calculator component, testing frontend state management and user interface behavior within the software engineering fundamentals domain.

  • hard
  • Zoox
  • Software Engineering Fundamentals
  • Frontend Engineer

Build a Stateful Calculator

Company: Zoox

Role: Frontend Engineer

Category: Software Engineering Fundamentals

Difficulty: hard

Interview Round: Onsite

Implement a calculator UI component. Requirements: - Support digit input and the operators `+`, `-`, `*`, and `/`. - Support `=` to finalize the current calculation. - Support a reset action that clears the calculator state. - The display must update correctly during chained operations, not only at the very end. Example behavior: - Input: `1`, `+`, `100`, `+`, `20`, `=` - When the second `+` is pressed, the display should immediately show `101`. - After `=` is pressed, the display should show `121`. Explain how you would model the calculator state and implement operator chaining so the UI always shows the correct current value.

Quick Answer: This question evaluates a candidate's ability to model and manage UI state, handle event-driven input, and implement correct operator chaining in a calculator component, testing frontend state management and user interface behavior within the software engineering fundamentals domain.

Related Interview Questions

  • Design Transaction Data Quality Checks - Zoox (medium)
  • Explain seasons and compound interest - Zoox (medium)
|Home/Software Engineering Fundamentals/Zoox

Build a Stateful Calculator

Zoox logo
Zoox
Dec 13, 2025, 12:00 AM
hardFrontend EngineerOnsiteSoftware Engineering Fundamentals
10
0
Loading...

Implement a calculator UI component.

Requirements:

  • Support digit input and the operators + , - , * , and / .
  • Support = to finalize the current calculation.
  • Support a reset action that clears the calculator state.
  • The display must update correctly during chained operations, not only at the very end.

Example behavior:

  • Input: 1 , + , 100 , + , 20 , =
  • When the second + is pressed, the display should immediately show 101 .
  • After = is pressed, the display should show 121 .

Explain how you would model the calculator state and implement operator chaining so the UI always shows the correct current value.

Loading comments...

Browse More Questions

More Software Engineering Fundamentals•More Zoox•More Frontend Engineer•Zoox Frontend Engineer•Zoox Software Engineering Fundamentals•Frontend Engineer Software Engineering Fundamentals

Write your answer

Your first approved answer each day earns 20 XP.

Sign in to write your answer.
PracHub

Master your tech interviews with 8,000+ 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
  • AI Coding 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.