PracHub
QuestionsPremiumLearningGuidesInterview PrepNEWCoaches

Quick Overview

This question evaluates practical skills in building a Spring MVC REST service with JPA and SQL aggregation to identify the most-enrolled course, along with competencies in data modeling, repository/DAO design, efficient aggregation queries, deterministic tie-breaking, error handling, indexing strategy, and endpoint testing, and it belongs to the Data Manipulation (SQL/Python) domain. It is commonly asked to assess an applicant's ability to integrate persistence with a web layer, reason about database performance and time/space complexity, and demonstrate both practical implementation ability and conceptual understanding of schema/indexing trade-offs and failure scenarios.

  • Medium
  • Disney
  • Data Manipulation (SQL/Python)
  • Software Engineer

Implement Spring MVC to find top-enrolled course

Company: Disney

Role: Software Engineer

Category: Data Manipulation (SQL/Python)

Difficulty: Medium

Interview Round: Technical Screen

Implement a Spring MVC service that returns the course with the highest number of enrolled students from a relational database pre-populated by provided INSERT scripts. Define JPA entities for Course, Student, and (if many-to-many) Enrollment; create repositories/DAOs, a service layer, and a REST controller endpoint GET /courses/most-popular that returns the winning course and its enrollment count. Write the aggregation query efficiently (e.g., COUNT(*) GROUP BY course_id ORDER BY count DESC LIMIT 1), handle ties deterministically (e.g., break by course_id or name), and include error handling for empty datasets and database failures. Describe your schema assumptions, indexing strategy, and time/space complexity of the query; discuss how you would test the endpoint.

Quick Answer: This question evaluates practical skills in building a Spring MVC REST service with JPA and SQL aggregation to identify the most-enrolled course, along with competencies in data modeling, repository/DAO design, efficient aggregation queries, deterministic tie-breaking, error handling, indexing strategy, and endpoint testing, and it belongs to the Data Manipulation (SQL/Python) domain. It is commonly asked to assess an applicant's ability to integrate persistence with a web layer, reason about database performance and time/space complexity, and demonstrate both practical implementation ability and conceptual understanding of schema/indexing trade-offs and failure scenarios.

Last updated: Mar 29, 2026

Related Coding Questions

  • Write complex SQL for streaming funnels - Disney (Medium)

Loading coding console...

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.