Skip to main content
All Questions

Fix the MovieDB watchlist bug in a Spring Boot app.

Unlock detailed company stats for this questionUpgrade

40-minute Spring Boot task. The app has a WatchlistController and a WatchlistRepository with all required methods already defined. Fixes needed:

  • Add to watchlist: the controller was missing the repository save call.
  • Remove from watchlist: the controller was missing the repository delete call.
  • Add: reject duplicates with HTTP 400 and message "Movie already in watchlist" when existsByMovieAndUser(movie, user) is true.
  • Remove: return HTTP 404 with message "Movie not found in watchlist" when the movie is not in the watchlist.
  • Rate limiting with the provided RateLimitingUtil, which holds a Map<String, List<LocalDateTime>> of user operations: implement registerOperation (append the current timestamp) and isRateLimited (true if operations in the last 2 minutes exceed the limit), and apply it to the add and remove endpoints, returning HTTP 429 when rate limited.

Expect follow-ups like

  • Fix the rate limiting.
  • Fix the password length constraints.

Format · 60-minute backend section of the OA; the candidate picks a backend framework at the start.

Also asked as · Fix the broken watchlist feature in a Spring Boot MovieDB application.

Community answers

No answers contributed by the community yet.

Related courses

Course

Software Engineering Interview Prep

Land your dream software engineering role at Google, Amazon, Microsoft, Meta, Apple, and other top companies. Learn from mock interviews, frameworks, and advice from senior candidates—practice data structures, algorithms, system design, people management, behavioral interviews, and more.

Course

System Design Interviews

Learn how to answer the latest system design questions across product, infrastructure, and AI domains. Features in-depth video examples, written breakdowns, and helpful reference patterns. Watch senior engineers and managers answer these questions in mock interview videos.