Full-Stack Development An Intro to Full-Stack Development 2 — Questions and Answers
Question 1: Which layer of a full-stack application is responsible for storing and retrieving persistent data?
- Presentation layer
- Business logic layer
- Data layer (Correct answer)
- Network layer
Correct answer: Data layer
The data layer handles all interactions with databases and persistent storage systems.
Question 2: What does 'REST' stand for in the context of web APIs?
- Remote Execution State Transfer
- Representational State Transfer (Correct answer)
- Resource Endpoint Structured Transfer
- Relational Entity Service Transmission
Correct answer: Representational State Transfer
REST stands for Representational State Transfer, an architectural style for designing networked APIs.
Question 3: In a typical MVC architecture, which component handles user input and triggers updates?
- Model
- View
- Controller (Correct answer)
- Router
Correct answer: Controller
The Controller receives user input, processes it, and coordinates updates between the Model and View.
Question 4: Which HTTP method is conventionally used to update an existing resource in a RESTful API?
- GET
- POST
- PUT (Correct answer)
- DELETE
Correct answer: PUT
PUT is used to update or replace an existing resource at a specified URI.
Question 5: What is the primary purpose of a CDN (Content Delivery Network) in a full-stack application?
- To run server-side business logic closer to users
- To serve static assets from geographically distributed servers (Correct answer)
- To manage database replication across regions
- To handle authentication tokens globally
Correct answer: To serve static assets from geographically distributed servers
A CDN caches and delivers static assets like images, CSS, and JS from servers near the end user to reduce latency.
Question 6: Which of the following best describes 'server-side rendering' (SSR)?
- The browser builds the HTML using JavaScript after page load
- The server generates the full HTML page before sending it to the client (Correct answer)
- Static HTML files are pre-built at deploy time
- JavaScript runs in a Node.js worker thread on the client
Correct answer: The server generates the full HTML page before sending it to the client
In SSR, the server processes the request and sends a fully rendered HTML document to the browser.
Question 7: What is the role of an ORM (Object-Relational Mapper) in full-stack development?
- It maps HTTP routes to controller functions
- It converts between object-oriented code and relational database tables (Correct answer)
- It serializes API responses to JSON format
- It manages CSS class mappings in component libraries
Correct answer: It converts between object-oriented code and relational database tables
An ORM lets developers interact with a relational database using objects and methods instead of raw SQL.
Which layer of a full-stack application is responsible for storing and retrieving persistent data?