Quiz Space

January 2023 term · Introduction to Big Data · BSDA5001

Introduction to Big Data End Term: 30 April 2023 (January 2023 term)

The IIT Madras BS Introduction to Big Data (Intro to Big Data) End Term paper sat on 30 Apr 2023, in the January 2023 term: 19 questions for 45 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
19
Marks
45
Duration
180 min
MSQ
5
MCQ
14

Updated

Official paper: IIT M DEGREE ET1 EXAM QPE2 S1 30 Apr 2023 · No negative marking.

Question 1

+3 marksOne or more correct options

What differentiates “streaming processing” from “batch processing” in the context of big data?

Select all that apply.

  1. A

    Batch operates on a set of data elements taken together while streamingoperates on data individually as it streams in

  2. B

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

  3. C

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

  4. D

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

  5. E

    Batch processing can operate on massively larger data sets than streamingcan

Show answer

Correct answers

  • B

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

  • C

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

  • D

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

Question 2

+3 marksOne or more correct options

What are the core components for a Big Data Streaming application?

Select all that apply.

  1. A

    Data needs to be retrievable from a persistent store that supports messagereplay. Replay refers to being able to fetch a specific set of data from that persistent store on-demand., where the data is chosen based on filters usually defined on sequence numbers ortimestamps

  2. B

    Data processing needs to be splittable across machines using divide-and-conquer, and composable into steps that execute very quickly

  3. C

    Hadoop needs to be setup for its big data capabilities

  4. D

    The application needs to have the cloud-native properties of being resilient,manageable and observable

  5. E

    Application needs to be deployable on public cloud natively using PaaScomponents

Show answer

Correct answers

  • A

    Data needs to be retrievable from a persistent store that supports messagereplay. Replay refers to being able to fetch a specific set of data from that persistent store on-demand., where the data is chosen based on filters usually defined on sequence numbers ortimestamps

  • B

    Data processing needs to be splittable across machines using divide-and-conquer, and composable into steps that execute very quickly

  • D

    The application needs to have the cloud-native properties of being resilient,manageable and observable

Question 3

+3 marksOne or more correct options

A big data streaming application that reads from using Kafka as source is observed to be really slow. 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. How will you scale Kafka further?

Select all that apply.

  1. A

    Increase memory in each of the brokers in the cluster

  2. B

    Add disks to each broker in the cluster

  3. C

    Add new brokers to the cluster

  4. D

    Create more topics and change input application to reroute data to all topics tobe able to spread input data better

  5. E

    Double the number of partitions for this single topic to be able to spread inputdata better

Show answer

Correct answers

  • A

    Increase memory in each of the brokers in the cluster

  • C

    Add new brokers to the cluster

Question 4

+3 marksOne or more correct options

You are given the task of improving the performance of a Spark SQL program. 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 being aggregated, whereas in reality the underlying data has a million values for that key. What actions would you perform from the below to ensure that the right estimates are used?

Select all that apply.

  1. A

    Create all tables as native Spark SQL tables (i.e. available as CatalogTables).

  2. B

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

  3. C

    Ensure cost based optimizer (CBO) is ON.

  4. D

    Run ANALYZE on all tables.

  5. E

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

Show answer

Correct answers

  • A

    Create all tables as native Spark SQL tables (i.e. available as CatalogTables).

  • C

    Ensure cost based optimizer (CBO) is ON.

  • D

    Run ANALYZE on all tables.

Question 5

+3 marksOne or more correct options

Which of the following statements are true?

Select all that apply.

  1. A

    In pull delivery, your subscriber application initiates requests to the Pub/Subserver to retrieve messages.

  2. B

    In push delivery, Pub/Sub initiates requests to your subscriber application todeliver messages.

  3. C

    Pull subscription is preferred when efficiency and throughput of messageprocessing is critical.

  4. D

    The rate of delivery needs to be controlled by the subscriber client in pushsubscription.

Show answer

Correct answers

  • A

    In pull delivery, your subscriber application initiates requests to the Pub/Subserver to retrieve messages.

  • B

    In push delivery, Pub/Sub initiates requests to your subscriber application todeliver messages.

  • C

    Pull subscription is preferred when efficiency and throughput of messageprocessing is critical.

Question 6

+2 marksOne correct option

What happens when a Spark Structured Streaming pipeline operating with Kafka as source is subject to a machine failure?

  1. A

    The data being processed when the failure happened will have producedpartial results that result in incorrect outputs.

  2. B

    The pipeline will not be restarted automatically.

  3. C

    The pipeline will be restarted automatically by Spark which is able to pick upthe exact data from Kafka which was being processed at the time of error

  4. D

    Spark will throw an error and halt

  5. E

    Spark will gracefully shut down, reboot that machine which failed and start theStructured Streaming pipeline again to continue from where it left off

Show answer

Correct answer

  • C

    The pipeline will be restarted automatically by Spark which is able to pick upthe exact data from Kafka which was being processed at the time of error

Question 7

+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 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. 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?

  1. A

    No change to business time since that remains constant at 1AM local time,only the schedule for the final weekly sum operation needs to be changed to the operational timeof Monday 3AM India time instead of Sunday 3AM Middle East time.

  2. B

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

  3. C

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

  4. D

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

  5. E

    No change required.

Show answer

Correct answer

  • A

    No change to business time since that remains constant at 1AM local time,only the schedule for the final weekly sum operation needs to be changed to the operational timeof Monday 3AM India time instead of Sunday 3AM Middle East time.

Question 8

+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 both performance and maintainability 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. The maintainability issue is because every time a new KPI summary is required, the source has to be changed to include it. Choose from the options below the option that best tackles both problems:

  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

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

  3. C

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

  4. D

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

