PracHub
QuestionsLearningGuidesInterview Prep
|Home/Software Engineering Fundamentals/Amazon

Model an Extensible Employee Cost Calculator

Last updated: Jul 28, 2026

Quick Overview

Model an extensible employee cost calculator combining salary, tax, benefits, and a signed location adjustment. Discuss precise money handling, explicit missing policies, canonical identifiers, versioned configuration, reproducible breakdowns, and boundary-focused tests.

  • medium
  • Amazon
  • Software Engineering Fundamentals
  • Software Engineer

Model an Extensible Employee Cost Calculator

Company: Amazon

Role: Software Engineer

Category: Software Engineering Fundamentals

Difficulty: medium

Interview Round: Onsite

Design an object model and calculation API for the total cost of an employee. Total cost has four components: 1. Base salary from the employee record. 2. Tax as a fixed percentage of base salary. 3. Benefits from a lookup keyed by `(level, title)`. 4. A positive or negative location adjustment from a lookup keyed by location. Define the necessary types and implement the calculation conceptually. Explain validation, money representation, missing lookup entries, configuration versioning, and tests. The goal is an extensible design, not a hard-coded chain of conditionals. ### Constraints & Assumptions - All monetary values use one declared currency for a single calculation. - Tax rate and lookup tables are supplied configuration, not global constants hidden inside the employee class. - Level, title, and location use canonical identifiers. - A calculation should be reproducible after compensation rules change. ### Clarifying Questions to Ask - Is tax truly a single fixed rate, or can it vary by employee or location? - Should a missing benefit or location rule fail, default to zero, or use a fallback hierarchy? - Are adjustments annual amounts or percentages? - What rounding mode and currency precision are required? ### What a Strong Answer Covers - Separates employee data, policy configuration, lookup interfaces, and calculation output. - Uses decimal or integer minor-unit money rather than binary floating point. - Returns a component breakdown as well as the total. - Makes missing configuration explicit and validates canonical composite keys. - Versions policy data so results are auditable and reproducible. - Tests normal, boundary, negative-adjustment, missing-rule, and rounding cases. ### Follow-up Questions 1. How would you support progressive tax brackets without changing callers? 2. How would effective-dated policy changes be applied to historical calculations? 3. What should happen if salary and adjustment inputs use different currencies?

Quick Answer: Model an extensible employee cost calculator combining salary, tax, benefits, and a signed location adjustment. Discuss precise money handling, explicit missing policies, canonical identifiers, versioned configuration, reproducible breakdowns, and boundary-focused tests.

Related Interview Questions

  • Explain BIOS and UEFI Firmware Mechanisms - Amazon (hard)
  • Design a File Searcher With Symbolic Links - Amazon (medium)
  • Design a Concurrent Restaurant Waitlist and Seating System - Amazon (easy)
  • Implement an Accessible Autocomplete Search Component - Amazon (medium)
  • Debug Watch List Movie Operations - Amazon (medium)
|Home/Software Engineering Fundamentals/Amazon

Model an Extensible Employee Cost Calculator

Amazon logo
Amazon
Feb 2, 2026, 12:00 AM
mediumSoftware EngineerOnsiteSoftware Engineering Fundamentals
0
0

Design an object model and calculation API for the total cost of an employee. Total cost has four components:

  1. Base salary from the employee record.
  2. Tax as a fixed percentage of base salary.
  3. Benefits from a lookup keyed by (level, title) .
  4. A positive or negative location adjustment from a lookup keyed by location.

Define the necessary types and implement the calculation conceptually. Explain validation, money representation, missing lookup entries, configuration versioning, and tests. The goal is an extensible design, not a hard-coded chain of conditionals.

Constraints & Assumptions

  • All monetary values use one declared currency for a single calculation.
  • Tax rate and lookup tables are supplied configuration, not global constants hidden inside the employee class.
  • Level, title, and location use canonical identifiers.
  • A calculation should be reproducible after compensation rules change.

Clarifying Questions to Ask Guidance

  • Is tax truly a single fixed rate, or can it vary by employee or location?
  • Should a missing benefit or location rule fail, default to zero, or use a fallback hierarchy?
  • Are adjustments annual amounts or percentages?
  • What rounding mode and currency precision are required?

What a Strong Answer Covers Guidance

  • Separates employee data, policy configuration, lookup interfaces, and calculation output.
  • Uses decimal or integer minor-unit money rather than binary floating point.
  • Returns a component breakdown as well as the total.
  • Makes missing configuration explicit and validates canonical composite keys.
  • Versions policy data so results are auditable and reproducible.
  • Tests normal, boundary, negative-adjustment, missing-rule, and rounding cases.

Follow-up Questions Guidance

  1. How would you support progressive tax brackets without changing callers?
  2. How would effective-dated policy changes be applied to historical calculations?
  3. What should happen if salary and adjustment inputs use different currencies?
Loading comments...

Browse More Questions

More Software Engineering Fundamentals•More Amazon•More Software Engineer•Amazon Software Engineer•Amazon Software Engineering Fundamentals•Software 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 9,000+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities

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.