1. Home
  2. MCQs by exam
  3. NTS

NTS MCQs · Page 88

5,604 multiple choice questions typical of the NTS exam, with answers and explanations. Switch on practice mode to test yourself first.

Showing 2176–2200 of 5,604

A skewed income column must be split into four groups of equal count. Which function does that, and what does the other do instead?

  1. qcut, which uses sample quantiles, whereas cut splits on equal-width value ranges Correct answer
  2. cut, which uses sample quantiles, whereas qcut splits on equal-width value ranges
  3. cut, because both functions are identical except for the naming of their labels
  4. qcut, because it always produces equal-width bins regardless of the data distribution
MCQSEXAM Read explanation

df['city'].isin(['Lahore', 'Karachi']) is used as a row filter. What does it return, and how are NaN rows treated?

  1. A boolean Series aligned to the index, with NaN rows marked False unless NaN is listed Correct answer
  2. A boolean Series of identical length, with NaN rows marked True so every record is kept
  3. An integer array of row positions, because isin returns the matching row numbers
  4. A filtered DataFrame directly, since isin applies the mask as soon as it is called
MCQSEXAM Read explanation

A wide table with one column per month must become long, with month and value columns. Which call does that?

  1. df.transpose, which swaps rows and columns and therefore creates a long form table
  2. df.melt with id_vars, which turns the monthly columns into rows of key-value pairs Correct answer
  3. df.pivot with the month columns as index, which expands the columns into extra rows
  4. df.stack on axis=1, which returns a wide frame with the months kept as columns
MCQSEXAM Read explanation

df.pivot_table(index='dept', columns='month', values='sales') is called without aggfunc. What happens when several rows share a dept and month?

  1. The duplicate cells are averaged, because the default aggregation is the mean Correct answer
  2. A ValueError is raised, because duplicate entries need an explicit aggfunc
  3. The last row for each cell wins, because pivot_table keeps the final value
  4. The rows are concatenated into a list inside the cell, preserving every value
MCQSEXAM Read explanation

A workload streams 10 TB a month out to the internet while ingesting the same volume. Which cost dominates, and why?

  1. Egress dominates, because data transferred out to the internet is billed and inbound is free Correct answer
  2. Ingress dominates, because inbound data is billed per gigabyte while outbound egress is free of charge
  3. They cost the same, because both directions are billed at the identical per-gigabyte rate today
  4. Neither is billed, because traffic remains free while it stays within a single AWS region
MCQSEXAM Read explanation

A bucket replicates to another region with S3 Cross-Region Replication. What recovery point objective does the replica give?

  1. The bucket's versioning window, because the replica retains every prior object version written
  2. Near-zero but not zero, because replication is asynchronous and may lag by seconds or minutes Correct answer
  3. Exactly zero, because replication is synchronous and commits the object to both regions together
  4. Zero for new objects only, since existing objects are copied synchronously when it is enabled
MCQSEXAM Read explanation

A table is written with 10 items per second, each item 6 KB in size. How many write capacity units are needed?

  1. 10, because DynamoDB charges one write unit per item regardless of the individual item size
  2. 30, because each item rounds up to three units and the remaining size is ignored here
  3. 120, because writes are billed twice over when the table uses eventual consistency
  4. 60, because each 6 KB item consumes six write units and ten are written per second Correct answer
MCQSEXAM Read explanation

A VPC subnet is created with CIDR 10.0.4.0/24 in AWS. How many IP addresses can actually be assigned to resources?

  1. 254, because only the network and broadcast addresses are unusable inside a subnet here
  2. 250, because AWS reserves six addresses once the VPC router is also counted
  3. 251, because AWS reserves five addresses in every subnet for networking functions Correct answer
  4. 256, because a /24 mask leaves eight host bits with no addresses reserved
MCQSEXAM Read explanation

In KMS envelope encryption, what is the role of the data key?

  1. It replaces the customer master key for all requests, sharply reducing KMS API call volume
  2. It is a plaintext credential that must be rotated manually with every object written
  3. It encrypts the data locally, and is itself stored encrypted under a KMS customer key Correct answer
  4. It encrypts the customer master key, so the master key never leaves the KMS service
MCQSEXAM Read explanation