Show answer

Correct answer

  • B

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

Question 9

+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 theML 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, andwrite pipelines to execute the model in the spider cam itself

  3. C

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

  4. D

    Compress the ML model to fit into the spider cam’s available resource, andwrite 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.

Show answer

Correct answer

  • D

    Compress the ML model to fit into the spider cam’s available resource, andwrite 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 10

+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 exposes the notion of a buffer as a way of maintaining 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 outputimmediately, and therefore there is no intermediate output necessary. Whereas, a UDAF operateson 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 many rows at a time, grouped by akey 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 outputthereby requiring a buffer.

  3. C

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

  4. D

    A UDF is a scalar operation executing on many rows at a time, grouped by akey 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-conquerapproach for computing aggregates, which uses the intermediate buffer to store partial valuesbefore finalizing the result aggregate.

Show answer

Correct answer

  • C

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

Question 11

+2 marksOne correct option

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

In the class, we saw the UDF for mobilenet_v2. Specifically, the predict() function contained the below lines of code
Why are these lines important in that pipeline of categorizing flowers?

  1. A

    They check the syntax of the model function so that there are no errors

  2. B

    They load the model into memory so that the loop iteration over each imagedoes not need to do the same operation again and again given model load times are prohibitivelyexpensive for DL models

  3. C

    They invoke PyTorch libraries that have already been setup for model scoringon GCP using APIs embedded within the function

  4. D

    They are Map-style UDFs that make it an embarrassingly parallel computationthus making the execution parallelized and fast.

Show answer

Correct answer

  • B

    They load the model into memory so that the loop iteration over each imagedoes not need to do the same operation again and again given model load times are prohibitivelyexpensive for DL models

Question 12

+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 takes 3.1 seconds on an average to execute on a Quad CPU Spark worker machine. However, the output is expected to be produced consistently within 3 seconds from having received the input. What is the best option to meet the expectations without compromising on false negatives and minimizing the amount of money & effort that is spent further?

  1. A

    Use a different DL model that is faster but has half the recall rate.

  2. B

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

  3. C

    Parallelize the DL model code using Divide-and-Conquer so that it runs faster.

  4. D

    Change Spark machine to use GPUs

Show answer

Correct answer

  • B

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

Question 13

+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 the effect of the failure at all, or will it be as though there was no failure? Select the ones from the list below that answer this question.

  1. A

    Yes, the failure is visible. The only visible effect for the external world would bein the form of a slowdown in runtime for completion of that batch as Structured Streaming retriesthe batch that failed thus taking twice as much time as normal.

  2. B

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

  3. C

    No, no failure is visible since Structured Streaming uses transactions andidempotence to achieve exactly-once processing.

  4. D

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

Show answer

Correct answer

  • B

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

Question 14

+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. Now, instead, we decide that we need to just perform a one-time batch operation, 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 codewill need to be modified, as operations on streaming dataframes are not supported on staticdataframes.

  2. B

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

  3. C

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

Show answer

Correct answer

  • B

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

Question 15

+2 marksOne correct option

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

  1. A

    Only (i)

  2. B

    Only (ii)

  3. C

    Both (i) and (ii)

  4. D

    Neither (i) nor (ii)

Show answer

Correct answer

  • A

    Only (i)

Question 16

+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) Java producer on VM on GCP → Kafka VM on GCP → Spark Streaming on Hadoop VMs on GCP → HBase on same Hadoop VMs on GCP (ii) Java producer in Google Cloud Function → Pub/Sub → Dataflow → Datastore (iii) Java producer in Kubernetes on GCP → Pub/Sub → Spark Streaming on Google Dataproc → Datastore (iv) Java producer on VM on GCP → Pub/Sub → Dataflow → Datastore (v) Java producer in Kubernetes on GCP → Kafka VM on GCP → 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 17

+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 what are the top 10 destinations being booked in descending order of count of tickets purchased where port of origin is one of the tier-1 urban centres such as Mumbai, Delhi, Chennai etc. 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 time of update so that she gets the confirmation that this is the latest data, so that she can 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 StructuredStreaming to continuously read from this topic and update the aggregates by destinations, andemit using output mode “Update”.

  2. B

    Route a copy of the ticket purchase to a Kafka topic, use Spark StructuredStreaming to periodically read from this topic every 1 minute and update the aggregates bydestinations, and emit top aggregates using the output mode “Complete”.

  3. C

    Route a copy of the ticket purchase to a Kafka topic, use Spark StructuredStreaming to periodically read from this topic every 1 minute and count the destinations in thatbatch, and emit only top 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 StructuredStreaming to periodically read from this topic every 1 minute and update the aggregates bydestinations, and emit top aggregates using the output mode “Complete”.

Question 18

+3 marksOne correct option

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

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

  1. A

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

  2. B

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

  3. C

    Each subscriber gets all messages published into Topic 1.

Show answer

Correct answer

  • C

    Each subscriber gets all messages published into Topic 1.

Question 19

+3 marksOne correct option

You are given a Spark program that runs on a Google Dataproc cluster on a daily schedule from 1AM-12PM 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 12PM the next day is no longer acceptable and instead wants approximate purchase information for each customer at least every hour. What’s more, she wants to control the computation of the outcome completely with flexibility to change the schedule as she wishes without the need for you or any other developer to be involved. Which amongst the below represents the best option to achieve the above?

  1. A

    Change the code to assume hourly data instead of daily data, changescheduler to run every hour & let her manage the execution of the code on Dataproc

  2. B

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

  3. C

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

  4. D

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

Show answer

Correct answer

  • C

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