Quiz Space

January 2024 term · Introduction to Big Data · BSDA5001

Introduction to Big Data End Term: 28 April 2024 (January 2024 term)

The IIT Madras BS Introduction to Big Data (Intro to Big Data) End Term paper sat on 28 Apr 2024, in the January 2024 term: 30 questions for 60 marks in 180 minutes. Every question is below with its answer. Take it as a timed mock test to be marked, or read it through first.

Questions
30
Marks
60
Duration
180 min
MCQ
22
MSQ
8

Updated

Official paper: IIT M DEGREE FN EXAM QDB1 28 Apr 2024 · No negative marking.

Question 1

+2 marksOne correct option

What best describes "big data"?

  1. A

    Big data is used to refer to the set of technologies built around Hadoop

  2. B

    Big data refers to the cloud-native design principle

  3. C

    Big data is about All data, Any Time, Any Method

  4. D

    Big data is about volume, velocity, variety

Show answer

Correct answer

  • C

    Big data is about All data, Any Time, Any Method

Question 2

+2 marksOne correct option

Which of these are implementations of the divide-and-conquer paradigm?

  1. A

    Spark and Map

  2. B

    Serverless and Message Broker

  3. C

    Hadoop and Spark

  4. D

    MapReduce and Google Cloud Functions

Show answer

Correct answer

  • C

    Hadoop and Spark

Question 3

+2 marksOne correct option

A website sees 1 Billion hits every month. The website owner wants to count average hits per customer in the latest month, where a customer is denoted by the IP address of the device from which the customer is accessing the website. The owner has at his disposal a Hadoop cluster of 5 workers and 2 masters each with 1GB of RAM. Which of the following methods is the most likely to finish fastest?

  1. A

    Write a MapReduce program where the Map does nothing useful, Combine computes the aggregated hits per customer, Shuffle combined data based on IP address across workers, and in the Reduce, build hash table on each machine with hash key = IP address and hash value = counter, followed by another Reduce that finally computes the avg on top of all hash values.

  2. B

    Write a Spark program that forms a Dataframe as grouping by IP address with count as aggregate, followed by a take into a list in the Spark driver which further computes the average of all the individual counts in the list

  3. C

    Write a Spark program that forms a Dataframe as grouping by IP address with count as aggregate, followed by another stage that computes the avg on top of the Dataframe of the first stage

  4. D

    Write a MapReduce program where 2 pairs of Map Reduce are chained together: 1^(st) pair is where the Map does nothing useful, Shuffle data based on IP address across workers, and in the Reduce, build hash table on each machine with hash key = IP address and hash value = counter, while the 2^(nd) pair is another Map that does nothing useful followed by a Reduce that finally computes avg on top of all hash values.

  5. E

    All will finish in approximately the same time.

Show answer

Correct answer

  • C

    Write a Spark program that forms a Dataframe as grouping by IP address with count as aggregate, followed by another stage that computes the avg on top of the Dataframe of the first stage

Question 4

+2 marksOne correct option

An enterprise software designer wants to leverage the best of Google cloud to minimize the number of administrative overheads associated with her big data pipeline while also getting on- demand scalability without sacrificing flexibility. What option should she choose to best serve these needs?

  1. A

    Build the data pipeline using VMs – one for Python & one for storing files

  2. B

    Build the data pipeline using Python running on Google Cloud Functions where the data is stored on GCS

  3. C

    Build the data pipeline using MapReduce on, data storage on HDFS, and deploy both on Dataproc

  4. D

    Build the data pipeline using Dataflow on top of data stored on GCS

Show answer

Correct answer

  • D

    Build the data pipeline using Dataflow on top of data stored on GCS

Question 5

+2 marksOne correct option

Consider an application that can scale from handling 1000 users to handling 100 million users by simply making copies of itself, logs information about its workings on a central logger backed by Kafka, but has no automation to detect task failures and retry. Which of the following statements is true?

  1. A

    This application has adopted cloud-native design

  2. B

    This application cannot be called as cloud-native since it is not observable at all times

  3. C

    This application cannot be called as cloud-native since it is not manageable easily

  4. D

    This application cannot be called as cloud-native since it is not resilient

