Unit 1: Introduction to Spark - Practice Quiz

INT315 — Cluster Computing 60 Questions
0 Correct 0 Wrong 60 Left
0/60

1 What is a common limitation of Hadoop MapReduce?

Limitations of MapReduce in Hadoop Easy
A. It is mainly designed for batch processing
B. It cannot process large datasets
C. It requires all data to be stored in memory
D. It works only with relational databases

2 Why can repeated MapReduce jobs be slow?

Limitations of MapReduce in Hadoop Easy
A. They repeatedly read and write data to disk
B. They avoid using distributed storage
C. They use only a single processor
D. They require data to be manually sorted

3 Which type of workload is difficult for traditional MapReduce?

Limitations of MapReduce in Hadoop Easy
A. Large file counting
B. One-time log analysis
C. Iterative machine learning
D. Simple data aggregation

4 What does batch analytics do?

Comparison of batch vs. real-time analytics Easy
A. Processes every event immediately
B. Processes only data from sensors
C. Processes collected data in groups
D. Processes data without storing it

5 What is a key characteristic of real-time analytics?

Comparison of batch vs. real-time analytics Easy
A. It always runs once per day
B. It provides results with low delay
C. It requires data to be archived first
D. It processes only historical records

6 Which example best represents batch analytics?

Comparison of batch vs. real-time analytics Easy
A. Generating a monthly sales report
B. Monitoring a server alarm instantly
C. Detecting a fraud event immediately
D. Tracking vehicle location continuously

7 Which application commonly requires real-time analytics?

Comparison of batch vs. real-time analytics Easy
A. Yearly inventory comparison
B. Fraud detection during a payment
C. Archived document indexing
D. Annual employee evaluation

8 What is stream processing?

Application of stream processing and in-memory processing Easy
A. Processing data only from local files
B. Processing data only after yearly collection
C. Processing data as it arrives
D. Processing data without any computation

9 Which is an example of stream processing?

Application of stream processing and in-memory processing Easy
A. Printing an old annual report
B. Compressing a completed archive
C. Monitoring live sensor readings
D. Calculating a fixed textbook example

10 What does in-memory processing mean?

Application of stream processing and in-memory processing Easy
A. Deleting data before computation
B. Sending data only through email
C. Keeping data only on magnetic tape
D. Keeping data in RAM during computation

11 Why can in-memory processing improve performance?

Application of stream processing and in-memory processing Easy
A. Memory stores unlimited amounts of data
B. Memory access is faster than disk access
C. Memory eliminates the need for processors
D. Memory automatically increases data accuracy

12 Apache Spark is primarily a platform for what purpose?

Features and benefits of Spark Easy
A. Distributed data processing
B. Designing computer hardware
C. Managing email accounts
D. Creating operating system drivers

13 Which feature allows Spark to reuse data efficiently?

Features and benefits of Spark Easy
A. Printing data after each task
B. Removing all intermediate data
C. Using only one cluster machine
D. Caching data in memory

14 Which Spark component is used for SQL queries?

Features and benefits of Spark Easy
A. Spark Core
B. Spark Storage
C. Spark SQL
D. Spark Launcher

15 Which Spark component supports machine learning tasks?

Features and benefits of Spark Easy
A. Spark Shell
B. GraphX
C. Spark SQL
D. MLlib

16 Which software is generally required before installing Apache Spark?

Installation of Spark as a standalone user Easy
A. A web browser only
B. A graphics editor
C. Java
D. A spreadsheet program

17 Which command commonly starts the Spark interactive shell for Scala?

Installation of Spark as a standalone user Easy
A. scala-spark-run
B. run-spark
C. spark-shell
D. spark-start

18 What is the purpose of setting the SPARK_HOME environment variable?

Installation of Spark as a standalone user Easy
A. It creates a new database table
B. It deletes Spark log files
C. It changes the computer screen size
D. It identifies the Spark installation directory

19 Which Hadoop component is commonly used for distributed file storage?

Comparison of Spark vs. Hadoop ecosystem Easy
A. HDFS
B. YARN
C. Pig
D. Hive

20 Compared with traditional MapReduce, Spark is often faster because it can do what?

Comparison of Spark vs. Hadoop ecosystem Easy
A. Keep intermediate data in memory
B. Avoid using distributed computing
C. Replace all data storage systems
D. Process only very small datasets

21 A machine learning algorithm repeatedly processes the same dataset for 50 iterations. Why is traditional Hadoop MapReduce likely to perform poorly for this workload?

Limitations of MapReduce in Hadoop Medium
A. Map tasks cannot process numerical data
B. Reduce tasks cannot run in parallel
C. Each iteration must write intermediate results to disk
D. Hadoop requires all data to fit in memory

