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 requires all data to be stored in memory
B. It works only with relational databases
C. It cannot process large datasets
D. It is mainly designed for batch processing

2 Why can repeated MapReduce jobs be slow?

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

3 Which type of workload is difficult for traditional MapReduce?

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

4 What does batch analytics do?

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

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. Monitoring a server alarm instantly
B. Tracking vehicle location continuously
C. Detecting a fraud event immediately
D. Generating a monthly sales report

7 Which application commonly requires real-time analytics?

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

8 What is stream processing?

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

9 Which is an example of stream processing?

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

10 What does in-memory processing mean?

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

11 Why can in-memory processing improve performance?

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

12 Apache Spark is primarily a platform for what purpose?

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

13 Which feature allows Spark to reuse data efficiently?

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

14 Which Spark component is used for SQL queries?

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

15 Which Spark component supports machine learning tasks?

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

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. spark-start
B. scala-spark-run
C. run-spark
D. spark-shell

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

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

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

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

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

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

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. Hadoop requires all data to fit in memory
B. Each iteration must write intermediate results to disk
C. Reduce tasks cannot run in parallel
D. Map tasks cannot process numerical data

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 requires repeated job startup and synchronization
B. The workflow stores every input record in a single file
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. A one-time sort of a large collection of files
B. A single-pass count of independent web server records
C. An iterative graph algorithm using updated vertex values
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. Batch analytics over weekly transaction archives
B. Real-time analytics over continuously arriving events
C. Scheduled analytics after nightly file consolidation
D. Offline analytics over monthly database snapshots

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. Results are needed immediately after each sale
C. The system must react within a few milliseconds
D. The data can be collected before scheduled processing

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

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

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. Static file processing with delayed indexing
B. Batch processing with annual partitions
C. Stream processing with short time windows
D. Disk-only processing with full data reloads

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 reduces repeated reads from disk
C. It guarantees that every task runs on one node
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. Single-pass sorting of the complete dataset
B. Windowed aggregation over streaming data
C. File replication across independent directories
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 scheduler designed only for MapReduce jobs
B. A file format restricted to unstructured text
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. Permanent replication of every intermediate object
D. Lineage-based recomputation of lost partitions

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

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

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. YARN mode requiring a production cluster
C. Kubernetes mode requiring a container platform
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 SPARK_LOCAL_IP network address
C. The Hadoop replication factor
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. spark-shell
B. spark-submit --cluster
C. hdfs namenode -format
D. pyspark

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. jps
B. hdfs dfs
C. spark-submit
D. spark-shell

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 replaces all Hadoop ecosystem components, including distributed storage
C. Spark provides storage replication, while MapReduce provides no scheduling
D. Spark runs only on one machine, while MapReduce runs only in memory

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. Run Spark on the existing Hadoop storage infrastructure
B. Use Spark only after converting every file into a database
C. Replace all Hadoop services with a local filesystem
D. Remove HDFS because Spark cannot read distributed files

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. Interactive querying of a dataset reused across many analyses
C. A simple archival task with no computation
D. A one-time sequential copy of data between storage systems

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 executes every iteration on a different resource manager
B. MapReduce serializes intermediate results to distributed storage between iterations
C. MapReduce requires all iterations to use a single reducer process
D. MapReduce prevents combiners from operating on iterative algorithm outputs

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. Replication of every partition before each transformation
B. Execution of each transformation in a separate executor
C. Conversion of all transformations into broadcast operations
D. Pipelining of narrow transformations within a stage

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. Reducers cannot process records created during map execution
B. Job-oriented scheduling and bounded-input execution add substantial latency
C. HDFS block replication delays every mapper by one minute
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 one daily MapReduce job for both detection and model training
B. Use streaming detection and batch-oriented historical model training
C. Use batch detection and streaming model training for every transaction
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 processing-time windows and discard timestamps after ingestion
C. Use fixed batch files sorted by the event producer's host name
D. Use event-time windows with a watermark defining lateness tolerance

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 replicated source, uncheckpointed state, and a low-latency network sink
B. A compressed source, broadcast state, and a sink with speculative execution
C. A cached source, local state, and a sink using multiple output partitions
D. A replayable source, checkpointed state, and an idempotent or transactional sink

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 one-pass ETL job that writes each transformed record once
B. A data-ingestion job whose output is immediately archived and deleted
C. A sort job whose input exceeds memory and is never accessed again
D. A recursive algorithm that scans the same graph partitions repeatedly

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. Collect the complete RDD to the driver before every action
B. Broadcast the complete RDD separately to every executor
C. Use memory-only persistence and disable partition eviction
D. Use a memory-and-disk storage level for cached partitions

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. Executors remain inactive until all partitions are cached
B. Actions convert narrow dependencies into broadcast dependencies
C. Transformations execute only after the driver terminates successfully
D. Transformations are lazy, and actions trigger DAG execution

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 reconstructs them by replaying the required lineage transformations
B. It retrieves mandatory duplicate copies from neighboring executors
C. It restores them only from replicas maintained by the Spark driver
D. It restarts the entire application and reruns every completed stage

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. map, because every output record changes its representation
B. filter, because rejected records must be sent to the driver
C. reduceByKey, because values for each key may cross partitions
D. mapPartitions, because one function processes several records

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. Coalesce the fact table to one partition before performing the join
B. Broadcast the dimension table to executors and use a broadcast join
C. Apply a Cartesian product and filter unmatched records afterward
D. Checkpoint both tables to the same storage directory before joining

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 HADOOP_HOME=/opt/spark and remove Java from PATH
B. Set SPARK_MASTER_HOST=/opt/spark and restart the file system
C. Set SPARK_HOME=/opt/spark and add $SPARK_HOME/bin to PATH
D. Set PYSPARK_PYTHON=/opt/spark and disable the Spark classpath

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 the submitting machine using its available local cores
B. On all workers registered with the standalone master
C. On one standalone worker selected through round-robin scheduling
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 HDFS default file-system URI
D. Replace local[8] with the master's HTTP web-interface URL

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 driver is lost, so the application normally terminates
B. The executors continue indefinitely and commit results without a driver
C. The master silently recreates the driver with identical in-memory state
D. The workers elect a replacement driver without recomputing any task

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 is only a library that must execute inside a MapReduce reducer
D. Spark can use Hadoop storage and YARN without using MapReduce execution

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. Retain MapReduce tasks but rename their mapper classes as executors
B. Run Spark standalone and convert every HDFS block into driver memory
C. Run Spark on YARN and continue reading and writing HDFS data
D. Replace HDFS with Spark RDDs and remove persistent storage

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 eliminates all shuffle, serialization, and distributed-storage overhead
B. Spark must be faster because it stores every intermediate result in memory
C. MapReduce must be faster because Spark cannot process data larger than RAM
D. Spark's advantage may be modest because the workload has little data reuse