Show answer

Correct answer

  • D

    This application cannot be called as cloud-native since it is not resilient

Question 6

+2 marksOne correct option

Consider a file “data.bin” which is formatted as follows: every data record has 10 key-value pairs of the format “key:value”, with each pair separated by a comma. Every data record occurs in its own line. You are asked to write a data processing script using Python that scales with big data. Which of the following represents your approach?

  1. A

    Since data.bin is compliant with the RFC 4180, use PySpark’s read_csv() to read the data as is.

  2. B

    Rename the file data.bin to data.csv to make it compliant with RFC 4180 and then use PySpark’s read_csv() to read the data

  3. C

    The problem cannot be solved since the file cannot be converted to a valid format for reading consistently without additional information

  4. D

    Write PySpark code to read all lines in data.bin, use string split on “,” as delimiter, and then collect all column names and corresponding values into a RDD for further processing

Show answer

Correct answer

  • A

    Since data.bin is compliant with the RFC 4180, use PySpark’s read_csv() to read the data as is.

Question 7

+2 marksOne correct option

Consider the program outline as below running on a Spark cluster of 1 driver and 4 worker nodes with 2 executors per worker node:

Consider the below mutually-exclusive characterisations about the program:
i. Program will not run since RDD transformation operation map() runs on Executors that is referencing a variable train_master which is declared in the Spark driver
ii. Program will run successfully and produce the count of bookings that match for trains present in the train_master
For either of the 2 characterizations, consider the following (one or more) actions you could carry out in order to improve on the characterizations:
1. Program will need to be changed to bring the train_master into the Closure for executors to pick it up
2. Program will perform more poorly as the number of executors per worker node increases. Broadcast of train_master will need to be used to make it perform better.
3. Program will perform more poorly as the number of worker nodes increases (keeping number of executors per worker node constant). Broadcast of train_master will need to be used to make it perform better.
Which of the following combinations of statements are correct?

  1. A

    i and 1

  2. B

    i and 1 followed by 2

  3. C

    i and 1 followed by 2 & 3

  4. D

    ii and both 2 & 3

  5. E

    ii and 2

  6. F

    ii and 3

Show answer

Correct answer

  • E

    ii and 2

Question 8

+2 marksOne correct option

What happens when a Spark Structured Streaming pipeline operating with Kafka as source is subject to a failure of a machine in either of the Kafka cluster or the Spark cluster?

  1. A

    Failure of a machine in the Kafka cluster will result in an Exception in the Spark pipeline which will then fail and halt.

  2. B

    The Spark pipeline will not be able to start again from previously committed offset by restarting itself, resulting in at least-once processing semantics

  3. C

    Irrespective of whatever machine fails, Spark will throw an error and halt.

  4. D

    Data that is being processed will not be processed again, resulting in atmost- once semantics.

  5. E

    The pipeline will be restarted automatically by Spark which is able to pick up the exact data from Kafka which was being processed at the time of error, resulting in exactly- once semantics.

Show answer

Correct answer

  • E

    The pipeline will be restarted automatically by Spark which is able to pick up the exact data from Kafka which was being processed at the time of error, resulting in exactly- once semantics.

Question 9

+2 marksOne correct option

A big data streaming application that uses Kafka as source is observed to be really lagging behind currently live data. The Kafka cluster has 2 broker nodes and this application is reading from 1 topic that has 10 partitions. On closer investigation, it was found that Kafka is not scaling to the velocity of input data coming in. What can you first try to do to scale Kafka further while incurring minimal overall costs?

  1. A

    Add disks to each broker in the cluster, and disks are the cheapest computer component

  2. B

    Increase memory in each of the brokers in the cluster. While cost of memory is more than cost of disks, it is still cheaper than adding brokers and helps to scale.

  3. C

    Add new brokers to the cluster, even though this is more expensive than the other options this is the only foolproof way to scale.

  4. D

    Create more topics and change input application to reroute data to all topics to be able to spread input data better. This is nearly the least expensive since only developer effort is required to change application.

  5. E

    Double the number of partitions for this single topic to be able to spread input data better. This is the least expensive since only administrator effort is required without changing application.

