Back-End Development An Intro to Full-Stack Development 4 — Questions and Answers
Question 1: What is the purpose of a package manager like npm or Yarn in full-stack JavaScript development?
- To compile TypeScript to JavaScript
- To manage, install, and version third-party libraries (Correct answer)
- To minify and bundle CSS files for production
- To provision cloud infrastructure automatically
Correct answer: To manage, install, and version third-party libraries
Package managers handle dependency installation, versioning, and script execution for JavaScript projects.
Question 2: Which caching strategy involves storing database query results in memory to reduce repeated database hits?
- CDN caching
- Browser caching
- In-memory caching (e.g., Redis) (Correct answer)
- Disk-based caching
Correct answer: In-memory caching (e.g., Redis)
In-memory stores like Redis cache frequently accessed data, dramatically reducing database load.
Question 3: What does the term 'API endpoint' refer to in back-end development?
- The physical server location of the database
- A specific URL that accepts requests and returns data (Correct answer)
- The final character of a JSON response string
- A CSS selector used to style API documentation pages
Correct answer: A specific URL that accepts requests and returns data
An endpoint is a specific URL route on a server that clients call to perform an action or retrieve data.
Question 4: In a full-stack application, what is the typical flow of a user login request?
- Browser → Database → API → Browser
- Browser → API → Database → API → Browser (Correct answer)
- Database → API → Browser → Database
- API → Browser → Database → Browser
Correct answer: Browser → API → Database → API → Browser
The browser sends credentials to the API, the API checks the database, and returns a success or failure response to the browser.
Question 5: Which HTTP status code range indicates a server-side error?
- 1xx
- 2xx
- 4xx
- 5xx (Correct answer)
Correct answer: 5xx
5xx codes (like 500 Internal Server Error) signal that the server failed to fulfill a valid request.
Question 6: What is the purpose of indexing a database column?
- To enforce that a column stores only unique values
- To speed up read queries by creating a fast lookup structure (Correct answer)
- To encrypt sensitive data stored in that column
- To automatically back up column data to cloud storage
Correct answer: To speed up read queries by creating a fast lookup structure
Database indexes create auxiliary data structures that allow the engine to find matching rows without scanning the entire table.
Question 7: Which of the following best describes the role of the front-end in a full-stack application?
- Executes business logic and validates data server-side
- Presents the UI and handles user interaction in the browser (Correct answer)
- Manages database connections and schema migrations
- Runs background jobs and schedules cron tasks
Correct answer: Presents the UI and handles user interaction in the browser
The front-end renders the user interface and manages interactions, typically running in the user's browser.
What is the purpose of a package manager like npm or Yarn in full-stack JavaScript development?