22 A data-processing workflow contains ten dependent MapReduce jobs. Which limitation is most likely to increase the total execution time?

Limitations of MapReduce in Hadoop Medium
A. The workflow stores every input record in a single file
B. The workflow requires repeated job startup and synchronization
C. The workflow prevents all mapper tasks from using CPUs
D. The workflow allows reducers to process data before mapping

23 Which workload best illustrates a weakness of the MapReduce programming model?

Limitations of MapReduce in Hadoop Medium
A. An iterative graph algorithm using updated vertex values
B. A one-time sort of a large collection of files
C. A single-pass count of independent web server records
D. A batch conversion of text files into sequence files

24 A bank wants to block suspicious card transactions within two seconds of their occurrence. Which processing approach is most appropriate?

Comparison of batch vs. real-time analytics Medium
A. Real-time analytics over continuously arriving events
B. Offline analytics over monthly database snapshots
C. Scheduled analytics after nightly file consolidation
D. Batch analytics over weekly transaction archives

25 A retailer calculates monthly revenue from completed sales records. Which characteristic supports using batch analytics?

Comparison of batch vs. real-time analytics Medium
A. The analysis depends on continuously changing events
B. The data can be collected before scheduled processing
C. Results are needed immediately after each sale
D. The system must react within a few milliseconds

26 Which statement best compares batch and real-time analytics for a temperature-monitoring system?

Comparison of batch vs. real-time analytics Medium
A. Batch processing always requires less storage
B. Batch processing detects threshold violations sooner
C. Real-time processing responds while measurements arrive
D. Real-time processing cannot analyze historical values

27 An application receives click events continuously and updates a dashboard every five seconds. Which technique is being applied?

Application of stream processing and in-memory processing Medium
A. Stream processing with short time windows
B. Static file processing with delayed indexing
C. Disk-only processing with full data reloads
D. Batch processing with annual partitions

28 Why can caching a repeatedly used dataset in Spark memory improve an iterative analysis?

Application of stream processing and in-memory processing Medium
A. It eliminates the need for data partitioning
B. It guarantees that every task runs on one node
C. It reduces repeated reads from disk
D. It converts all transformations into actions

29 A streaming application must calculate the number of unique users observed during each ten-minute interval. Which concept is most directly required?

Application of stream processing and in-memory processing Medium
A. File replication across independent directories
B. Single-pass sorting of the complete dataset
C. Windowed aggregation over streaming data
D. Static partition pruning over archived data

30 Which Spark feature allows the same application to combine SQL queries, machine learning, and streaming operations?

Features and benefits of Spark Medium
A. A file format restricted to unstructured text
B. A scheduler designed only for MapReduce jobs
C. A storage system limited to relational tables
D. A unified engine with multiple processing libraries

31 A Spark transformation is defined but no output is requested. Why might no computation occur immediately?

Features and benefits of Spark Medium
A. Spark requires every transformation to use SQL
B. Spark cannot execute operations on distributed data
C. Spark transformations are evaluated lazily
D. Spark stores transformations only after cluster shutdown

32 A Spark job fails after a worker loses a partition that was derived from source data. Which feature can help Spark recover the missing partition?

Features and benefits of Spark Medium
A. Automatic conversion of all data into database rows
B. Disabling task retries during cluster execution
C. Lineage-based recomputation of lost partitions
D. Permanent replication of every intermediate object

33 Which situation most strongly favors Spark over a disk-oriented batch engine?

Features and benefits of Spark Medium
A. The job repeatedly reuses a large working dataset
B. The job performs one simple archival copy
C. The job requires no transformations or aggregation
D. The job processes only a few local text lines

34 A user wants to run Spark locally without installing Hadoop. Which deployment mode is most appropriate for initial learning and testing?

Installation of Spark as a standalone user Medium
A. Local mode using a local Spark installation
B. Kubernetes mode requiring a container platform
C. YARN mode requiring a production cluster
D. Mesos mode requiring a scheduler service

35 After installing Spark, a user runs a Spark application and receives an error indicating that Java cannot be found. Which configuration should be checked first?

Installation of Spark as a standalone user Medium
A. The Spark SQL warehouse directory
B. The Hadoop replication factor
C. The SPARK_LOCAL_IP network address
D. The JAVA_HOME environment variable

36 Which command is commonly used to verify that a local Spark installation can start an interactive Python shell?

Installation of Spark as a standalone user Medium
A. pyspark
B. spark-submit --cluster
C. hdfs namenode -format
D. spark-shell

37 A standalone user wants to execute a Python Spark program from a terminal. Which tool is designed for submitting the application?

Installation of Spark as a standalone user Medium
A. hdfs dfs
B. spark-shell
C. jps
D. spark-submit

38 Which comparison between Spark and Hadoop MapReduce is most accurate?

