- Home
- MCQs by exam
- NTS
NTS MCQs · Page 63
5,604 multiple choice questions typical of the NTS exam, with answers and explanations. Switch on practice mode to test yourself first.
-
A
A NAT gateway inside the private subnet with an elastic IP attached to it
-
B
A VPC endpoint for the internet that proxies every outbound HTTPS request
-
C
A NAT gateway in a public subnet, plus a route in the private route table
Correct answer
-
D
An internet gateway attached to the private subnet's own route table
-
A
Yes, but only if all three VPCs use non-overlapping CIDR ranges
-
B
No, unless a shared transit gateway attachment joins all three peers
-
C
No, because VPC peering is non-transitive and needs a direct peering
Correct answer
-
D
Yes, because B forwards the traffic when its route tables say so
-
A
They may be delivered in any order but never more than once at all
-
B
They are ordered only if a deduplication ID is also supplied for each
-
C
They are ordered across all groups, since the queue is first-in first-out
-
D
They are delivered strictly in order, one at a time within that group
Correct answer
-
A
60 seconds, which reduces empty responses and request charges
-
B
20 seconds, but this applies only to FIFO queues and not standard ones
-
C
20 seconds, which reduces empty responses and request charges
Correct answer
-
D
10 seconds, which reduces empty responses and request charges
-
A
A 502 error, because Lambda rejects runs longer than 30 seconds
-
B
A 504 only if reserved concurrency has been configured on the function
-
C
A 504 timeout, because the integration timeout is capped at 29 seconds
Correct answer
-
D
A 200 response after 40 seconds, since the gateway waits for the backend
-
A
15 minutes, after which the invocation is terminated by the service
Correct answer
-
B
5 minutes, after which the invocation is terminated by the service
-
C
60 minutes, after which the invocation is terminated by the service
-
D
15 minutes, though only functions above 1 GB may use the full limit
-
A
Eventually consistent only, because a GSI is maintained asynchronously
Correct answer
-
B
Strongly consistent, provided the query targets a single partition key
-
C
Strongly consistent, but only if the index was created with that setting
-
D
Either mode, because a GSI is replicated synchronously within the Region
-
A
5 MiB, with a maximum of 1,000 parts per upload
-
B
16 MiB, with a maximum of 10,000 parts per upload
-
C
5 MiB, with a maximum of 10,000 parts per upload
Correct answer
-
D
1 MiB, with a maximum of 10,000 parts per upload
-
A
It works until expiry, since the signature alone authorises the request
-
B
It works only for HEAD requests, because GET needs live credentials
-
C
It fails only if the object's ETag changes after the URL was generated
-
D
It fails, because the signing credentials must still be valid when used
Correct answer
-
A
Denied only if the bucket policy also lists that user in a NotPrincipal element
-
B
Allowed, because both statements are evaluated and the allow matches first
-
C
Denied, because an explicit deny anywhere in IAM always overrides any allow
Correct answer
-
D
Allowed, because identity policies take precedence over resource policies
-
A
A silent no-op, because the call operator checks for an empty target
-
B
A segmentation fault, since the internal pointer is null and dereferenced
-
C
std::bad_function_call is thrown, because no callable target is stored
Correct answer
-
D
Undefined behaviour, because std::function cannot be empty when called
-
A
Nothing at all, because a deque never reallocates its element storage blocks
-
B
References to existing elements, but the iterators remain valid instead
-
C
Only iterators to the front element, since the rest of the blocks stay
-
D
All existing iterators, though references to existing elements stay valid
Correct answer
-
A
The static type Base, because typeid ignores the dynamic type here
Correct answer
-
B
The dynamic type Derived, since typeid always inspects the vtable
-
C
A std::bad_typeid exception, since the base class is not polymorphic
-
D
The most-derived type, but only after a dynamic_cast has been performed
-
A
Swapping uses move assignment, which the standard requires to be noexcept
-
B
The old state is replaced only after the copy has been fully constructed
Correct answer
-
C
The copy constructor cannot throw once the source object has been locked
-
D
It avoids allocating memory, so no allocation failure can occur at all
-
A
It returns a default-constructed value through the monadic transform path
-
B
It throws std::bad_optional_access, unlike operator* which is unchecked
Correct answer
-
C
It returns a value-initialised object, zero in this case, with no diagnostic
-
D
It is undefined behaviour, because optional performs no check at all
-
A
Plain delete is called on the array pointer, which is undefined behaviour
Correct answer
-
B
delete[] is chosen automatically because the pointer type is an array
-
C
The control block detects the array and calls the array deleter for you
-
D
Nothing is freed, because shared_ptr never deletes array allocations at all
-
A
int, because decltype of a bare name yields its declared type
Correct answer
-
B
int&, because decltype(auto) gives an lvalue reference
-
C
int&&, because returning a global binds it to an rvalue reference
-
D
const int, since the returned object counts as a temporary value
-
A
It is removed before parsing, so even syntax errors in it are ignored
-
B
It is compiled and executed at run time only if its condition is true
-
C
It is discarded and not instantiated, so dependent code there may be invalid
Correct answer
-
D
It is still instantiated and type-checked, then removed later as a dead branch
-
A
The defaulted destructor needs Impl complete to invoke the deleter on it
Correct answer
-
B
unique_ptr can never hold an incomplete type in any context in C++
-
C
The constructor must see Impl to size the pointer, so the definition is needed
-
D
The compiler cannot generate a move constructor for an incomplete member
-
A
It has static storage duration, so returning the list by value is safe
-
B
It ends with the full-expression that created it, like any temporary array
Correct answer
-
C
It ends only with the enclosing block, exactly as a local const array does
-
D
It lasts as long as the initializer_list object that was copied from it
-
A
Compiles and sets x to 3, since braced init truncates like a cast does
-
B
Compiles and sets x to 4, since braced init rounds to the nearest integer
-
C
Compiles with a warning, since the value is implementation-defined here
-
D
Rejects it, because narrowing conversions are ill-formed in braced init
Correct answer
-
A
It performs one allocation for both the object and the control block
Correct answer
-
B
It performs two allocations but avoids any virtual dispatch
-
C
It keeps the control block on the stack, so only the object is heap based
-
D
It uses a separate allocator, so the object and control block never free
-
A
Predicates are evaluated outside the lock, so the result may become stale
-
B
Wake-ups can occur without a notify, so the condition must be rechecked
Correct answer
-
C
The mutex is released before the predicate runs and may be reacquired late
-
D
notify_one can be lost when nobody is waiting, so the wait must poll
-
A
Atomicity only for threads that happen to share the same cache line layout
-
B
Atomicity of the operation only, with no ordering against other accesses
Correct answer
-
C
Atomicity plus release ordering of every preceding write in that thread
-
D
Atomicity plus sequential consistency with respect to all other atomics
-
A
The object is built directly in the caller's storage, with no move at all
Correct answer
-
B
One move construction happens, but the copy constructor is elided
-
C
The move constructor must still be accessible even though it is never called
-
D
The compiler may elide the move, but this remains optional for it