Test Flashcards
9 cards from real Apache Spark practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.
Read the first 9 Test flashcards as text
The APIs for Apache Spark are
Answer: All of the above
Apache Spark provides high-level APIs in multiple programming languages to allow a broad range of developers to interact with its functionalities. These include Python (PySpark), Java, and Scala, making it versatile for different development environments. This broad support enhances its accessibility and adoption.
Which language is used to create Spark?
Answer: Scala
Apache Spark was originally written in Scala, a powerful functional and object-oriented programming language. While it offers APIs in other languages, Scala remains its native and often most performant language for development. This foundational choice contributes to Spark's efficiency.
Spark Streaming's fundamental abstraction is
Answer: Dstream
DStream (Discretized Stream) is the fundamental abstraction in Spark Streaming, representing a continuous stream of data. Internally, a DStream is represented as a sequence of RDDs, where each RDD contains data from a small time interval. This abstraction allows Spark to process live data in micro-batches.
What is Apache Spark's abstraction?
Answer: RDD and Shared Variable
Apache Spark's core abstractions are Resilient Distributed Datasets (RDDs) and Shared Variables. RDDs are immutable, fault-tolerant, distributed collections of objects, while Shared Variables (like accumulators and broadcast variables) allow for efficient sharing of data across tasks. These two abstractions form the backbone of Spark's distributed computing model.
What types of data can be used in Spark Streaming?
Answer: All of the above
Spark Streaming is designed to process live data streams from various sources. It supports integration with popular streaming data sources such as Apache Kafka, Amazon Kinesis, and Apache Flume, allowing for flexible real-time data ingestion. This versatility makes it suitable for diverse streaming analytics scenarios.
In which Spark release was the dataset introduced?
Answer: Spark 1.6
The Dataset API was introduced in Apache Spark 1.6. It aimed to provide the best of both RDDs (strong typing and compile-time safety) and DataFrames (optimized execution and query planning) by offering a type-safe, object-oriented programming interface. This addition significantly improved developer productivity and performance.
Which of the following is not a Spark Ecosystem component?
Answer: Sqoop
Sqoop is a tool for transferring data between Hadoop and relational databases, and it is not a core component of the Apache Spark ecosystem. MLlib (Machine Learning), GraphX (graph processing), and BlinkDB (approximate query engine) are all part of or closely integrated with Spark. Therefore, Sqoop stands out as an external tool.
What parameters are used to define window operation?
Answer: Window length, sliding interval
Window operations in Spark Streaming allow computations over a sliding window of data. These operations are defined by two key parameters: the 'window length,' which determines the duration of the data included in the window, and the 'sliding interval,' which specifies how often the window slides. These parameters control how data is aggregated and processed over time.
Internally, Dstream is
Answer: Continuous Stream of RDD
A DStream (Discretized Stream) in Spark Streaming is fundamentally represented as a sequence of RDDs. Each RDD within the DStream contains the data collected during a specific time batch, effectively discretizing the continuous stream into manageable units. This underlying structure enables Spark's fault tolerance and processing capabilities for streaming data.