Show answer

Correct answer

  • B

    Increase memory in each of the brokers in the cluster. While cost of memory is more than cost of disks, it is still cheaper than adding brokers and helps to scale.

Question 10

+2 marksOne correct option

A company with headquarters (HQ) in the Middle East operates on a Sunday-Thursday weekday schedule with Friday & Saturday as weekend days. It computes end of week revenue numbers using an ETL pipeline by first computing sales for each day at 1AM local time of the next day, and then summing up the weekly sales every Sunday early morning at 3AM local time. This number gets reported to leadership every Sunday morning 9AM local time, so the ETL pipeline is scheduled to run every Sunday morning at 8AM local time. As a result of management change, it has decided to relocate its HQ to India. Which of the following changes will need to be done to its ETL pipeline to ensure the correct output continues to be produced?

  1. A

    The business time for the final weekly sum operation needs to be changed to that of Monday 3AM India time instead of Sunday 3AM Middle East time.

  2. B

    There is zero change needed since neither event time nor business time is changing whereas only the operational time is changing.

  3. C

    Since time zone has changed as well as week definition too, the definition of business time has changed. So, the ETL has to be rewritten entirely.

  4. D

    Nothing needs to change since daily sales is available at 1AM Middle East time which is anyway behind India time and so the numbers will be available before leadership comes in at 9AM.

  5. E

    Event time has changed since the event of week ending has changed in definition, and so the ETL needs to be changed to consider the new event in the data.

Show answer

Correct answer

  • B

    There is zero change needed since neither event time nor business time is changing whereas only the operational time is changing.

Question 11

+2 marksOne correct option

You are appointed as a Data Engineer in a company that has a legacy reporting application written in Java which suffers from performance problems. The reporting application plots dashboards with near real-time refresh (once every minute) of key business indicators to help management take live decisions. The application reads data directly from the source database of MongoDB, aggregates using simple counts and shows them visually in a UI. The performance problem of this application comes because the source database is at times overloaded and therefore the dashboard is not able to refresh fast enough. Choose the best option that gives the best performance with minimal maintenance effort:

  1. A

    Since MongoDB is OLTP, it is not able to support business reporting. So, replace it with Hadoop which supports OLAP better

  2. B

    Convert the application from using plain Java to using Spark Streaming in Java

  3. C

    Extract raw data from MongoDB using Change Data Capture (CDC) once every minute into Kafka, and then use Spark Streaming to compute the KPIs and then populate into a NoSQL DB like Redis for the UI to consume.

  4. D

    Query MongoDB every 1 minute for new data using a check on document inserted timestamp, use Spark Streaming to compute the KPIs with the queried data, and then populate into a NoSQL DB like Redis for the UI to consume.

  5. E

    Convert application to using Python along with a NoSQL database for storing and retrieving the aggregated counts.

Show answer

Correct answer

  • C

    Extract raw data from MongoDB using Change Data Capture (CDC) once every minute into Kafka, and then use Spark Streaming to compute the KPIs and then populate into a NoSQL DB like Redis for the UI to consume.

Question 12

+2 marksOne correct option

Dhoni is on the crease with a bat in hand that has sensors embedded throughout. The sensors talk to the spider cam every second. The spider cam is itself a powerful ARM based computer which has connectivity to the cloud through the wire on which it hangs. Using this connectivity, it can send as much or as little data as required and also receive instructions from the cloud. There is a machine learning model which suggests to the batsman to loosen the grip on his bat or tighten it based on the shots played using the sensor measurements. The way the suggestion happens is using dynamic vibration intensity communicated to the sensors embedded in the bat handle. Your task is to design the data pipeline that enables such feedback to Dhoni ideally before every ball with as much accuracy as possible throughout the match. Which of the following options best satisfies the requirements?

  1. A

    Ingest all data into Pub/Sub, process using Google Cloud Dataflow, invoke the ML model, and then write back output from Cloud to the spider cam to relay to the bat.

  2. B

    Compress the ML model to fit into the spider cam’s available resource, and write pipelines to execute the model in the spider cam itself

  3. C

    Compress the ML model to fit into the spider cam’s available resource, and write pipelines to execute in the spider cam itself, with periodically data being sent to the cloud, retrain the model using Google Cloud ML and then redeploy the model to the spider cam.

  4. D

    Compress the data in the spider cam every 5 seconds, write to Pub/Sub the compressed data, invoke the ML model and then write back output from Cloud to the spider cam to relay to the bat.

