Parking Fee Calculator: 30-Minute Grace Period, Started-Hour Billing, Daily Maximum

Quick Overview

Build a parking fee calculator in a senior full-stack coding round where an AI assistant writes the code: a 30-minute grace period, a fixed charge for each started hour and a daily maximum. It tests clarifying cross-day rules, writing a precise spec, keeping fee logic apart from I/O, choosing boundary tests and reviewing generated code.

Parking Fee Calculator: 30-Minute Grace Period, Started-Hour Billing, Daily Maximum

Company: Breeze

Role: Software Engineer

Category: Software Engineering Fundamentals

Difficulty: medium

Interview Round: Technical Screen

You are in the coding round for a senior full-stack engineer role (TypeScript, Node.js, React) at a payments startup. Two backend engineers run it. The task is a small real-world feature, and part of the round is done with an AI coding assistant of your choice. The task, shared in a document: > Imagine a real-world car park. Write a function that takes a vehicle's entry time and exit time and returns the fee owed. > > - The first 30 minutes are free (grace period). > - \$3 for each hour or part thereof. > - Daily maximum of \$24. The round runs in three phases, announced by email beforehand: 1. **Clarify.** Without AI, you lead the questions about requirements and scope. 2. **Plan.** Without AI, you write pseudocode or an implementation plan. 3. **Implement.** You must use the AI assistant to write the code, check syntax and generate the unit tests you specify. You lead the analysis, the decisions and the debugging. Any language is allowed. Write the code as if it will ship to production. The interviewers may add a requirement partway through. They score five areas: clarification and scope; interfaces and structure (calculation logic separated from I/O); correctness and edge cases (invalid input returns a meaningful error); testing and debugging; communication and reasoning. ### Constraints and Clarifications When asked, the interviewers confirmed: - "Part thereof" means every started hour is charged in full, with no proration. A 1.5-hour stay costs \$6. - The free 30 minutes are not deducted from a longer stay. A 45-minute stay is billed for all 45 minutes, which is one started hour, so it costs \$3. - Capacity does not matter: every vehicle finds a space. - Each input is one entry and one exit for one vehicle. Leaving and re-entering does not need handling. - Helper functions are fine, as long as one function takes the entry and exit times and returns the fee. - The output shows the fee together with the entry and exit times. - Treating timestamps as UTC instants is acceptable. ### Clarifying Questions - How does the daily maximum apply to a stay that crosses midnight or lasts longer than a day: per 24 hours counted from entry, or per calendar day, and in which time zone? - Does the grace period apply once per stay, or again on each day of a multi-day stay? - Is a stay of exactly 30 minutes free, and how are seconds beyond a whole minute counted? - What should happen when the exit time is before the entry time or a timestamp cannot be parsed? ### Part 1: Plan before any code exists Without the assistant, turn the clarified rules into a plan. The interviewers want to see how you normally plan work you will hand to an assistant, and you may write it in any editor. Produce the plan or spec you would give the assistant: purpose, inputs, outputs, every rule, the test cases you require and the structure you want. Be ready for their question: do you usually write the day and hour calculations out by hand before you start? ```hint Write for a reader with no context The assistant fills every gap in your spec with its own guess. Decide which details it must never have to guess. ``` #### What This Part Should Cover - A spec that states every rule with its numbers and the clarified edge cases. - Boundary test cases chosen before any implementation. - A planned structure that keeps the fee calculation apart from parsing, the clock and storage. - Open questions written down with the assumption you will code against. ### Part 2: Implement with the assistant and test Use the assistant to implement the calculator and the tests you specified. Treat the result as production code: validate input at the boundary, return a meaningful error for invalid input and keep the fee logic free of I/O. Explain your decisions while the assistant works. ```hint Find the pure core Decide which part of the problem depends only on two instants, and what has to sit around it. ``` #### What This Part Should Cover - Correct fees at the boundaries: 30 and 31 minutes, exact hours, exactly one day and stays longer than a day. - Money and time representations that cannot drift or be misread. - An interface that reports invalid input with a typed or coded error. - Tests organized so the cases you required stay visible. ### Part 3: Review the output and wrap up The assistant returns an implementation and a test suite in about a minute, and every test passes. Walk the interviewers through your review of the code and the tests. Then answer their closing question: are you satisfied with the code, and is there anything you would change? ```hint Trace the expected values A passing test shows only that the code agrees with the test. Check where each expected value came from. ``` #### What This Part Should Cover - Checking every rule and number in the code and the tests against the task statement. - Finding assumptions the assistant made on its own and settling them. - A concrete, prioritized list of changes, including the unresolved cross-day rule. ### What a Strong Answer Covers - The cross-day and boundary rules raised before any code exists. - A pure fee calculation separated from parsing, the clock and storage. - Exact money arithmetic and correct rounding at every boundary. - A precise spec for the assistant and a line-by-line review of what it produced. - Clear narration of each decision while the work happens. ### Follow-up Questions - How would the code change if the daily maximum applied per calendar day in the car park's local time zone, including the days when clocks change for daylight saving time? - How would you support a vehicle that leaves and comes back, and what would you ask about how the daily maximum treats the two visits? - Each car park has its own tariff. How would you make the grace period, hourly rate and daily maximum configurable without touching the fee logic? - Which property-based tests would catch a rounding or cap bug that example tests miss?

