- Home
- All MCQs
All MCQs with Answers · Page 1487
45,334 multiple choice questions from every subject, newest first. Switch on practice mode to hide the answers and test yourself.
-
A
A boolean column showing whether the join key was unique in both of the input frames
-
B
It raises an error if any of the keys fail to match, instead of reporting them in the result
-
C
It sorts the result by the join key automatically and resets the index of the output
-
D
A _merge column whose values are left_only, right_only or both, showing each row's origin
Correct answer
-
A
Both return one row per group, differing only in the index name that the resulting object carries afterwards
-
B
transform can only be used with user-defined functions, while apply also accepts built-in method strings
-
C
transform returns a Series aligned to the original index with the same length, while apply returns one value per group
Correct answer
-
D
apply returns a column the same length as the input frame itself, while transform reduces the result to one row per group
-
A
loc returns rows 0, 1 and 2 inclusive, while iloc returns rows 0 and 1 only
Correct answer
-
B
Both return rows 0, 1 and 2
-
C
loc returns rows 0 and 1, while iloc returns 0, 1 and 2
-
D
Both return rows 0 and 1, because slices always exclude the endpoint
-
A
Because boolean indexing always returns a tuple of arrays, so assignment cannot tell which of the two arrays to modify in place here
-
B
Because column b does not exist in df, so pandas must decide whether to create it on the copy or on the parent frame
-
C
Boolean indexing returns a new object that may still reference the parent's data, so chained assignment has an ambiguous target
Correct answer
-
D
Because assigning a scalar to a new column is not allowed after filtering, and pandas raises a warning instead
-
A
A container includes a hypervisor of its own, while a VM does not, so a container needs more privileged hardware
-
B
Containers cannot be networked, unlike virtual machines, which each receive their own network stack
-
C
A VM shares the host kernel while a container virtualises the hardware, which is why a VM starts faster
-
D
Containers share the host kernel and isolate at the process level, whereas each VM runs its own guest kernel
Correct answer
-
A
The instance is immediately terminated and replaced
-
B
The instance is live-migrated to a host with spare capacity
-
C
It continues at full speed and is billed at the on-demand rate
-
D
Performance is throttled to the baseline until credits accumulate again
Correct answer
-
A
Resources are created only in the first apply of each day, and later runs are silently skipped
-
B
The tool rolls back every change made by a failed run, restoring the previous state automatically and safely
-
C
Applying the same template repeatedly converges to the same state instead of creating duplicate resources
Correct answer
-
D
Each apply must be run exactly once, since repeated runs change resource identifiers every time
-
A
Cache-Control with max-age, and s-maxage which overrides it for shared caches
Correct answer
-
B
Content-Length, which sets the freshness window in seconds for the response
-
C
ETag, which fixes the cache lifetime and forces revalidation on every single request
-
D
Vary, which sets a separate cache lifetime per client and per user agent string
-
A
A single-instance production database with no replica and a strict uptime requirement
-
B
A licensing server that must stay online during business hours and cannot tolerate a restart
-
C
A stateful session store for a shopping cart that must survive an abrupt termination
-
D
A checkpointed batch rendering job that can resume after a two-minute interruption notice
Correct answer
-
A
Both figures describe exactly the same property measured over different periods, so eleven nines and 99.99 percent must always agree in practice
-
B
Eleven nines actually refers to availability and 99.99 percent to durability, so the two numbers are simply swapped labels
-
C
Durability measures the request latency, while availability measures the error rate of the service under sustained load
-
D
Durability is the probability of not losing a stored object, while availability is the fraction of time the service responds successfully
Correct answer
-
A
Layer 4 inspects HTTP headers and cookies, while layer 7 works only on raw IP addresses and port numbers
-
B
Layer 4 terminates TLS for every client connection, while layer 7 cannot, because it needs the decrypted payload to route
-
C
Layer 4 routes on IP and port information from TCP or UDP, while layer 7 can inspect HTTP paths, headers and cookies
Correct answer
-
D
Layer 7 is faster because it forwards raw packets without parsing them, which layer 4 must always do
-
A
Both are stateful, but only the security group can explicitly deny traffic from a given source address
-
B
Both are stateless, and the only difference is that a NACL applies to one instance while a security group applies to a subnet
-
C
The security group is stateful and allows only allow rules, while the NACL is stateless and supports both allow and deny rules
Correct answer
-
D
The security group is stateless and evaluated in numbered order, while the NACL is stateful and supports allow rules only
-
A
The first invocation after any code deployment, which is always noticeably slower by design and by contract
-
B
The restart of the function after it exceeds its memory limit, which clears the warm container pool
-
C
A scheduled invocation triggered by a timer event, which wakes a function that has never run
-
D
The added latency when a new execution environment must be created and initialised before the handler runs
Correct answer
-
A
CP, because partitions are tolerated and consistency is preserved
-
B
CA, because the partition is invisible to clients
-
C
ACID, because merging writes is a transaction
-
D
AP, trading linearizable consistency for continued availability
Correct answer
-
A
Strong consistency only in the us-east-1 region, with eventual consistency in every other region
-
B
Strong read-after-write consistency for PUTs of new objects and overwrites, and for list operations
Correct answer
-
C
Eventual consistency for all operations, with no listing guarantee and no overwrite guarantee
-
D
Eventual consistency for overwrites only, with strong consistency everywhere else in the whole service
-
A
Both require application changes, since neither approach affects the instance count or the load balancer configuration at all
-
B
Vertical scaling enlarges one instance and often needs a restart, while horizontal scaling adds instances and requires statelessness or load balancing
Correct answer
-
C
Vertical scaling adds more instances to the tier, while horizontal scaling enlarges the instance type, so the two terms are very often swapped in practice
-
D
Horizontal scaling is limited by the largest instance size that the provider offers, so it cannot grow beyond a single machine without sharding
-
A
About 4.3 minutes
-
B
About 72 minutes
-
C
About 43 minutes
Correct answer
-
D
About 7 minutes
-
A
An availability zone is one or more discrete data centres with independent power and cooling inside a region, while a region is a geographic area containing several zones
Correct answer
-
B
An availability zone spans multiple countries and contains many regions, while a region is a single data centre with redundant power, cooling and networking of its own
-
C
A region is one data centre with all of its racks, and an availability zone is a subset of those racks inside it, so the two terms describe the same facility at different scales
-
D
An availability zone is a billing boundary that groups accounts, while a region is a network boundary that groups several of those billing boundaries together
-
A
Neither, because patching is automated by the hypervisor at every boot of the guest
-
B
The provider, because it owns the physical hosts and the hypervisor that sits beneath them
-
C
The customer, because in IaaS the provider stops at the hypervisor and virtual hardware
Correct answer
-
D
Both equally, under a default that splits patching by kernel version and by machine image
-
A
The call is ambiguous and fails to compile, because the two declarations disagree about the default argument values used
-
B
20, because the dynamic type of the object is Derived and its own default arguments apply to the call in full
-
C
10, because default arguments are bound statically from the pointer's type while the override is chosen dynamically
Correct answer
-
D
10 or 20 depending on the compiler, since the standard leaves the choice of default arguments unspecified here
-
A
A compile error is guaranteed on every conforming compiler, because const_cast is rejected there
-
B
Undefined behaviour, because modifying an object that is genuinely const is not allowed
Correct answer
-
C
It works and c becomes the new value, because the pointer overrides the const qualifier
-
D
It is well defined, but the write is silently discarded, so c keeps its original value of 10
-
A
Their destructors run in reverse order of construction as the stack unwinds
Correct answer
-
B
They are leaked, because destructors only run at normal return
-
C
They are destroyed only if their class has a virtual destructor
-
D
std::terminate is called before any destructor runs
-
A
operator++ and operator--, in prefix or postfix form, cannot be overloaded
-
B
The conditional operator ?: together with ::, . (member access), .* and sizeof
Correct answer
-
C
operator[] and operator(), although both are member functions with arguments and return values
-
D
operator new and operator delete, in either their throwing or their non-throwing forms
-
A
map keeps keys ordered with O(log n) operations; unordered_map gives average O(1) with no ordering and O(n) worst case
Correct answer
-
B
Both keep the keys ordered, differing only in hash quality, so iteration order is identical for both of the two containers
-
C
unordered_map iterates in insertion order, unlike map, which re-sorts the keys at every single insertion
-
D
map gives O(1) lookup while unordered_map is O(log n), because a balanced tree always beats a hash table
-
A
A second declaration inside main, because the initialiser was not visible outside the class scope
-
B
An out-of-class definition, because the in-class initialiser served only as a declaration for such uses
Correct answer
-
C
A definition in every translation unit that included the header, to satisfy the one-definition rule
-
D
Nothing, since in-class initialisers always provided a full definition that the linker was normally able to use