Show answer

Correct answer

  • C

    Compress the ML model to fit into the spider cam’s available resource, and write pipelines to execute in the spider cam itself, with periodically data being sent to the cloud, retrain the model using Google Cloud ML and then redeploy the model to the spider cam.

Question 13

+2 marksOne correct option

In the class, we saw the UDF for mobilenet_v2. By definition, UDFs are scalar. In Spark, there is another class of user defined routines called UDAFs, which stand for User Defined Aggregator Functions. UDAFs are meant to provide a means to write a custom aggregation function which aggregates over a grouping of values to arrive at a single value. UDAF structure differs saliently from UDFs in that it provides a buffer to keep track of intermediate state before finalizing aggregate output. Why is a buffer required for UDAF and not for a UDF?

  1. A

    A UDF is a scalar operation executing on 1 row at a time and producing output immediately, and therefore there is no intermediate output necessary. Whereas, a UDAF operates on multiple rows which will require multiple passes for the final output thereby requiring a buffer.

  2. B

    A UDF is a scalar operation executing on 1 row at a time and producing output immediately, and therefore there is no intermediate output necessary. Whereas, a UDAF operates on multiple rows of unbounded size requiring a divide-and-conquer approach for computing aggregates, which uses the intermediate buffer to store partial values before finalizing the result aggregate.

  3. C

    A UDF is a scalar operation executing on many rows at a time, grouped by a key and producing a single output, and therefore there is no intermediate output necessary. Whereas, a UDAF operates on multiple rows which will require multiple passes for the final output thereby requiring a buffer.

  4. D

    A UDF is a scalar operation executing on many rows at a time, grouped by a key and producing a single output, and therefore there is no intermediate output necessary. Whereas, a UDAF operates on multiple rows of unbounded size requiring a divide-and-conquer approach for computing aggregates, which uses the intermediate buffer to store partial values before finalizing the result aggregate.

Show answer

Correct answer

  • B

    A UDF is a scalar operation executing on 1 row at a time and producing output immediately, and therefore there is no intermediate output necessary. Whereas, a UDAF operates on multiple rows of unbounded size requiring a divide-and-conquer approach for computing aggregates, which uses the intermediate buffer to store partial values before finalizing the result aggregate.

Question 14

+2 marksOne correct option

In the class, we saw the UDF for mobilenet_v2. Specifically, the predict() function contained the below lines of code

Suppose there’s a new transformer model from Facebook that is orders of magnitude bigger than mobilenet_v2 but that is able to provide better F1 score. Will these lines of code still be required in the pipeline?

  1. A

    Yes, since they check the syntax of the model function so that there are no errors

  2. B

    Yes, they invoke PyTorch libraries that have already been setup for model scoring on GCP using APIs embedded within the function

  3. C

    No, since the primary function of these lines of code is to eliminate repeated DL model loads as DL models are large in size

  4. D

    Yes, they are Map-style UDFs that make it an embarrassingly parallel computation thus making the execution parallelized and fast.

  5. E

    Yes, since the new model will potentially have large load times.

Show answer

Correct answer

  • E

    Yes, since the new model will potentially have large load times.

Question 15

+2 marksOne correct option

