MVC Pattern: Review Questions

Self-Study & Discussion

These questions cover the 8 sections of the MVC Pattern overview and are organized into 5 topic clusters. No answers are provided — the goal is to test your understanding of MVC components, server-side vs client-side rendering, progressive enhancement, and architectural decision-making.

The questions mix conceptual understanding, code-level reasoning, and design trade-offs.

Cluster 1: MVC Fundamentals — Components & Separation of Concerns (Sections 1–2)

  1. Define the three components of MVC (Model, View, Controller) and explain each one's single responsibility. Why is it important that the Model has "no knowledge of how data is displayed"?
  2. The overview says "MVC is a pattern, not a framework." What does this mean? How can you implement MVC in plain Node.js or PHP without any framework?
  3. The overview shows a PHP file that mixes routing, database queries, and HTML rendering in one place. Identify the three concerns being mixed and explain why this becomes unmanageable as the application grows.
  4. Explain the four benefits of MVC from the overview: testability, team workflow, reusability, and maintainability. For each, give a concrete example of how MVC enables it while the "everything in one file" approach doesn't.
  5. In the MVC flow diagram, the Controller receives the request, asks the Model for data, then passes results to the View. Why doesn't the View query the Model directly? What problem would that create?

Cluster 2: Server-Side MVC (Section 3)

  1. Trace the six-step flow of a server-side MVC request (from "browser sends request" through "View renders HTML"). What does the browser receive at the end, and why is this important for SEO?
  2. Compare the file structures shown for Node.js (Express+EJS) and PHP (manual MVC). What are the corresponding files in each? Why does PHP need an .htaccess file and a front controller (index.php) while Node.js doesn't?
  3. The overview lists five scenarios for server-side MVC: content-heavy sites, SEO-critical apps, progressive enhancement, simple CRUD, and fast initial load. Pick two and explain why server-side rendering is specifically better than a SPA for those cases.
  4. In the server-side MVC code examples, the Controller calls require 'views/users/index.php' to render the view. How does the $users variable become available inside the view file? What would happen if the Controller forgot to fetch data from the Model first?
  5. The POST/Redirect/GET pattern appears in the tutorial modules. Explain what it is, why it's necessary for form submissions in server-side MVC, and what happens if you skip the redirect step.

Cluster 3: Client-Side MVC / SPA (Section 4)

  1. Trace the six-step flow of a client-side MVC (SPA) request. How does it differ from server-side MVC? At what point does the browser first display meaningful content to the user?
  2. The overview says the initial SPA page is "mostly empty, with a <script> tag that loads the JavaScript application bundle." Why is this a problem for initial page load performance? What is the user staring at while the bundle downloads?
  3. Explain the SEO and accessibility tradeoff of SPAs. Why can't search engine crawlers index content that requires JavaScript to render? What frameworks (Next.js, Nuxt.js) exist to address this, and what approach do they take?
  4. The overview warns that SSR frameworks for SPAs may be "solving an architectural problem with even more complexity." Explain this critique: if you need server-side rendering for SEO, why not just use server-side MVC in the first place?
  5. Compare when to choose client-side MVC vs server-side MVC. The overview lists four scenarios for SPAs (interactive UIs, desktop-like experiences, offline-capable, separate teams). For each, explain why a full page reload would be problematic.

Cluster 4: Adaptable MVC & Progressive Enhancement (Section 5)

  1. Explain the adaptable MVC approach: how does a single controller serve both HTML pages (for browsers without JS) and JSON data (for JavaScript clients)? What HTTP header does the controller inspect to decide?
  2. The overview shows two "paths" in the adaptable MVC diagram: Path A (JavaScript enabled) and Path B (no JavaScript). Walk through a user clicking "Add User" in each path. What does the server return in each case?
  3. Compare the Node.js and PHP code examples for adaptable MVC. Both check the Accept header — how does Express's req.accepts('html') differ from PHP's str_contains($accept, 'application/json')? What does the PHP code check additionally with X-Requested-With?
  4. The overview calls this "progressive enhancement applied to architecture." Explain: what is the "baseline" experience, and what is the "enhancement"? How does this connect to the content negotiation concept from the REST overview?
  5. A team debates whether to build a SPA or a server-rendered app. A third developer suggests the adaptable approach. What are the trade-offs? Is the adaptable approach always the best choice, or are there situations where a pure SPA or pure server-rendered app is simpler?

Cluster 5: Architecture — REST vs MVC, Frameworks & Design (Sections 6–8)

  1. The overview says "REST and MVC are not competing patterns — they operate at different layers." Explain what this means using the restaurant analogy: REST is the menu, MVC is the kitchen organization. Can you have REST without MVC? MVC without REST?
  2. The overview's diagram shows REST as the "external API interface" and MVC as the "internal server code organization." Why is this separation valuable? What can you change on the MVC side without affecting REST clients, and vice versa?
  3. Compare the MVC file structures across Express, Laravel, Django, and Rails from the overview's framework table. Why does Django call its pattern "MTV" instead of MVC? Map Django's views.py and templates/ to standard MVC terminology.
  4. The tutorials build the same CRUD app three ways: server-side MVC, client-side MVC, and adaptable. What stays the same across all three approaches (Model? Controller? View?), and what changes? Why is the Model the most stable component?
  5. You're tasked with building a project management tool that needs: (a) a public-facing marketing page (SEO-critical), (b) an interactive Kanban board (highly dynamic), and (c) an API for a mobile app. Which MVC approach would you use for each part, and why? Could a single backend serve all three?