A static site on CloudFront must serve a corrected file immediately everywhere. Which approach avoids stale edge copies most reliably?

  1. Issue an invalidation for /* first, then upload the fixed file to the same key
  2. Set the origin's Cache-Control max-age to zero, which flushes all existing edge copies at once
  3. Reduce the default TTL to 60 seconds, which bounds how long an edge copy is stale
  4. Version the object key, such as app-v2.js, so the CDN path itself is new and uncached Correct answer
MCQSEXAM Read explanation

What does setting reserved concurrency on a Lambda function actually do?

  1. It raises the function's default timeout to match the reserved concurrency value in seconds
  2. It provisions dedicated EC2 capacity that is billed whether or not it is invoked
  3. It carves out and caps concurrency for that function, throttling it beyond the limit Correct answer
  4. It guarantees the function never cold-starts, by keeping the reserved pool warm
MCQSEXAM Read explanation

A consumer receives an SQS message, then its visibility timeout expires before it is deleted. What happens next?

  1. The message stays invisible until the queue's retention period eventually expires
  2. The message becomes visible again and another consumer may process it a second time Correct answer
  3. The message is permanently deleted, because the expired timeout counts as an acknowledgement
  4. The message moves to the dead-letter queue immediately, since the receive has failed
MCQSEXAM Read explanation

An object archived to S3 Glacier Flexible Retrieval must be readable within minutes. Which retrieval tier applies and how is it priced?

  1. Instant, which is the only tier available to Glacier Flexible Retrieval archive objects
  2. Expedited, which typically returns data in 1-5 minutes and is the most expensive tier Correct answer
  3. Bulk, which returns data within 5-12 hours and is the cheapest of the available tiers
  4. Standard, which returns data in 3-5 hours and costs the same as expedited retrieval
MCQSEXAM Read explanation

How does an RDS Multi-AZ standby differ from a read replica in normal operation?

  1. Both are synchronous copies, but only the standby can serve read queries under load
  2. Both are asynchronous copies, and either can be promoted to primary without any data loss at all
  3. The standby is synchronous and not readable, while a replica is asynchronous and queryable Correct answer
  4. The standby is asynchronous and readable, while a replica is synchronous and write-only
MCQSEXAM Read explanation

An EBS gp3 volume is created with default settings. What baseline performance does it provide regardless of volume size?

  1. 16000 IOPS and 1000 MiB/s, the maximum that any gp3 volume can ever reach
  2. 3000 IOPS and 125 MiB/s, with extra IOPS and throughput purchased separately Correct answer
  3. 3000 IOPS and 250 MiB/s, with throughput scaling automatically with volume size
  4. 100 IOPS per GiB and 250 MiB/s, both scaling in proportion to the volume's size
MCQSEXAM Read explanation

Which statement correctly distinguishes instance store from EBS-backed volumes on EC2?

  1. Instance store is ephemeral local disk tied to the host, while EBS persists independently Correct answer
  2. Instance store survives a stopped instance, while EBS volumes are deleted with the host
  3. Both are network-attached, but instance store offers higher durability by replicating twice
  4. Instance store is billed per gigabyte-month, while EBS is included in the instance price
MCQSEXAM Read explanation

What does the cooldown period of an Auto Scaling group actually prevent?

  1. New instances from receiving traffic until their health checks have passed twice in a row
  2. Scale-in events entirely, so the group can only ever grow during a traffic spike
  3. The load balancer from deregistering instances that are still serving requests
  4. Further scaling actions until metrics stabilise, avoiding repeated over-correction Correct answer
MCQSEXAM Read explanation

Why is an IAM role preferred over an IAM user with access keys for code running on an EC2 instance?

  1. The role issues an encrypted access key that is written to the instance's root volume at boot
  2. The role removes the need for any permission policy at all, since the instance identity is trusted by default
  3. The role lets the instance share one access key with other accounts without extra configuration
  4. The role issues short-lived credentials through instance metadata, so no long-term secret is stored Correct answer
MCQSEXAM Read explanation

A destructor throws while the stack is already unwinding from another exception. What is the outcome in C++11 and later?

  1. Both exceptions are merged into a std::nested_exception and rethrown together
  2. The program continues normally, with the destructor's exception silently discarded
  3. std::terminate is called, because two active exceptions cannot propagate at once Correct answer
  4. The new exception replaces the old one and unwinding continues from that point
MCQSEXAM Read explanation

An iterator it points into a std::map. The statement it = m.erase(it); is executed. What does it hold afterwards?

  1. The value m.begin(), because erasing resets all stored iterators
  2. The iterator to the following element, which erase returned by value Correct answer
  3. An invalidated iterator, so incrementing it afterwards is undefined behaviour
  4. The iterator to the erased element, which remains allocated but detached
MCQSEXAM Read explanation

A single-argument constructor is marked explicit. What does that prevent?

  1. Direct-initialisation, so objects can only be created through a factory function
  2. Copy construction, so the type can no longer be stored inside standard containers
  3. Aggregate initialisation, since the class is no longer an aggregate after the change
  4. Implicit conversion from the argument type at call sites and in copy-initialisation Correct answer
MCQSEXAM Read explanation

A lambda captures a local int by reference with [&] and is stored in a std::function that outlives the enclosing function. What happens when it is invoked later?

  1. It reads a valid value, because std::function extends the lifetime of captures
  2. It reads a dangling reference, because the local died with its stack frame Correct answer
  3. It reads the value the local held, because capture by reference copies on escape
  4. It throws std::bad_function_call, since the captured reference has expired
MCQSEXAM Read explanation

Why can a function template not be partially specialised in C++?

  1. Function templates are chosen by overload resolution, so partial ordering fills that role Correct answer
  2. Partial specialisation of function templates was removed by the C++11 standard revision
  3. A function template needs a class template wrapper before it can be specialised at all
  4. Partial specialisation is allowed, but only when every template parameter is a reference type
MCQSEXAM Read explanation