You are given a Spark Streaming pipeline that invokes a pre-trained DL model for every image it receives as input and produces the classification result in quick time. The model with the best recall rate from the PyTorch library already runs in under 3 seconds on an average, when executing on a single GPU Spark worker machine. However, your management has instructed you to reduce the cost of AI projects significantly. What is the best option to explore to meet the expectations without compromising on false negatives while also being within 10-20% of the average execution time?

  1. A

    Build a custom model that compresses the highest recall rate model just enough to be able to execute within the stipulated time, and measure recall.

  2. B

    Use a different DL model from PyTorch that is already compressed to half the size.

  3. C

    Remove complexity associated with Spark Streaming and convert the model execution pipeline into a single threaded Python application running on the same GPU machine.

  4. D

    Change Spark machine to use CPUs and train a fresh pipeline to achieve objectives.

Show answer

Correct answer

  • A

    Build a custom model that compresses the highest recall rate model just enough to be able to execute within the stipulated time, and measure recall.

Question 16

+2 marksOne correct option

Consider a Structured Streaming application running on Google Dataproc firing up every 10 seconds, consuming any number of records from Kafka available since last read, and emitting some computed answers to another Kafka topic. Consider also that apart from the functional logic, the same application is also emitting into a file the start time and end time of every batch invocation for audit purposes.
Assume there is a failure in one of the Dataproc machines that results in a failure of a specific run. For the external world (i.e. anybody consuming the outputs of this application), will they see any change in output as a result of the failure at all, or will the only visible impact of failure be of slower performance for the failed-and-retried run?

  1. A

    No, the failure is not visible. The only visible effect for the external world would be in the form of a slowdown in runtime for completion of that mini-batch as Structured Streaming retries the mini-batch that failed thus taking twice as much time as normal.

  2. B

    No, the failure is not visible since Structured Streaming uses transactions and idempotence to achieve exactly-once processing.

  3. C

    No, the failure is not visible since Structured Streaming can process the same data in a retry resulting in the same outputs again.

  4. D

    Yes, the failure is visible because the side effect of emitting timestamps in a batch will be visible as 2 consecutive Start timestamps without any end timestamp as Structured Streaming retries the failed batch.

  5. E

    Yes, the failure is visible since the logs in the backend of Spark Structured Streaming are also logging the state of the machine.

Show answer

Correct answer

  • D

    Yes, the failure is visible because the side effect of emitting timestamps in a batch will be visible as 2 consecutive Start timestamps without any end timestamp as Structured Streaming retries the failed batch.

Question 17

+2 marksOne correct option

Let us say we are using structured streaming for continuously reading data from Kafka and storing the results back into a Kafka topic using window function aggregates. Now, instead, we decide that we need to just perform a one-time batch operation using the same logic, where there is a need to read specific data from Kafka (i.e. using pre-determined offsets). How will we need to modify the code to make it work?

  1. A

    The read and write commands will remain the same, but the remaining code will need to be modified, as operations on streaming dataframes are not supported on static dataframes.

  2. B

    The entire code will need to be modified as the APIs for stream and batch processing are completely different.

  3. C

    The read and write commands need to be modified to specify that it’s a batch operation. Further, the specific logic of window functions will also need to be modified since there are no time windows anymore in batch processing.

  4. D

    Only the read and write commands need to be modified to specify that it's a batch operation.

Show answer

Correct answer

  • D

    Only the read and write commands need to be modified to specify that it's a batch operation.

Question 18

+2 marksOne correct option

Consider a Kafka system that has two brokers with the exact same resources. Let’s consider a topic A with a single partition, whose two copies are being maintained in sync by Kafka. Consider the following cases:
Case 1: Each broker has one copy of the partition
Case 2: Both the copies reside in the same broker
Two of the key promises of Kafka are:
(i) Availability
(ii) Throughput
Regarding which of the above promises, case 1 is at an advantage as compared to case 2?

  1. A

    Only (ii)

  2. B

    Only (i)

  3. C

    Both (i) and (ii)

  4. D

    Neither (i) nor (ii)

Show answer

Correct answer

  • B

    Only (i)

Question 19

+2 marksOne correct option

