- Home
- MCQs by exam
- PPSC IT
PPSC IT MCQs · Page 6
577 multiple choice questions typical of the PPSC IT exam, with answers and explanations. Switch on practice mode to test yourself first.
-
A
The rows are shuffled in place, so the original DataFrame's order is permanently changed
-
B
The same split is produced on repeated runs with the same inputs and library version
Correct answer
-
C
Every run is statistically independent, so no split pattern can ever repeat itself
-
D
The split is stratified automatically, keeping class proportions in both partitions
-
A
The @ prefix escapes the name, allowing identifiers that are not valid Python
-
B
The @ prefix resolves the name in the caller's scope instead of as a column label
Correct answer
-
C
The @ prefix marks the referenced name as a pandas Series, so query can broadcast it
-
D
The @ prefix disables parsing of the expression, passing it to Python's eval directly
-
A
It drops the grouping columns entirely, since apply only ever sees the remaining value columns
-
B
It raises an error, because apply callbacks returning DataFrames are no longer supported
-
C
It duplicates the keys as columns and as index levels, producing redundant result fields
-
D
It prepends the group keys to the result index, so include_groups=False changes the output
Correct answer
-
A
The whole column b is set to 1 for every row, since the mask is ignored here
-
B
Nothing changes in df, because the chained assignment writes to a temporary copy
Correct answer
-
C
Column b is updated for the matching rows, exactly as an equivalent .loc assignment would
-
D
A SettingWithCopyWarning is raised and the assignment is then silently applied
-
A
The last row of the frame only, because keep applies to the whole frame rather than rows
-
B
Both the first and last occurrences, since keep='last' keeps the boundary rows intact
-
C
The last occurrence of each email in the current row order, dropping the earlier ones
Correct answer
-
D
The first occurrence of each email address, because keep names the copy inspected
-
A
The two frames hold different row counts, which the validation step forbids
-
B
The key columns have different dtypes, so pandas cannot compare their values at all
-
C
The merge produced more columns than expected, exceeding the validation threshold
-
D
At least one side repeats a key value, so the join would produce duplicate rows
Correct answer
-
A
The cast truncates NaN to zero, raising a warning rather than an error
-
B
The fix is to cast to float16 first, because float16 supports missing values natively
-
C
int64 has no NaN representation, so the nullable Int64 dtype must be used instead
Correct answer
-
D
int64 holds NaN perfectly well, but the cast is refused because of an unrelated mismatch
-
A
The call groups by calendar month names, treating the strings as categorical data
-
B
An empty frame is returned, because no rows fall on the month-end timestamps
-
C
A TypeError about the index, because resample needs a DatetimeIndex on the axis
Correct answer
-
D
The string column is parsed automatically and the monthly totals are returned
-
A
1, 2, 2, 3, because dense ranking never leaves gaps after ties are collapsed
Correct answer
-
B
1, 2, 2, 4, because the next distinct value keeps its positional rank number
-
C
1, 2.5, 2.5, 4, because tied values receive the average of the positions they take
-
D
1, 1, 2, 3, because ties are ordered by their appearance and then renumbered
-
A
Because observed=True drops rows whose category does not appear among the group keys chosen
-
B
Because grouping a categorical converts it to an object column, losing category metadata
-
C
Because observed=True sorts the categories and then truncates the output index
-
D
Because the default expands every category combination, producing empty groups too
Correct answer
-
A
qcut, which uses sample quantiles, whereas cut splits on equal-width value ranges
Correct answer
-
B
cut, which uses sample quantiles, whereas qcut splits on equal-width value ranges
-
C
cut, because both functions are identical except for the naming of their labels
-
D
qcut, because it always produces equal-width bins regardless of the data distribution
-
A
A boolean Series aligned to the index, with NaN rows marked False unless NaN is listed
Correct answer
-
B
A boolean Series of identical length, with NaN rows marked True so every record is kept
-
C
An integer array of row positions, because isin returns the matching row numbers
-
D
A filtered DataFrame directly, since isin applies the mask as soon as it is called
-
A
df.transpose, which swaps rows and columns and therefore creates a long form table
-
B
df.melt with id_vars, which turns the monthly columns into rows of key-value pairs
Correct answer
-
C
df.pivot with the month columns as index, which expands the columns into extra rows
-
D
df.stack on axis=1, which returns a wide frame with the months kept as columns
-
A
Scattered in place, because pandas leaves NaN rows where they originally stood
-
B
The call raises, because sorting a column with NaN requires dropna first
-
C
At the end by default, because na_position defaults to last in sort_values
Correct answer
-
D
At the beginning by default, because NaN sorts before every numeric value
-
A
The duplicate cells are averaged, because the default aggregation is the mean
Correct answer
-
B
A ValueError is raised, because duplicate entries need an explicit aggfunc
-
C
The last row for each cell wins, because pivot_table keeps the final value
-
D
The rows are concatenated into a list inside the cell, preserving every value
-
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