1. Home
  2. MCQs by exam
  3. PPSC IT

PPSC IT MCQs · Page 10

577 multiple choice questions typical of the PPSC IT exam, with answers and explanations. Switch on practice mode to test yourself first.

Showing 226–250 of 577

A pipeline-free workflow calls scaler.fit_transform(X_test) before evaluating a model. What is the consequence?

  1. Test statistics leak into preprocessing, so the reported score is optimistically biased Correct answer
  2. No effect at all, because scaling cannot change model accuracy on any dataset
  3. It causes the model to underfit, lowering the reported score well below the true value
  4. The test set silently becomes the training set, so the model never sees genuinely new data
MCQSEXAM Read explanation

pd.concat([a, b], axis=1) is used on two frames whose indexes overlap only partially. What is the default result?

  1. Only labels present in both frames are kept, as an inner join on the index
  2. The frames are concatenated positionally and the index is ignored, so no alignment occurs
  3. The index union is used and missing labels produce NaN, as an outer join on the index Correct answer
  4. An error is raised because the indexes are not identical, and the frames must be reindexed
MCQSEXAM Read explanation

What caveat applies to df.copy(deep=True) for a column of dtype object holding Python lists?

  1. The data and index are copied, but the Python objects inside object columns are not recursively copied, so they remain shared Correct answer
  2. deep=True is not allowed for object dtype columns, because pandas cannot deep-copy arbitrary Python objects
  3. Every nested list is deep-copied, guaranteeing full independence, so mutating one frame never affects the contents of the other
  4. deep=True copies only the index and shares all of the column data, while deep=False copies the column arrays
MCQSEXAM Read explanation

What does converting a low-cardinality object column with astype('category') change?

  1. It converts every string to an interned string object, for faster hashing and lower memory use
  2. It stores integer codes plus a dictionary of categories, cutting memory and enabling ordered comparisons Correct answer
  3. It drops duplicate values from the column, keeping only the first occurrence of every distinct string value
  4. It permanently sorts the DataFrame by that column and rebuilds the row index in sorted order
MCQSEXAM Read explanation

What does pd.merge(left, right, how='outer', indicator=True) add to the result?

  1. A boolean column showing whether the join key was unique in both of the input frames
  2. It raises an error if any of the keys fail to match, instead of reporting them in the result
  3. It sorts the result by the join key automatically and resets the index of the output
  4. A _merge column whose values are left_only, right_only or both, showing each row's origin Correct answer
MCQSEXAM Read explanation

How does df.groupby('k')['x'].transform('mean') differ from .apply('mean')?

  1. Both return one row per group, differing only in the index name that the resulting object carries afterwards
  2. transform can only be used with user-defined functions, while apply also accepts built-in method strings
  3. transform returns a Series aligned to the original index with the same length, while apply returns one value per group Correct answer
  4. apply returns a column the same length as the input frame itself, while transform reduces the result to one row per group
MCQSEXAM Read explanation

df2 = df[df.a > 0]; df2['b'] = 1; raises SettingWithCopyWarning. Why?

  1. Because boolean indexing always returns a tuple of arrays, so assignment cannot tell which of the two arrays to modify in place here
  2. Because column b does not exist in df, so pandas must decide whether to create it on the copy or on the parent frame
  3. Boolean indexing returns a new object that may still reference the parent's data, so chained assignment has an ambiguous target Correct answer
  4. Because assigning a scalar to a new column is not allowed after filtering, and pandas raises a warning instead
MCQSEXAM Read explanation

What fundamentally distinguishes a container from a virtual machine?

  1. A container includes a hypervisor of its own, while a VM does not, so a container needs more privileged hardware
  2. Containers cannot be networked, unlike virtual machines, which each receive their own network stack
  3. A VM shares the host kernel while a container virtualises the hardware, which is why a VM starts faster
  4. Containers share the host kernel and isolate at the process level, whereas each VM runs its own guest kernel Correct answer
MCQSEXAM Read explanation

Declarative infrastructure-as-code tools are described as idempotent. What does that mean in practice?

  1. Resources are created only in the first apply of each day, and later runs are silently skipped
  2. The tool rolls back every change made by a failed run, restoring the previous state automatically and safely
  3. Applying the same template repeatedly converges to the same state instead of creating duplicate resources Correct answer
  4. Each apply must be run exactly once, since repeated runs change resource identifiers every time
MCQSEXAM Read explanation

Which response header primarily controls how long a CDN edge may serve a cached object before revalidating?

  1. Cache-Control with max-age, and s-maxage which overrides it for shared caches Correct answer
  2. Content-Length, which sets the freshness window in seconds for the response
  3. ETag, which fixes the cache lifetime and forces revalidation on every single request
  4. Vary, which sets a separate cache lifetime per client and per user agent string
MCQSEXAM Read explanation

Which workload is the best fit for interruptible spot or preemptible instances?

  1. A single-instance production database with no replica and a strict uptime requirement
  2. A licensing server that must stay online during business hours and cannot tolerate a restart
  3. A stateful session store for a shopping cart that must survive an abrupt termination
  4. A checkpointed batch rendering job that can resume after a two-minute interruption notice Correct answer
MCQSEXAM Read explanation

S3 Standard advertises eleven nines of durability but only 99.99 percent availability. What does this distinction mean?

  1. Both figures describe exactly the same property measured over different periods, so eleven nines and 99.99 percent must always agree in practice
  2. Eleven nines actually refers to availability and 99.99 percent to durability, so the two numbers are simply swapped labels
  3. Durability measures the request latency, while availability measures the error rate of the service under sustained load
  4. Durability is the probability of not losing a stored object, while availability is the fraction of time the service responds successfully Correct answer
MCQSEXAM Read explanation

Which is the accurate difference between a layer 4 and a layer 7 load balancer?

  1. Layer 4 inspects HTTP headers and cookies, while layer 7 works only on raw IP addresses and port numbers
  2. Layer 4 terminates TLS for every client connection, while layer 7 cannot, because it needs the decrypted payload to route
  3. Layer 4 routes on IP and port information from TCP or UDP, while layer 7 can inspect HTTP paths, headers and cookies Correct answer
  4. Layer 7 is faster because it forwards raw packets without parsing them, which layer 4 must always do
MCQSEXAM Read explanation

Which statement correctly contrasts an AWS security group with a network ACL?

  1. Both are stateful, but only the security group can explicitly deny traffic from a given source address
  2. Both are stateless, and the only difference is that a NACL applies to one instance while a security group applies to a subnet
  3. The security group is stateful and allows only allow rules, while the NACL is stateless and supports both allow and deny rules Correct answer
  4. The security group is stateless and evaluated in numbered order, while the NACL is stateful and supports allow rules only
MCQSEXAM Read explanation

What is a cold start in a serverless function platform?

  1. The first invocation after any code deployment, which is always noticeably slower by design and by contract
  2. The restart of the function after it exceeds its memory limit, which clears the warm container pool
  3. A scheduled invocation triggered by a timer event, which wakes a function that has never run
  4. The added latency when a new execution environment must be created and initialised before the handler runs Correct answer
MCQSEXAM Read explanation