Kubernetes is an open-source system for automating deployment, scaling and management of containerized applications. Google Datastore and HBase are both highly-scalable NoSQL database systems for interactive, real-time applications. Consider the following pipeline choices for effecting the same outcome:
(i) Shell producer on VM on GCP → Pub/Sub → Spark Streaming on Hadoop VMs on GCP → HBase on same Hadoop VMs on GCP
(ii) Shell producer in Google Cloud Function → Kafka VM on GCP → Dataflow → Datastore (iii) Shell producer in Kubernetes on GCP → Pub/Sub → Spark Streaming on Google Dataproc → Datastore
(iv) Shell producer on VM on GCP**→** Pub/Sub → Dataflow**→** Datastore
(v) Shell producer in Kubernetes on GCP → Pub/Sub → Spark Streaming on Hadoop VMs on GCP → HBase on same Hadoop VMs on GCP
Which option below represents the correct order of pipeline options that has the “most IaaS” entry to the left and the “most PaaS” entry to the right?

  1. A

    (i), (v), (iii), (iv), (ii)

  2. B

    (i), (ii), (iii), (iv), (v)

  3. C

    (ii), (iii), (i), (iv), (v)

  4. D

    (v), (iii), (i), (iv), (ii)

  5. E

    All are equally PaaS / IaaS

Show answer

Correct answer

  • A

    (i), (v), (iii), (iv), (ii)

Question 20

+2 marksOne correct option

A Spark Streaming application is configured to execute once per minute. However, each run takes 10+ minutes consistently resulting in a never-ending backlog of work. The code in a nutshell looks as follows:

python
clicks = ( # schema - adId: String, clickTime: Timestamp, ...
spark
.readStream
.format("kafka")
.option("subscribe", "clicks")
…
.load()
)
clicks
.join(pages, “pageId”)
.groupBy(“pageName”)
.count()

Your goal is to optimize the code to bring down execution of each iteration within 1 minute. Which of the following represent options that will help in this mission?

  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • B

Question 21

+2 marksOne correct option

You are given a Spark program that runs on a Google Dataproc cluster on a daily schedule from 8PM-10PM to produce as output the total amount of purchases made by every customer the previous day. The data is coming into GCS every minute from a variety of sources as standalone files. Therefore, the business leader now feels that having to wait till 10PM the next day is no longer acceptable and instead wants approximate purchase information for each customer at least every 5 minutes. What’s more, she wants to be able to change this time window later as she pleases without involving you. Which amongst the below represents the best option to achieve the above?

  1. A

    Change the code to run every 5 minutes, no other change required

  2. B

    Change the code to leverage Spark Streaming with streaming window as “5 minutes”, & let her manage the execution of the code on Dataproc

  3. C

    Change the code to leverage Spark Streaming with streaming window as “5 minutes”, convert from Dataproc to Dataflow, & let her manage the execution of the code on Dataflow

  4. D

    Write a Cloud Function to move all incoming per-minute standalone files from GCS to Pub/Sub, change the code to leverage Spark Streaming with streaming window as “5 mins”, convert from Dataproc to Dataflow, point source to Pub/Sub, & let her manage the execution of the code on Dataflow

Show answer

Correct answer

  • C

    Change the code to leverage Spark Streaming with streaming window as “5 minutes”, convert from Dataproc to Dataflow, & let her manage the execution of the code on Dataflow

Question 22

+2 marksOne correct option

Since it is the onset of summer, there is a surge in railway ticket bookings. The business head at IRCTC is interested in a real-time view of all of her stations irrespective of whether there were bookings or not. She wants to see this be presented in a monitor mounted in her office wall that refreshes with the latest info on an India map every 1 minute. Along with the info, there also needs to be the current time so that she gets a visual confirmation that this is the latest data. This dashboard allows her to plan for new summer-special trains as required. What solution option below best solves for the need?

  1. A

    Route a copy of the ticket purchase to a Kafka topic, use Spark Structured Streaming to continuously read from this topic and update the aggregates by destinations, and emit using output mode “Update”.

  2. B

    Route a copy of the ticket purchase to a Kafka topic, use Spark Structured Streaming to periodically read from this topic every 1 minute and update the aggregates by destinations, and emit all aggregates using the output mode “Complete”.

  3. C

    Route a copy of the ticket purchase to a Kafka topic, use Spark Structured Streaming to periodically read from this topic every 1 minute and count the destinations in that batch, and emit only all aggregates in that batch using the output mode “Append”.