Overview: Build a parking fee calculator in a senior full-stack coding round where an AI assistant writes the code: a 30-minute grace period, a fixed charge for each started hour and a daily maximum. It tests clarifying cross-day rules, writing a precise spec, keeping fee logic apart from I/O, choosing boundary tests and reviewing generated code.

Read the full Breeze Software Engineer interview experience this question came from

Breeze logo
Breeze
Nov 26, 2026
mediumSoftware EngineerTechnical ScreenSoftware Engineering Fundamentals
1
0

You are in the coding round for a senior full-stack engineer role (TypeScript, Node.js, React) at a payments startup. Two backend engineers run it. The task is a small real-world feature, and part of the round is done with an AI coding assistant of your choice. The task, shared in a document:

Imagine a real-world car park. Write a function that takes a vehicle's entry time and exit time and returns the fee owed.

  • The first 30 minutes are free (grace period).
  • $3 for each hour or part thereof.
  • Daily maximum of $24.

The round runs in three phases, announced by email beforehand:

  1. Clarify. Without AI, you lead the questions about requirements and scope.
  2. Plan. Without AI, you write pseudocode or an implementation plan.
  3. Implement. You must use the AI assistant to write the code, check syntax and generate the unit tests you specify. You lead the analysis, the decisions and the debugging.

Any language is allowed. Write the code as if it will ship to production. The interviewers may add a requirement partway through. They score five areas: clarification and scope; interfaces and structure (calculation logic separated from I/O); correctness and edge cases (invalid input returns a meaningful error); testing and debugging; communication and reasoning.

Constraints and Clarifications

When asked, the interviewers confirmed:

  • "Part thereof" means every started hour is charged in full, with no proration. A 1.5-hour stay costs $6.
  • The free 30 minutes are not deducted from a longer stay. A 45-minute stay is billed for all 45 minutes, which is one started hour, so it costs $3.
  • Capacity does not matter: every vehicle finds a space.
  • Each input is one entry and one exit for one vehicle. Leaving and re-entering does not need handling.
  • Helper functions are fine, as long as one function takes the entry and exit times and returns the fee.
  • The output shows the fee together with the entry and exit times.
  • Treating timestamps as UTC instants is acceptable.

Clarifying Questions Guidance

  • How does the daily maximum apply to a stay that crosses midnight or lasts longer than a day: per 24 hours counted from entry, or per calendar day, and in which time zone?
  • Does the grace period apply once per stay, or again on each day of a multi-day stay?
  • Is a stay of exactly 30 minutes free, and how are seconds beyond a whole minute counted?
  • What should happen when the exit time is before the entry time or a timestamp cannot be parsed?

Part 1: Plan before any code exists

Without the assistant, turn the clarified rules into a plan. The interviewers want to see how you normally plan work you will hand to an assistant, and you may write it in any editor. Produce the plan or spec you would give the assistant: purpose, inputs, outputs, every rule, the test cases you require and the structure you want. Be ready for their question: do you usually write the day and hour calculations out by hand before you start?

What This Part Should Cover Guidance

  • A spec that states every rule with its numbers and the clarified edge cases.
  • Boundary test cases chosen before any implementation.
  • A planned structure that keeps the fee calculation apart from parsing, the clock and storage.
  • Open questions written down with the assumption you will code against.

Part 2: Implement with the assistant and test

Use the assistant to implement the calculator and the tests you specified. Treat the result as production code: validate input at the boundary, return a meaningful error for invalid input and keep the fee logic free of I/O. Explain your decisions while the assistant works.

What This Part Should Cover Guidance

  • Correct fees at the boundaries: 30 and 31 minutes, exact hours, exactly one day and stays longer than a day.
  • Money and time representations that cannot drift or be misread.
  • An interface that reports invalid input with a typed or coded error.
  • Tests organized so the cases you required stay visible.

Part 3: Review the output and wrap up

The assistant returns an implementation and a test suite in about a minute, and every test passes. Walk the interviewers through your review of the code and the tests. Then answer their closing question: are you satisfied with the code, and is there anything you would change?

What This Part Should Cover Guidance

  • Checking every rule and number in the code and the tests against the task statement.
  • Finding assumptions the assistant made on its own and settling them.
  • A concrete, prioritized list of changes, including the unresolved cross-day rule.

What a Strong Answer Covers Guidance

  • The cross-day and boundary rules raised before any code exists.
  • A pure fee calculation separated from parsing, the clock and storage.
  • Exact money arithmetic and correct rounding at every boundary.
  • A precise spec for the assistant and a line-by-line review of what it produced.
  • Clear narration of each decision while the work happens.

Follow-up Questions Guidance

  • How would the code change if the daily maximum applied per calendar day in the car park's local time zone, including the days when clocks change for daylight saving time?
  • How would you support a vehicle that leaves and comes back, and what would you ask about how the daily maximum treats the two visits?
  • Each car park has its own tariff. How would you make the grace period, hourly rate and daily maximum configurable without touching the fee logic?
  • Which property-based tests would catch a rounding or cap bug that example tests miss?