Debug a Movie App: Actor-Follow Notifications, Badge Count and Movie Publishing

Quick Overview

A full-stack movie database app has broken notifications: wrong badge numbers, garbled notification content, failing admin publishing, and followers not notified about new movies with their actors. Explain how to reproduce, localize and fix each bug, and how the follow, publish and notify flow should work.

Debug a Movie App: Actor-Follow Notifications, Badge Count and Movie Publishing

Company: Amazon

Role: Software Engineer

Category: Software Engineering Fundamentals

Difficulty: medium

Interview Round: Online Assessment

An online assessment section hands you an existing full-stack movie database application (a web front end, a back end and a database) and 60 minutes to repair it. The application has two kinds of accounts: - **User accounts** can follow actors. When an actor a user follows has a new movie published, the user should receive a notification. The notification list shows each notification's content, and a badge shows a number. - **Admin accounts** can add new movies and publish them. Publishing a movie should notify the users who follow its actors. Several features are broken: 1. **Notification display:** the badge number is wrong, and notification content is displayed incorrectly. 2. Publishing a movie from an admin account does not work correctly. 3. **Notification delivery:** after a user follows an actor, the user does not correctly receive a notification when a new movie with that actor is published. The codebase itself was not reported, so treat this as a debugging walk-through. For each problem, explain how you would reproduce it, how you would localize it across the layers, which root causes are most likely, how you would fix them, and how you would confirm the fix. ### Clarifying Questions - What should the badge count: unread notifications, all notifications, or notifications that arrived since the list was last opened? When does it go down? - Should a user who follows two actors in the same movie receive one notification or two? - Is publishing a separate step after adding, so that a movie that was added but not published must notify nobody? Can a movie be published twice? - Should a user who follows an actor after a movie was published be notified about that movie? - Are notifications stored when a movie is published, or computed when the user opens the list? ### Part 1: Notification display The badge shows the wrong number, and notification content renders incorrectly. Explain how you would find where each value goes wrong and what the badge should be computed from. ```hint Follow one notification Take a single notification and compare its stored row, the API response and what the page draws; the first place they disagree is where to look. ``` #### What This Part Should Cover - A precise definition of the badge value and the query or state that produces it - Tracing a notification from database row to API payload to rendered component - Candidate causes for a wrong count and for malformed content, each with a check that confirms or rules it out - Keeping the badge and the list consistent after reading, after new arrivals and after a reload ### Part 2: Admin publishing An admin can add a movie, but publishing it fails or does not have the intended effect. Explain how you would narrow down the failure and what a correct publish operation must do. ```hint Separate the state change from its side effects Check whether the movie's published state changes at all before investigating who gets notified. ``` #### What This Part Should Cover - Reproducing as an admin and reading the request, the response and the server error - Authorization and validation on the publish endpoint - The state change from unpublished to published and whether it is persisted - Making publishing safe to retry, so that it neither fails nor notifies twice ### Part 3: Notification delivery A user follows an actor, an admin publishes a movie with that actor, and the user gets no notification or the wrong one. Explain how you would find the break and how the fan-out from a published movie to its actors' followers should work. ```hint Check each stored link The chain depends on several stored links: the follow, the movie's cast, and the notification rows. Verify each one exists with the IDs you expect. ``` #### What This Part Should Cover - Verifying that the follow is stored for the right user and actor - The query from a published movie's cast to the followers who should be notified, including deduplication - Where the fan-out runs (inside the publish request or in a background job) and how failures are retried - Tests that cover follow, publish and receive end to end ### What a Strong Answer Covers - Reproducing each bug before changing code, and confirming each fix with a test - Layer-by-layer localization (page, API, service logic, database) rather than guessing - A clear model of the intended follow, publish and notify flow and its invariants - Small, targeted fixes that do not break the other account type's features - Prioritizing within the time limit, and noticing when one root cause explains several symptoms ### Follow-up Questions - An actor has a very large number of followers. How would publishing change so that it stays fast? - How would you push new notifications to an open page instead of waiting for a reload, and keep the badge correct across several open tabs? - An admin double-clicks Publish. What prevents duplicate notifications? - Which automated tests would you add so that these bugs cannot return?

