Practice Library
All MCQs
Browse exam-wise, subject-wise, and country-wise MCQs with explanations.
Choose an option to check your answer.
Correct Answer: A. A distributed computing engine designed for fast, general-purpose data processing
Explanation:
Spark supports batch, SQL, machine learning, and streaming workloads.
It can run on clusters managed by YARN, Kubernetes, or standalone mode.
Choose an option to check your answer.
Correct Answer: D. It documents intent and prevents accidental interface changes
Explanation:
A clear signature helps users and tools understand an API.
It also keeps internal implementation changes from altering the exposed type unexpectedly.
Choose an option to check your answer.
Correct Answer: C. Converting an object into a form that can be stored or transmitted
Explanation:
Distributed frameworks serialize closures and data for network transfer.
Nonserializable fields can cause runtime failures.
Choose an option to check your answer.
Correct Answer: B. Blocked threads cannot perform other useful work
Explanation:
Composing callbacks or transformations preserves asynchronous execution.
Excessive blocking limits throughput and can cause deadlocks.
Choose an option to check your answer.
Correct Answer: A. Scheduling asynchronous tasks such as Future computations
Explanation:
An ExecutionContext provides threads or an execution service.
Poorly chosen contexts can cause starvation or excessive concurrency.
Choose an option to check your answer.
Correct Answer: D. A placeholder for a result that may become available asynchronously
Explanation:
Futures allow nonblocking composition of asynchronous computations.
An execution context schedules the underlying work.
Choose an option to check your answer.
Correct Answer: C. Representing a computation that may succeed or throw an exception
Explanation:
Try wraps results as Success or Failure.
Functional operations can then handle failures explicitly.
Choose an option to check your answer.
Correct Answer: B. A computation with one of two possible result types, often error or success
Explanation:
By convention, Left often contains an error and Right a success value.
Either preserves error information without throwing immediately.
Choose an option to check your answer.
Correct Answer: A. If A is a subtype of B, then F[B] is a subtype of F[A]
Explanation:
Contravariance reverses the subtype relation.
It is commonly useful for consumer-like abstractions.
Choose an option to check your answer.
Correct Answer: D. If A is a subtype of B, then F[A] is a subtype of F[B]
Explanation:
Covariance is marked with a plus sign on the type parameter.
It is appropriate for producer-like immutable types.
Choose an option to check your answer.
Correct Answer: C. A class parameterized by one or more types
Explanation:
Type parameters allow one class design to work safely with multiple data types.
For example, Box[T] can contain values of type T.
Choose an option to check your answer.
Correct Answer: B. Applies a partial function to matching elements and returns the results
Explanation:
collect combines filtering and transformation.
Inputs for which the partial function is undefined are skipped.