Multiple Choice Questions (MCQs) for the Project
Test your understanding of the project with a few quick questions:
- Which React Hook did we use to manage component state in this project?
A. useEffect
B. useState
C. useContext
D. useReducer
Answer: B. useState (We used useState to track dynamic values like password, length, and checkbox states inside the functional component.) - What does the Math.random() function do in the context of our password generator?
A. It returns a random character from a string.
B. It generates a random number between 0 and 1, used to pick random indices.
C. It shuffles the characters in the password.
D. It converts a string to a random number.
Answer: B. It generates a random number between 0 and 1, used to pick random indices (We multiply it with the charset length to randomly select characters for the password). - Which of the following is NOT a feature we implemented in the Random Password Generator?
A. Choosing the length of the password.
B. Toggling inclusion of symbols in the password.
C. Saving generated passwords to a database.
D. Copying the generated password to the clipboard.
Answer: C. Saving generated passwords to a database (The app is frontend-only and does not involve any database operations.) - What is the purpose of running npm run build before deploying the app?
A. To start the development server on Netlify.
B. To run tests on the React app.
C. To generate an optimized production-ready version of the app in the build folder.
D. To install the Netlify CLI for deployment.
Answer: C. To generate an optimized production-ready version of the app in the build folder (This prepares static files (HTML, CSS, JS) that can be hosted on platforms like Netlify.) - After deploying to Netlify via GitHub, how do you update the live site with new changes?
A. Re-run npm run build on Netlify’s server.
B. Commit and push changes to the GitHub repository’s main branch, Netlify auto-deploys the updates.
C. Manually drag and drop the updated source files to Netlify.
D. You cannot update once deployed, you must create a new site for changes.
Answer: B. Commit and push changes to the GitHub repository’s main branch, Netlify auto-deploys the updates (Netlify watches your GitHub repo and rebuilds the site automatically when it detects changes.)


