Home
MCQs by exam
NTS
NTS MCQs · Page 112
5,604 multiple choice questions typical of the NTS exam, with answers and explanations. Switch on practice mode to test yourself first.
A
Test statistics leak into preprocessing, so the reported score is optimistically biased
Correct answer
B
No effect at all, because scaling cannot change model accuracy on any dataset
C
It causes the model to underfit, lowering the reported score well below the true value
D
The test set silently becomes the training set, so the model never sees genuinely new data
A
An error, because the series is shorter than the window
B
NaN, because min_periods defaults to the window size
Correct answer
C
The mean of the available values, because partial windows are used
D
Zero, because missing window values are treated as zero
A
To skip that column entirely while reading, so it never appears in the frame
B
To speed up parsing by disabling the C engine and using the Python parser
C
To stop pandas inferring ZIP codes as integers and stripping leading zeros
Correct answer
D
To force every column in the file to be parsed as text rather than numbers
A
Relative frequencies excluding NaN, so the resulting proportions sum to less than one overall
B
Boolean flags indicating whether each value is missing, aligned to the original index
C
Absolute counts per value, excluding NaN, sorted in ascending order of frequency
D
Relative frequencies per distinct value, including NaN as its own category, summing to 1
Correct answer
A
Only labels present in both frames are kept, as an inner join on the index
B
The frames are concatenated positionally and the index is ignored, so no alignment occurs
C
The index union is used and missing labels produce NaN, as an outer join on the index
Correct answer
D
An error is raised because the indexes are not identical, and the frames must be reindexed
A
A NumPy array of the whole frame
B
A tuple of the row values in column order
C
A Series for each row, indexed by the column labels
Correct answer
D
A Series for each column, indexed by the row labels
A
The data and index are copied, but the Python objects inside object columns are not recursively copied, so they remain shared
Correct answer
B
deep=True is not allowed for object dtype columns, because pandas cannot deep-copy arbitrary Python objects
C
Every nested list is deep-copied, guaranteeing full independence, so mutating one frame never affects the contents of the other
D
deep=True copies only the index and shares all of the column data, while deep=False copies the column arrays
A
Columns containing at least three non-missing values
B
Rows containing at least three non-missing values
Correct answer
C
Rows containing fewer than three missing values
D
Rows containing exactly three non-missing values
A
res.droplevel('year') returns a Series indexed by month only
Correct answer
B
res.reset_index(level='year') removes the level without adding a column
C
res.drop('year') drops the level from the index
D
res.swaplevel() removes the level entirely
A
It converts the bad entries to zero
B
It replaces them with NaN and returns a numeric dtype column
Correct answer
C
It leaves the column as object and keeps the original strings
D
It raises a ValueError listing the offending values
A
It converts every string to an interned string object, for faster hashing and lower memory use
B
It stores integer codes plus a dictionary of categories, cutting memory and enabling ordered comparisons
Correct answer
C
It drops duplicate values from the column, keeping only the first occurrence of every distinct string value
D
It permanently sorts the DataFrame by that column and rebuilds the row index in sorted order
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
Practise on paper
Preparing for NTS?
Make it your exam plan: see your progress in every subject and topic, set a daily goal and practise what you have not done yet.
Start my NTS plan
Test yourself
Take a timed online test and get a certificate, or play today's quick quiz.
Online tests
Daily quiz