- Home
- MCQs by exam
- PPSC IT
- Computer Science MCQs
PPSC IT MCQs – Computer Science MCQs · Page 3
346 multiple choice questions typical of the PPSC IT exam, with answers and explanations. Switch on practice mode to test yourself first.
-
A
offsetof is undefined for any member of a packed structure or union
-
B
The macro requires a union, and bit-fields may appear only inside structs
-
C
Bit-fields need not start on a byte boundary, so no byte offset exists
Correct answer
-
D
Bit-fields are not members of a structure and have no declared name
-
A
Nothing; a successful call always leaves errno set back to zero
-
B
Call clearerr first, since errno is only defined for stream functions
-
C
Nothing; errno is only meaningful when the function returns -1 or NULL
-
D
Set errno to 0 beforehand, because success never clears it by itself
Correct answer
-
A
Only the last registered handler h3 runs when main returns normally
-
B
h3, then h2, then h1, since handlers run in reverse registration order
Correct answer
-
C
h1, then h2, then h3, since handlers run in registration order exactly
-
D
The order is unspecified, so any permutation of the three is conforming
-
A
They keep their original relative order, since qsort is a stable sort
-
B
Their order is reversed, because qsort always swaps equal elements
-
C
Their order stays unspecified unless the comparator breaks the tie itself
-
D
Nothing is guaranteed, because qsort is not required to be stable at all
Correct answer
-
A
It is not reentrant because it calls malloc internally on the first call
-
B
It keeps the scan position in static storage shared between all calls
Correct answer
-
C
It writes into the source string, so two sources would overwrite each other
-
D
It returns pointers into a single static buffer reused on every call
-
A
n equals 10, but buf is left holding all ten characters without a terminator
-
B
n equals -1, because the output was truncated by the size argument given
-
C
n equals 10, and buf holds the first seven characters plus a terminator
Correct answer
-
D
n equals 7, and buf holds exactly the seven characters that it kept
-
A
Because goto may not cross any declaration that has an initialiser
-
B
It is rejected only when n is a compile-time constant expression
-
C
Jumping into the scope of a variably modified object is not permitted
Correct answer
-
D
The jump is legal, but the array a stays uninitialised until it is used
-
A
The typedef makes both a and b pointers; the macro makes only a pointer
Correct answer
-
B
Both forms declare two pointers, since the tokens are expanded identically
-
C
The typedef makes both ints, while the macro makes a pointer and an int
-
D
The macro form is a constraint violation and does not compile in C
-
A
Both shifts on negative values are undefined behaviour in standard C
-
B
Both shifts are well defined and act on the two's complement bit pattern
-
C
Left shift of a negative is implementation-defined, but right shift is undefined
-
D
Left shift of a negative is undefined; right shift is implementation-defined
Correct answer
-
A
g() always runs first, because the arguments are evaluated right to left
-
B
Nothing; the calls are indeterminately sequenced, so either order can occur
Correct answer
-
C
f() always runs first, since it appears leftmost in the argument list
-
D
The program has undefined behaviour, because one global object is written twice
-
A
Egress dominates, because data transferred out to the internet is billed and inbound is free
Correct answer
-
B
Ingress dominates, because inbound data is billed per gigabyte while outbound egress is free of charge
-
C
They cost the same, because both directions are billed at the identical per-gigabyte rate today
-
D
Neither is billed, because traffic remains free while it stays within a single AWS region
-
A
The bucket's versioning window, because the replica retains every prior object version written
-
B
Near-zero but not zero, because replication is asynchronous and may lag by seconds or minutes
Correct answer
-
C
Exactly zero, because replication is synchronous and commits the object to both regions together
-
D
Zero for new objects only, since existing objects are copied synchronously when it is enabled
-
A
10, because DynamoDB charges one write unit per item regardless of the individual item size
-
B
30, because each item rounds up to three units and the remaining size is ignored here
-
C
120, because writes are billed twice over when the table uses eventual consistency
-
D
60, because each 6 KB item consumes six write units and ten are written per second
Correct answer
-
A
254, because only the network and broadcast addresses are unusable inside a subnet here
-
B
250, because AWS reserves six addresses once the VPC router is also counted
-
C
251, because AWS reserves five addresses in every subnet for networking functions
Correct answer
-
D
256, because a /24 mask leaves eight host bits with no addresses reserved
-
A
It replaces the customer master key for all requests, sharply reducing KMS API call volume
-
B
It is a plaintext credential that must be rotated manually with every object written
-
C
It encrypts the data locally, and is itself stored encrypted under a KMS customer key
Correct answer
-
D
It encrypts the customer master key, so the master key never leaves the KMS service
-
A
Issue an invalidation for /* first, then upload the fixed file to the same key
-
B
Set the origin's Cache-Control max-age to zero, which flushes all existing edge copies at once
-
C
Reduce the default TTL to 60 seconds, which bounds how long an edge copy is stale
-
D
Version the object key, such as app-v2.js, so the CDN path itself is new and uncached
Correct answer
-
A
It raises the function's default timeout to match the reserved concurrency value in seconds
-
B
It provisions dedicated EC2 capacity that is billed whether or not it is invoked
-
C
It carves out and caps concurrency for that function, throttling it beyond the limit
Correct answer
-
D
It guarantees the function never cold-starts, by keeping the reserved pool warm
-
A
The message stays invisible until the queue's retention period eventually expires
-
B
The message becomes visible again and another consumer may process it a second time
Correct answer
-
C
The message is permanently deleted, because the expired timeout counts as an acknowledgement
-
D
The message moves to the dead-letter queue immediately, since the receive has failed
-
A
Instant, which is the only tier available to Glacier Flexible Retrieval archive objects
-
B
Expedited, which typically returns data in 1-5 minutes and is the most expensive tier
Correct answer
-
C
Bulk, which returns data within 5-12 hours and is the cheapest of the available tiers
-
D
Standard, which returns data in 3-5 hours and costs the same as expedited retrieval
-
A
Both are synchronous copies, but only the standby can serve read queries under load
-
B
Both are asynchronous copies, and either can be promoted to primary without any data loss at all
-
C
The standby is synchronous and not readable, while a replica is asynchronous and queryable
Correct answer
-
D
The standby is asynchronous and readable, while a replica is synchronous and write-only
-
A
16000 IOPS and 1000 MiB/s, the maximum that any gp3 volume can ever reach
-
B
3000 IOPS and 125 MiB/s, with extra IOPS and throughput purchased separately
Correct answer
-
C
3000 IOPS and 250 MiB/s, with throughput scaling automatically with volume size
-
D
100 IOPS per GiB and 250 MiB/s, both scaling in proportion to the volume's size
-
A
RDS, whose database instances run in a single availability zone or region pair
-
B
IAM, whose users, roles and policies apply across every region in the account
Correct answer
-
C
EC2, whose instances are created inside a chosen availability zone in one region
-
D
S3, whose buckets are served from the region chosen when they are created
-
A
Instance store is ephemeral local disk tied to the host, while EBS persists independently
Correct answer
-
B
Instance store survives a stopped instance, while EBS volumes are deleted with the host
-
C
Both are network-attached, but instance store offers higher durability by replicating twice
-
D
Instance store is billed per gigabyte-month, while EBS is included in the instance price
-
A
New instances from receiving traffic until their health checks have passed twice in a row
-
B
Scale-in events entirely, so the group can only ever grow during a traffic spike
-
C
The load balancer from deregistering instances that are still serving requests
-
D
Further scaling actions until metrics stabilise, avoiding repeated over-correction
Correct answer
-
A
The role issues an encrypted access key that is written to the instance's root volume at boot
-
B
The role removes the need for any permission policy at all, since the instance identity is trusted by default
-
C
The role lets the instance share one access key with other accounts without extra configuration
-
D
The role issues short-lived credentials through instance metadata, so no long-term secret is stored
Correct answer