- Home
- MCQs by exam
- PPSC IT
PPSC IT MCQs · Page 3
577 multiple choice questions typical of the PPSC IT exam, with answers and explanations. Switch on practice mode to test yourself first.
-
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
-
A
int&, because the forwarding reference collapses to an lvalue reference
Correct answer
-
B
int, because the reference in the parameter is stripped before deduction
-
C
int&&, because the parameter is declared as an rvalue reference to T
-
D
const int&, because lvalues are deduced as const in template deduction
-
A
The first element equal to the value, found by a linear scan fallback
-
B
A compilation error, since the predicate cannot be checked in advance
-
C
Undefined behaviour, because the range must be partitioned for the search
Correct answer
-
D
Unspecified behaviour; the algorithm still returns some element of the range
-
A
int, because the standard requires accumulate to work integrally
-
B
int, because the accumulator takes the type of the initial value given
Correct answer
-
C
double, because it converts the seed to the range's value type
-
D
double, since the accumulation widens to the element type of the range
-
A
All iterators are invalidated, because the tree rebalances its nodes
-
B
Iterators to later elements are invalidated, while earlier ones stay valid
-
C
Iterators become valid again after the next insert into the container
-
D
Only the erased iterator is invalidated; every other iterator stays valid
Correct answer
-
A
The subscript returns an rvalue reference that cannot bind to auto&
-
B
A vector of bool has no operator[] because it is not a container
-
C
operator[] yields a proxy object by value, not a real bool reference
Correct answer
-
D
vector of bool packs bits, so its elements are const and cannot bind