Comparison of Spark vs. Hadoop ecosystem Medium
A. Spark can cache data, while MapReduce commonly materializes stages on disk
B. Spark runs only on one machine, while MapReduce runs only in memory
C. Spark provides storage replication, while MapReduce provides no scheduling
D. Spark replaces all Hadoop ecosystem components, including distributed storage

39 A company already uses HDFS for storage but wants faster iterative analytics. Which adoption strategy is reasonable?

Comparison of Spark vs. Hadoop ecosystem Medium
A. Replace all Hadoop services with a local filesystem
B. Run Spark on the existing Hadoop storage infrastructure
C. Remove HDFS because Spark cannot read distributed files
D. Use Spark only after converting every file into a database

40 Which workload is generally a better fit for Spark than traditional Hadoop MapReduce?

Comparison of Spark vs. Hadoop ecosystem Medium
A. A small script processing one local configuration file
B. A simple archival task with no computation
C. A one-time sequential copy of data between storage systems
D. Interactive querying of a dataset reused across many analyses

41 A machine-learning algorithm performs 30 iterations over the same training data. Each iteration reads the previous iteration's output and produces a new model. Why is classic Hadoop MapReduce generally slower than Spark for this workload?

Limitations of MapReduce in Hadoop Hard
A. MapReduce prevents combiners from operating on iterative algorithm outputs
B. MapReduce requires all iterations to use a single reducer process
C. MapReduce executes every iteration on a different resource manager
D. MapReduce serializes intermediate results to distributed storage between iterations

42 A workflow contains filter → map → filter → reduceByKey. In classic MapReduce, implementing each transformation as a separate job produces unnecessary overhead. Which Spark capability most directly reduces this overhead?

Limitations of MapReduce in Hadoop Hard
A. Conversion of all transformations into broadcast operations
B. Execution of each transformation in a separate executor
C. Pipelining of narrow transformations within a stage
D. Replication of every partition before each transformation

43 A MapReduce application receives continuously arriving events but launches one job every minute. Processing takes 40 seconds and job startup takes 20 seconds. What is the most fundamental obstacle to sub-second result latency?

Limitations of MapReduce in Hadoop Hard
A. HDFS block replication delays every mapper by one minute
B. Reducers cannot process records created during map execution
C. Job-oriented scheduling and bounded-input execution add substantial latency
D. MapReduce keys cannot contain event timestamps or sequence numbers

44 A fraud system must block suspicious payments within 500 ms, while its detection model is retrained nightly from six months of transaction history. Which architecture best matches these requirements?

Comparison of batch vs. real-time analytics Hard
A. Use batch detection and streaming model training for every transaction
B. Use one daily MapReduce job for both detection and model training
C. Use streaming detection and batch-oriented historical model training
D. Use only nightly batch processing for detection and model training

45 Events may arrive up to 10 minutes late. A dashboard computes five-minute event-time windows and must eventually include late events without retaining state forever. Which design is most appropriate?

Comparison of batch vs. real-time analytics Hard
A. Use one unbounded global window and retain all state permanently
B. Use event-time windows with a watermark defining lateness tolerance
C. Use processing-time windows and discard timestamps after ingestion
D. Use fixed batch files sorted by the event producer's host name

46 A stream receives events at an average rate of 50,000 records/s. A micro-batch interval is 2 seconds, but each micro-batch requires 3 seconds to complete under sustained load. What is the most likely long-term behavior?

Comparison of batch vs. real-time analytics Hard
A. Backlog grows because processing cannot keep pace with ingestion
B. Input rate falls automatically to the completed-batch processing rate
C. Every third batch is skipped to preserve the configured interval
D. Latency remains bounded because batches overlap without resource use

47 A stateful streaming job counts purchases per customer. After a failure, some input records may be replayed. Which combination provides the strongest basis for exactly-once observable results?

Application of stream processing and in-memory processing Hard
A. A replayable source, checkpointed state, and an idempotent or transactional sink
B. A replicated source, uncheckpointed state, and a low-latency network sink
C. A compressed source, broadcast state, and a sink with speculative execution
D. A cached source, local state, and a sink using multiple output partitions

48 Which workload is most likely to gain the greatest benefit from explicitly caching a Spark dataset?

Application of stream processing and in-memory processing Hard
A. A data-ingestion job whose output is immediately archived and deleted
B. A recursive algorithm that scans the same graph partitions repeatedly
C. A sort job whose input exceeds memory and is never accessed again
D. A one-pass ETL job that writes each transformed record once

49 An RDD is reused by several actions, but it is larger than aggregate executor memory. Which persistence strategy best avoids recomputation while tolerating memory pressure?

