Full-Stack Development An Intro to Full-Stack Development 5 — Questions and Answers
Question 1: What is the difference between authentication and authorization in a web application?
- Authentication checks what a user can do; authorization verifies who they are
- Authentication verifies who a user is; authorization determines what they are allowed to do (Correct answer)
- They are interchangeable terms for the same security process
- Authentication applies only to APIs while authorization applies only to UIs
Correct answer: Authentication verifies who a user is; authorization determines what they are allowed to do
Authentication confirms identity (who you are), while authorization enforces permissions (what you can access).
Question 2: Which tool is most commonly used to containerize a full-stack application for consistent environments across development and production?
- Webpack
- Docker (Correct answer)
- Babel
- ESLint
Correct answer: Docker
Docker packages an application and its dependencies into a container image that runs identically in any environment.
Question 3: What is 'lazy loading' in the context of a React application?
- Fetching all data before the component mounts to avoid loading spinners
- Deferring the loading of components or resources until they are actually needed (Correct answer)
- Preloading all routes at build time to improve first-paint performance
- Caching API responses in localStorage to avoid network requests
Correct answer: Deferring the loading of components or resources until they are actually needed
Lazy loading defers importing components or data until they are needed, reducing initial bundle size and load time.
Question 4: In a relational database, what does a foreign key enforce?
- That a column value is unique within its table
- That values in a column match a primary key in another table, maintaining referential integrity (Correct answer)
- That the column is indexed for fast lookup performance
- That the column value is never NULL
Correct answer: That values in a column match a primary key in another table, maintaining referential integrity
A foreign key constraint ensures that a column's values correspond to existing primary key values in a referenced table.
Question 5: What is the primary benefit of using TypeScript over plain JavaScript in a full-stack project?
- TypeScript code runs significantly faster at runtime than JavaScript
- TypeScript adds static type checking that catches errors at compile time before runtime (Correct answer)
- TypeScript replaces the need for unit tests by verifying all logic statically
- TypeScript automatically generates REST API documentation from code
Correct answer: TypeScript adds static type checking that catches errors at compile time before runtime
TypeScript's static type system surfaces type mismatches and interface violations during development before the code runs.
Question 6: Which of the following describes a 'race condition' in the context of asynchronous JavaScript?
- A performance benchmark measuring which async operation finishes first
- A bug where the outcome depends on the unpredictable timing of multiple async operations (Correct answer)
- A deliberate pattern to run two network requests in parallel for speed
- An error thrown when two Promises are awaited sequentially instead of in parallel
Correct answer: A bug where the outcome depends on the unpredictable timing of multiple async operations
A race condition occurs when the correctness of a program depends on the relative timing of concurrent operations, leading to unpredictable bugs.
Question 7: What does 'CI/CD' stand for and what problem does it solve in full-stack development?
- Client Integration / Content Delivery — solves asset caching issues
- Continuous Integration / Continuous Deployment — automates testing and shipping code changes reliably (Correct answer)
- Code Isolation / Component Deployment — solves micro-frontend bundling
- Cache Invalidation / Config Drift — solves environment mismatches
Correct answer: Continuous Integration / Continuous Deployment — automates testing and shipping code changes reliably
CI/CD automates building, testing, and deploying code so teams can ship changes frequently with confidence.
What is the difference between authentication and authorization in a web application?