Notice: Due to an ongoing migration of our storage and publishing system, material requested since last month will not be uploaded for the time being, and new requests are paused. All existing notes remain available.

Unit 4 MCQs Authentication and Database Integration

INT257 — Modern Web Application Development 60 questions. Pick an option to check it.

Read the notes Subjective questions

0 of 60 answered 0 right 0 wrong , 60 left

  1. Question 1 of 60 Authentication Concepts Easy

    What is the main purpose of authentication in a web application?

  2. Question 2 of 60 Authentication Concepts Easy

    Which credential is commonly used with a username during authentication?

  3. Question 3 of 60 Session Management Easy

    What does a session commonly store after a user logs in?

  4. Question 4 of 60 Session Management Easy

    What usually happens to a user's session when they log out?

  5. Question 5 of 60 Protected Routes Easy

    What is a protected route?

  6. Question 6 of 60 Protected Routes Easy

    Where is an unauthenticated user commonly sent when opening a protected route?

  7. Question 7 of 60 Authorization Easy

    What does authorization determine?

  8. Question 8 of 60 Authorization Easy

    Which check is an example of authorization?

  9. Question 9 of 60 Role-based Access Control Easy

    In role-based access control, permissions are primarily assigned to what?

  10. Question 10 of 60 Role-based Access Control Easy

    Which role would commonly have permission to manage all user accounts?

  11. Question 11 of 60 ORM Basics Easy

    What does ORM stand for?

  12. Question 12 of 60 ORM Basics Easy

    What does an ORM help developers do?

  13. Question 13 of 60 Database Connectivity Easy

    What is required for an application to connect to a database?

  14. Question 14 of 60 Database Connectivity Easy

    Which value is commonly included in database connection settings?

  15. Question 15 of 60 CRUD Operations Easy

    What does the letter C represent in CRUD?

  16. Question 16 of 60 CRUD Operations Easy

    Which CRUD operation changes an existing database record?

  17. Question 17 of 60 CRUD Operations Easy

    Which CRUD operation retrieves stored data?

  18. Question 18 of 60 Data Validation Easy

    Why is user input validated before it is stored?

  19. Question 19 of 60 Data Validation Easy

    Which is a basic validation rule for a required email field?

  20. Question 20 of 60 Environment Variables Easy

    Why are environment variables commonly used in web applications?

  21. Question 21 of 60 Authentication Concepts Medium

    A web application stores user passwords for login verification. Which approach provides the best protection if the database is exposed?

  22. Question 22 of 60 Authentication Concepts Medium

    Why should a server regenerate a session identifier after a user successfully logs in?

  23. Question 23 of 60 Session Management Medium

    A session cookie should not be accessible through client-side JavaScript because of which cookie attribute?

  24. Question 24 of 60 Session Management Medium

    An application must ensure that a session cookie is sent only over HTTPS connections. Which cookie setting addresses this requirement?

  25. Question 25 of 60 Session Management Medium

    What is the primary purpose of an idle session timeout?

  26. Question 26 of 60 Protected Routes Medium

    A request to /dashboard is received without a valid authenticated session. What should protected-route middleware typically do?

  27. Question 27 of 60 Protected Routes Medium

    A frontend hides an administrator link, but the corresponding API endpoint has no server-side authentication check. What is the main security problem?

  28. Question 28 of 60 Authorization Medium

    A logged-in user requests another user's private profile by changing the user ID in the URL. Which authorization check is needed?

  29. Question 29 of 60 Authorization Medium

    Which response status is most appropriate when a user is authenticated but lacks permission to delete a resource?

  30. Question 30 of 60 Role-based Access Control Medium

    In a role-based access control system, a user has the role editor, which permits updating articles but not deleting them. What should happen when the user sends a delete request?

  31. Question 31 of 60 Role-based Access Control Medium

    What is a key advantage of assigning permissions to roles instead of configuring permissions separately for every user?

  32. Question 32 of 60 ORM Basics Medium

    In an ORM, a User class is mapped to a database table. What does an instance of the class usually represent?

  33. Question 33 of 60 ORM Basics Medium

    What is the main purpose of an ORM migration?

  34. Question 34 of 60 Database Connectivity Medium

    An application is deployed to production and fails because it cannot connect to the database. Which configuration should be checked first?

  35. Question 35 of 60 Database Connectivity Medium

    Why should a web application use a connection pool for frequent database access?

  36. Question 36 of 60 CRUD Operations Medium

    Which operation best represents updating a user's email address in a database?

  37. Question 37 of 60 CRUD Operations Medium

    A user submits a form to create a new blog post. Which practice best reduces SQL injection risk when inserting the data?

  38. Question 38 of 60 Data Validation Medium

    A registration endpoint receives an email field that contains an empty string. What is the best validation behavior?

  39. Question 39 of 60 Data Validation Medium

    Why should validation be performed on the server even when the frontend already validates the form?

  40. Question 40 of 60 Environment Variables Medium

    Which value is most appropriate to store in an environment variable rather than directly in source code?

  41. Question 41 of 60 Authentication Concepts Hard

    A web application stores passwords using a fast hash function with a unique salt per user. An attacker obtains the password table and can evaluate billions of hashes per second. Which change most directly improves resistance to offline cracking?

  42. Question 42 of 60 Authentication Concepts Hard

    A login endpoint returns the same HTTP status, response body structure, and approximate timing for an unknown email and an incorrect password. What security property is this design primarily intended to provide?

  43. Question 43 of 60 Session Management Hard

    A user logs in successfully, but the server keeps the anonymous session identifier and merely adds an authenticated flag. Which remediation is most important?

  44. Question 44 of 60 Session Management Hard

    A server-side session store uses a sliding idle timeout. Two requests from the same session arrive concurrently: one is valid at time , while the other was sent before the session expired but reaches the server afterward. Which design best prevents stale-request resurrection?

  45. Question 45 of 60 Protected Routes Hard

    A single-page application hides an admin link for non-admin users, but its API endpoint only checks whether a request has a valid login session. What is the primary flaw?

  46. Question 46 of 60 Protected Routes Hard

    A protected route checks authentication in middleware, then redirects unauthenticated users to a login page. An attacker supplies a URL containing an external destination as the return parameter. Which control is required?

  47. Question 47 of 60 Authorization Hard

    An endpoint permits a user to fetch /orders/4821 after checking that the user is logged in, but it does not compare the order's owner ID with the requester. What vulnerability remains?

  48. Question 48 of 60 Authorization Hard

    A document update service first verifies that a user may edit a document and then performs the update using only the document ID. The document can be moved between tenants by another process between these operations. Which solution best addresses the issue?

  49. Question 49 of 60 Role-based Access Control Hard

    A user has both viewer and editor roles. The application denies access if any assigned role lacks permission, even when another role grants it. Which RBAC evaluation model is usually intended instead?

  50. Question 50 of 60 Role-based Access Control Hard

    An administrator changes a user's role from admin to support, but existing access tokens contain the old role claim and remain valid for one hour. Which mitigation most directly limits stale privilege?

  51. Question 51 of 60 ORM Basics Hard

    An ORM loads 1,000 posts and lazily fetches each author's record while rendering them. The database receives one query for posts and 1,000 author queries. What is the most appropriate correction when all authors are needed?

  52. Question 52 of 60 ORM Basics Hard

    An ORM model accepts a request body containing email, displayName, and isAdmin, and uses a generic update method. A client changes isAdmin despite lacking permission. Which ORM-level control is most relevant?

  53. Question 53 of 60 Database Connectivity Hard

    A production service opens a new database connection for every request and occasionally exhausts the database connection limit under load. Which architecture is most appropriate?

  54. Question 54 of 60 Database Connectivity Hard

    A database transaction updates an inventory row, but a second transaction can read the intermediate value before the first transaction commits. Which database property is missing or inadequately configured?

  55. Question 55 of 60 CRUD Operations Hard

    An API implements PUT /users/7 by updating only fields present in the request and leaving all other fields unchanged. A client omits a field expecting it to be cleared. Which design correction is most accurate?

  56. Question 56 of 60 CRUD Operations Hard

    Two clients read a product with version 12. Both submit updates, and the second update silently overwrites the first. Which implementation provides optimistic concurrency control?

  57. Question 57 of 60 Data Validation Hard

    A registration validator checks that an email has a valid format, but the database later rejects it because the email column is unique. Which validation strategy is correct?

  58. Question 58 of 60 Data Validation Hard

    A server validates a request's JSON structure but accepts a string such as "999999999999999999999" for an integer amount, allowing inconsistent coercion across services. What is the strongest fix?

  59. Question 59 of 60 Environment Variables Hard

    A deployment reads DATABASE_URL successfully, but a secret containing a dollar sign and spaces is truncated or altered by the shell. Which practice best prevents this configuration error?

  60. Question 60 of 60 Environment Variables Hard

    An application falls back to a development signing key when AUTH_SECRET is missing. In production, a deployment typo therefore starts successfully but issues forgeable tokens. Which design is safest?

That's unit 4

Answer a few questions and your score shows up here.