Show answer

Correct answer

  • B

    Route a copy of the ticket purchase to a Kafka topic, use Spark Structured Streaming to periodically read from this topic every 1 minute and update the aggregates by destinations, and emit all aggregates using the output mode “Complete”.

Question 23

+2 marksOne or more correct options

What option(s) best describe the differences between MapReduce and Spark?

Select all that apply.

  1. A

    MapReduce leverages memory heavily, while Spark optimizes for disk-based computations

  2. B

    MapReduce forces barrier synchronization after every step, while Spark uses directed acyclic graphs to execute as many steps as possible in parallel

  3. C

    MapReduce leverages disk heavily, while Spark optimizes for memory-based computations

  4. D

    MapReduce enables massively parallel computation, while Spark's driver program sequentially executes each worker

  5. E

    MapReduce is restricted in flexibility since only Map and Reduce are possible steps, while Spark has a variety of Actions possible making it highly flexible

Show answer

Correct answers

  • B

    MapReduce forces barrier synchronization after every step, while Spark uses directed acyclic graphs to execute as many steps as possible in parallel

  • C

    MapReduce leverages disk heavily, while Spark optimizes for memory-based computations

Question 24

+2 marksOne or more correct options

You are provided with a Spark program that picks out a list of suspicious transactions. It’s logic is based on both the financial value of the transaction and the geographic location of the transaction. If the financial value is higher than a threshold and the geographic location is from a set of suspected locations (provided as a 1MB file), then the program deems the transaction as suspicious. The version of the Spark program given to you is written in such a way that it pulls all the transactions from the Workers to the Driver and then applies the logic. Which 2 changes from the list below will get you the most benefit in performance?

Select all that apply.

  1. A

    Use broadcast variables for the 1MB file

  2. B

    Hardcode threshold value as a filter condition in the Driver program

  3. C

    Reorder operations on the Driver such that geographic location is checked first before filtering high value transactions

  4. D

    Hardcode threshold value as a filter condition in the Workers itself

Show answer

Correct answers

  • A

    Use broadcast variables for the 1MB file

  • D

    Hardcode threshold value as a filter condition in the Workers itself

Question 25

+2 marksOne or more correct options

Which of the following types of data sources can you read successfully without missing data using a program that extracts once every day? If no data is missed, then all data in source will match data extracted successfully.

Select all that apply.

  1. A

    A MySQL table that is modelled as a Type II SCD where all Creates are new rows and all Updates are appended only, and these can happen anytime during the day.

  2. B

    A Linux machine’s system.log file into which all processes append their events

  3. C

    Share transactions stored as facts & share prices updated in-place in a PostgreSQL database

  4. D

    A weather API that provides the temperature & rainfall readings for all its weather stations in India for the specific time instant when being queried

  5. E

    Google drive account that stores all historical census data for India

Show answer

Correct answers

  • A

    A MySQL table that is modelled as a Type II SCD where all Creates are new rows and all Updates are appended only, and these can happen anytime during the day.

  • B

    A Linux machine’s system.log file into which all processes append their events

  • E

    Google drive account that stores all historical census data for India

Question 26

+2 marksOne or more correct options

Which of the following is true?

Select all that apply.

  1. A

    Snapshots of source systems can be created using an event capture tool like CDC and then replaying the events in sequence for that time period.

  2. B

    A data lake is a collection of data to be provided as input for data science algorithms.

  3. C

    Zookeeper is a library for ensuring that critical services used in big data are able to stay in sync with each other as to the health of those services.

  4. D

    A single Spark cluster can have multiple “leader” master nodes.

  5. E

    Spark is optimized for in-memory computation.

  6. F

    Given the RDD underlying a Dataframe, you can recreate the same Dataframe provided you know the schema

Show answer