Application of stream processing and in-memory processing Hard
A. Broadcast the complete RDD separately to every executor
B. Use a memory-and-disk storage level for cached partitions
C. Use memory-only persistence and disable partition eviction
D. Collect the complete RDD to the driver before every action

50 A Spark program defines several transformations on a dataset, but no cluster work begins until count() is called. Which Spark design principle explains this behavior?

Features and benefits of Spark Hard
A. Actions convert narrow dependencies into broadcast dependencies
B. Transformations are lazy, and actions trigger DAG execution
C. Executors remain inactive until all partitions are cached
D. Transformations execute only after the driver terminates successfully

51 An executor loses three cached partitions of an RDD, but the source data remains available. Under normal conditions, how does Spark recover those partitions?

Features and benefits of Spark Hard
A. It restores them only from replicas maintained by the Spark driver
B. It reconstructs them by replaying the required lineage transformations
C. It restarts the entire application and reruns every completed stage
D. It retrieves mandatory duplicate copies from neighboring executors

52 Which transformation most directly introduces a wide dependency and therefore normally creates a shuffle boundary between Spark stages?

Features and benefits of Spark Hard
A. mapPartitions, because one function processes several records
B. map, because every output record changes its representation
C. reduceByKey, because values for each key may cross partitions
D. filter, because rejected records must be sent to the driver

53 A Spark job joins a 5 TB fact table with a 20 MB dimension table. Both are initially partitioned incompatibly. Which optimization most directly avoids shuffling the fact table?

Features and benefits of Spark Hard
A. Apply a Cartesian product and filter unmatched records afterward
B. Coalesce the fact table to one partition before performing the join
C. Checkpoint both tables to the same storage directory before joining
D. Broadcast the dimension table to executors and use a broadcast join

54 Spark is unpacked in /opt/spark, but running spark-shell from another directory returns command not found. Java is already installed. Which configuration most directly fixes the issue for the current user?

Installation of Spark as a standalone user Hard
A. Set PYSPARK_PYTHON=/opt/spark and disable the Spark classpath
B. Set HADOOP_HOME=/opt/spark and remove Java from PATH
C. Set SPARK_HOME=/opt/spark and add $SPARK_HOME/bin to PATH
D. Set SPARK_MASTER_HOST=/opt/spark and restart the file system

55 A user runs spark-submit --master local[*] app.py on a machine that is also configured as a Spark standalone worker. Where will the application's tasks execute?

Installation of Spark as a standalone user Hard
A. On one standalone worker selected through round-robin scheduling
B. On the submitting machine using its available local cores
C. On all workers registered with the standalone master
D. On YARN containers selected from the configured Hadoop cluster

56 A standalone Spark master is reachable at spark://master.example:7077. A submission using --master local[8] never appears in the master's web interface. What change is required?

Installation of Spark as a standalone user Hard
A. Replace local[8] with the worker's executor log directory
B. Replace local[8] with spark://master.example:7077
C. Replace local[8] with the master's HTTP web-interface URL
D. Replace local[8] with the HDFS default file-system URI

57 In Spark standalone mode, an application is submitted with deploy mode client. The user's terminal process is then terminated unexpectedly. Which outcome is most likely?

Installation of Spark as a standalone user Hard
A. The master silently recreates the driver with identical in-memory state
B. The workers elect a replacement driver without recomputing any task
C. The driver is lost, so the application normally terminates
D. The executors continue indefinitely and commit results without a driver

58 Which statement most accurately describes the relationship between Apache Spark and the Hadoop ecosystem?

Comparison of Spark vs. Hadoop ecosystem Hard
A. Spark requires HDFS and cannot operate with any alternative data source
B. Spark replaces HDFS, YARN, Hive, and all Hadoop storage formats
C. Spark can use Hadoop storage and YARN without using MapReduce execution
D. Spark is only a library that must execute inside a MapReduce reducer

59 An organization stores data in HDFS and manages resources with YARN. It wants to migrate computation from MapReduce to Spark while retaining storage and resource management. Which change is sufficient in principle?

Comparison of Spark vs. Hadoop ecosystem Hard
A. Replace HDFS with Spark RDDs and remove persistent storage
B. Retain MapReduce tasks but rename their mapper classes as executors
C. Run Spark standalone and convert every HDFS block into driver memory
D. Run Spark on YARN and continue reading and writing HDFS data

60 A 100 TB archival transformation runs once per month, performs one sequential pass, and has no interactive or iterative reuse. Which conclusion about choosing Spark over MapReduce is most defensible?

Comparison of Spark vs. Hadoop ecosystem Hard
A. Spark must be faster because it stores every intermediate result in memory
B. MapReduce must be faster because Spark cannot process data larger than RAM
C. Spark eliminates all shuffle, serialization, and distributed-storage overhead
D. Spark's advantage may be modest because the workload has little data reuse