Overview: A full-stack movie database app has broken notifications: wrong badge numbers, garbled notification content, failing admin publishing, and followers not notified about new movies with their actors. Explain how to reproduce, localize and fix each bug, and how the follow, publish and notify flow should work.

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

Amazon logo
Amazon
Nov 13, 2026
mediumSoftware EngineerOnline AssessmentSoftware Engineering Fundamentals
2
0

An online assessment section hands you an existing full-stack movie database application (a web front end, a back end and a database) and 60 minutes to repair it. The application has two kinds of accounts:

  • User accounts can follow actors. When an actor a user follows has a new movie published, the user should receive a notification. The notification list shows each notification's content, and a badge shows a number.
  • Admin accounts can add new movies and publish them. Publishing a movie should notify the users who follow its actors.

Several features are broken:

  1. Notification display: the badge number is wrong, and notification content is displayed incorrectly.
  2. Publishing a movie from an admin account does not work correctly.
  3. Notification delivery: after a user follows an actor, the user does not correctly receive a notification when a new movie with that actor is published.

The codebase itself was not reported, so treat this as a debugging walk-through. For each problem, explain how you would reproduce it, how you would localize it across the layers, which root causes are most likely, how you would fix them, and how you would confirm the fix.

Clarifying Questions Guidance

  • What should the badge count: unread notifications, all notifications, or notifications that arrived since the list was last opened? When does it go down?
  • Should a user who follows two actors in the same movie receive one notification or two?
  • Is publishing a separate step after adding, so that a movie that was added but not published must notify nobody? Can a movie be published twice?
  • Should a user who follows an actor after a movie was published be notified about that movie?
  • Are notifications stored when a movie is published, or computed when the user opens the list?

Part 1: Notification display

The badge shows the wrong number, and notification content renders incorrectly. Explain how you would find where each value goes wrong and what the badge should be computed from.

What This Part Should Cover Guidance

  • A precise definition of the badge value and the query or state that produces it
  • Tracing a notification from database row to API payload to rendered component
  • Candidate causes for a wrong count and for malformed content, each with a check that confirms or rules it out
  • Keeping the badge and the list consistent after reading, after new arrivals and after a reload

Part 2: Admin publishing

An admin can add a movie, but publishing it fails or does not have the intended effect. Explain how you would narrow down the failure and what a correct publish operation must do.

What This Part Should Cover Guidance

  • Reproducing as an admin and reading the request, the response and the server error
  • Authorization and validation on the publish endpoint
  • The state change from unpublished to published and whether it is persisted
  • Making publishing safe to retry, so that it neither fails nor notifies twice

Part 3: Notification delivery

A user follows an actor, an admin publishes a movie with that actor, and the user gets no notification or the wrong one. Explain how you would find the break and how the fan-out from a published movie to its actors' followers should work.

What This Part Should Cover Guidance

  • Verifying that the follow is stored for the right user and actor
  • The query from a published movie's cast to the followers who should be notified, including deduplication
  • Where the fan-out runs (inside the publish request or in a background job) and how failures are retried
  • Tests that cover follow, publish and receive end to end

What a Strong Answer Covers Guidance

  • Reproducing each bug before changing code, and confirming each fix with a test
  • Layer-by-layer localization (page, API, service logic, database) rather than guessing
  • A clear model of the intended follow, publish and notify flow and its invariants
  • Small, targeted fixes that do not break the other account type's features
  • Prioritizing within the time limit, and noticing when one root cause explains several symptoms

Follow-up Questions Guidance

  • An actor has a very large number of followers. How would publishing change so that it stays fast?
  • How would you push new notifications to an open page instead of waiting for a reload, and keep the badge correct across several open tabs?
  • An admin double-clicks Publish. What prevents duplicate notifications?
  • Which automated tests would you add so that these bugs cannot return?