Correct answers

  • A

    Snapshots of source systems can be created using an event capture tool like CDC and then replaying the events in sequence for that time period.

  • C

    Zookeeper is a library for ensuring that critical services used in big data are able to stay in sync with each other as to the health of those services.

  • E

    Spark is optimized for in-memory computation.

  • F

    Given the RDD underlying a Dataframe, you can recreate the same Dataframe provided you know the schema

Question 27

+2 marksOne or more correct options

What are some capabilities common to both “streaming processing” & “batch processing” when using Spark for big data?

Select all that apply.

  1. A

    Batch operates on a set of data elements taken together while streaming can also operate on a set of data elements as determined by the window

  2. B

    Batch operates on data that is static while streaming operates on data that is dynamically changing

  3. C

    Batch processing can assume data as fully specified and complete while streaming cannot make that assumption

  4. D

    Batch processing is typically high latency while streaming processing is necessary for real-time latencies

  5. E

    Both Streaming & Batch processing can operate on massively large data sets

  6. F

    Both Streaming and Batch processing in Spark can use the same syntax for programming the main functional logic of the application

Show answer

Correct answers

  • A

    Batch operates on a set of data elements taken together while streaming can also operate on a set of data elements as determined by the window

  • E

    Both Streaming & Batch processing can operate on massively large data sets

  • F

    Both Streaming and Batch processing in Spark can use the same syntax for programming the main functional logic of the application

Question 28

+2 marksOne or more correct options

Which of the following are best practices associated with Streaming applications?

Select all that apply.

  1. A

    Use a message store that supports message replay so that no data is lost in processing.

  2. B

    “Hot potato” principle is when the streaming application operates on the minimum amount of processing to produce valid output, which then becomes input for the next minimal processor, and so on, thus ensuring that no single process is doing too many things in one go.

  3. C

    Hadoop is best suited for executing Streaming applications.

  4. D

    Use checkpointing when faced with mission-critical workloads that require 100% accuracy.

  5. E

    Handle state pollution by restarting the persistent store software periodically.

Show answer

Correct answers

  • A

    Use a message store that supports message replay so that no data is lost in processing.

  • B

    “Hot potato” principle is when the streaming application operates on the minimum amount of processing to produce valid output, which then becomes input for the next minimal processor, and so on, thus ensuring that no single process is doing too many things in one go.

  • D

    Use checkpointing when faced with mission-critical workloads that require 100% accuracy.

Question 29

+2 marksOne or more correct options

You are given the task of improving the performance of a Spark SQL program that is doing a simple count after a series of transformations. You suspect that the culprit is the main transformation job in the program. When you run EXPLAIN on that SQL, you see that Spark wrongly estimates that there are only 10 values for the key on which the main transformation job is hinged upon, whereas in reality the underlying data has a million values for that key. What actions would you perform from the below to improve performance of the program?

Select all that apply.

  1. A

    Create all tables as external tables.

  2. B

    Ensure cost based optimizer (CBO) is ON.

  3. C

    Partition all tables on the same key on which the aggregate is happening.

  4. D

    Run ANALYZE on all tables to ensure the right estimates are available to the optimizer.

  5. E

    Cache the table in a step with actions ahead of the SQL statement that is the culprit.

Show answer

Correct answers

  • B

    Ensure cost based optimizer (CBO) is ON.

  • D

    Run ANALYZE on all tables to ensure the right estimates are available to the optimizer.

  • E

    Cache the table in a step with actions ahead of the SQL statement that is the culprit.

Question 30

+2 marksOne or more correct options

Observe the below image and select the options that are true.

Select all that apply.

  1. A

    Each subscriber gets one third of all messages published into Topic 1.

  2. B

    Publisher 1 can safely send data only for Subscriber 1’s consumption while restricting access to Subscribers 2 & 3.

  3. C

    Subscriber 2 gets all messages published into Topic 1 by Publisher 1 but only half of Publisher 2’s messages.

  4. D

    Each subscriber gets all messages published into Topic 1.

Show answer

Correct answer

  • D

    Each subscriber gets all messages published into Topic 1.