Back-End 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 (database tier) handles all persistent storage and retrieval operations in a full-stack app.
Question 2: In a REST API, which HTTP method is conventionally used to partially update an existing resource?
- PUT
- POST
- PATCH (Correct answer)
- DELETE
Correct answer: PATCH
PATCH is used for partial updates, while PUT replaces the entire resource.
Question 3: What is the primary purpose of an ORM (Object-Relational Mapper) in back-end development?
- To render HTML templates on the server
- To map database tables to programming language objects (Correct answer)
- To compress HTTP responses
- To manage CSS styles for server-rendered pages
Correct answer: To map database tables to programming language objects
An ORM abstracts database interactions by mapping table rows to objects in your programming language.
Question 4: Which of the following is a key advantage of using environment variables for configuration?
- They are faster than JSON config files
- They keep sensitive data out of source code (Correct answer)
- They automatically encrypt database passwords
- They replace the need for a .gitignore file
Correct answer: They keep sensitive data out of source code
Environment variables store secrets like API keys outside of version-controlled source code.
Question 5: What does 'stateless' mean in the context of REST APIs?
- The server never stores data in a database
- Each request contains all information needed to process it independently (Correct answer)
- The API does not use HTTP status codes
- Client sessions are stored permanently on the server
Correct answer: Each request contains all information needed to process it independently
A stateless REST API requires every request to include all necessary context — the server holds no session state between requests.
Question 6: In a typical MVC back-end architecture, what is the role of the Controller?
- Defines the database schema
- Renders the final HTML output
- Handles incoming requests and coordinates Model and View (Correct answer)
- Manages CSS and JavaScript assets
Correct answer: Handles incoming requests and coordinates Model and View
Controllers receive HTTP requests, interact with Models for data, and pass results to Views for rendering.
Question 7: Which protocol does WebSocket use to establish its initial connection before upgrading?
- FTP
- SMTP
- HTTP (Correct answer)
- SSH
Correct answer: HTTP
WebSocket connections start with an HTTP handshake that then upgrades to the persistent WebSocket protocol.
Which layer of a full-stack application is responsible for storing and retrieving persistent data?