PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|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

  • Explain seasons and compound interest - Zoox (medium)
Zoox logo
Zoox
Dec 13, 2025, 12:00 AM
Frontend Engineer
Onsite
Software Engineering Fundamentals
7
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.

Solution

Show

Comments (0)

Sign in to leave a comment

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
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.