1. Home
  2. All MCQs

All MCQs with Answers · Page 1406

45,334 multiple choice questions from every subject, newest first. Switch on practice mode to hide the answers and test yourself.

Newest first

A pattern capturing one or more digits is applied with Series.str.extract to a column where some values do not match. What appears in those rows?

  1. NaN in the extracted column, because a non-match yields a missing value Correct answer
  2. An empty string, because extract returns the unmatched part of the input
  3. The original value unchanged, since extract only rewrites matching rows
  4. An error, because extract requires every value to match the pattern
MCQSEXAM Read explanation

A CloudFront distribution has a default TTL of 86400 seconds and a minimum TTL of 0. The origin sends Cache-Control: max-age=300. For how long does CloudFront cache the object?

  1. 86400 seconds, because the distribution default takes precedence always
  2. 0 seconds, because the minimum TTL allows revalidation on every request
  3. 300 seconds, but only when the viewer sends no conditional headers
  4. 300 seconds, because the origin header overrides the default TTL value Correct answer
MCQSEXAM Read explanation

A Route 53 failover routing policy has primary and secondary records configured. What causes traffic to switch to the secondary?

  1. A latency increase above the threshold set in the routing policy
  2. The TTL of the primary record expiring without a refresh from the zone
  3. The health check on the primary record failing its configured checks Correct answer
  4. The primary record being deleted from the hosted zone by an operator
MCQSEXAM Read explanation

A private subnet needs outbound internet access for software updates but must not accept inbound connections. What is required?

  1. A NAT gateway inside the private subnet with an elastic IP attached to it
  2. A VPC endpoint for the internet that proxies every outbound HTTPS request
  3. A NAT gateway in a public subnet, plus a route in the private route table Correct answer
  4. An internet gateway attached to the private subnet's own route table
MCQSEXAM Read explanation

An API Gateway REST API integrates with a Lambda function that takes 40 seconds to finish. What does the client receive?

  1. A 502 error, because Lambda rejects runs longer than 30 seconds
  2. A 504 only if reserved concurrency has been configured on the function
  3. A 504 timeout, because the integration timeout is capped at 29 seconds Correct answer
  4. A 200 response after 40 seconds, since the gateway waits for the backend
MCQSEXAM Read explanation

A presigned S3 URL was generated using credentials from an IAM role that is deleted shortly afterwards. What happens when the URL is used before its expiry time?

  1. It works until expiry, since the signature alone authorises the request
  2. It works only for HEAD requests, because GET needs live credentials
  3. It fails only if the object's ETag changes after the URL was generated
  4. It fails, because the signing credentials must still be valid when used Correct answer
MCQSEXAM Read explanation

A user's identity policy allows s3:GetObject on a bucket, but the bucket policy contains an explicit Deny for that user. What is the result of the request?

  1. Denied only if the bucket policy also lists that user in a NotPrincipal element
  2. Allowed, because both statements are evaluated and the allow matches first
  3. Denied, because an explicit deny anywhere in IAM always overrides any allow Correct answer
  4. Allowed, because identity policies take precedence over resource policies
MCQSEXAM Read explanation

typeid(*basePtr) is evaluated where Base has no virtual functions and the object is really a Derived. What type is reported?

  1. The static type Base, because typeid ignores the dynamic type here Correct answer
  2. The dynamic type Derived, since typeid always inspects the vtable
  3. A std::bad_typeid exception, since the base class is not polymorphic
  4. The most-derived type, but only after a dynamic_cast has been performed
MCQSEXAM Read explanation

Why does the copy-and-swap assignment operator provide the strong exception guarantee?

  1. Swapping uses move assignment, which the standard requires to be noexcept
  2. The old state is replaced only after the copy has been fully constructed Correct answer
  3. The copy constructor cannot throw once the source object has been locked
  4. It avoids allocating memory, so no allocation failure can occur at all
MCQSEXAM Read explanation

A shared_ptr is built as std::shared_ptr<int>(new int[10]). What happens when the last reference to it goes away?

  1. Plain delete is called on the array pointer, which is undefined behaviour Correct answer
  2. delete[] is chosen automatically because the pointer type is an array
  3. The control block detects the array and calls the array deleter for you
  4. Nothing is freed, because shared_ptr never deletes array allocations at all
MCQSEXAM Read explanation