uiz Space

May 2023 term · Introduction to Big Data · BSDA5001

Introduction to Big Data Quiz 2: 6 August 2023 (May 2023 term)

The IIT Madras BS Introduction to Big Data (Intro to Big Data) Quiz 2 paper sat on 6 Aug 2023, in the May 2023 term: 22 questions for 50 marks in 120 minutes. Every question is below with its answer. Take it as a timed mock test to be marked, or read it through first.

Questions
22
Marks
50
Duration
120 min
MCQ
16
MSQ
6

Updated

Official paper: IIT M DEGREE AN3 EXAM QPE3 06 Aug 2023 · 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 represent examples of divide-and-conquer?

  1. A

    Spark and MapReduce

  2. B

    Map and Reduce

  3. C

    Hadoop and Spark

  4. D

    MapReduce and Hadoop

Show answer

Correct answer

  • A

    Spark and MapReduce

Question 3

+3 marksOne or more correct options

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

Select all that apply.

  1. A

    MapReduce forces barrier synchronization after every step, while Spark's execution is gated on Actions

  2. B

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

  3. C

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

  4. D

    MapReduce executes linearly without parallelization, while Spark executes in parallel using Directed Acyclic Graphs

  5. E

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

Show answer

Correct answers

  • A

    MapReduce forces barrier synchronization after every step, while Spark's execution is gated on Actions

  • C

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

Question 4

+2 marksOne correct option

Which of the following statements about Spark application architecture is correct?

  1. A

    A Spark program generates a set of tasks that are grouped into stages, each of which executes concurrently with the driver being responsible for collecting results from each stage for final output.

  2. B

    A Spark action generates a job, with each job being broken down into multiple stages where a stage is a set of tasks that can be executed in parallel and stages themselves are interdependent, with each task being the unit of work mapped to an executor.

  3. C

    A Spark program generates a job, with each job being broken down into multiple stages where a stage is a set of tasks that can be executed in parallel and stages themselves are interdependent, with each task being the unit of work mapped to an executor.

  4. D

    A Spark action generates a task that is further broken down into multiple stages where a stage is a set of jobs that can be executed in parallel and stages themselves are interdependent, with each job being the unit of work mapped to an executor.

  5. E

    A Spark program generates a task that is further broken down into multiple stages where a stage is a set of jobs that can be executed in parallel and stages themselves are interdependent, with each job being the unit of work mapped to an executor.

Show answer

Correct answer

  • B

    A Spark action generates a job, with each job being broken down into multiple stages where a stage is a set of tasks that can be executed in parallel and stages themselves are interdependent, with each task being the unit of work mapped to an executor.

Question 5

+2 marksOne correct option

Consider the problem of sorting a 1 petabyte file of numbers stored in a Hadoop cluster of 10 machines where the size of each HDFS block is 100MB. Which of the below methods is the most likely to finish soonest in practice?

  1. A

    Use quicksort on each machine and then merge each machine's sorted data on the master

  2. B

    Exploit duality of hashing vs sorting and write a hash function that assigns each line in the file to a distinct machine, and then sort within each machine

  3. C

    Write a general-purpose MapReduce / Spark program that picks the Nth highest descending value from a set, invoke it iteratively from 1 to S (S=Number of lines in file), and create a new file of sorted data

  4. D

    Mergesort on each machine by limiting use of memory, and then between all possible pairs of machines

Show answer

Correct answer

  • D

    Mergesort on each machine by limiting use of memory, and then between all possible pairs of machines

Question 6

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

  2. B

    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.

  3. C

    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

  4. D

    Write a MapReduce program 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, followed by another Reduce that finally computes avg on top of all hash values.

Show answer

Correct answer

  • A

    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 7

+2 marksOne correct option

An enterprise software designer wants to leverage the best of 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 Spark, data storage on HDFS, and deploy both on Hadoop using IaaS

  2. B

    Build the data pipeline using Python run on Serverless where the data is stored on cloud storage

  3. C

    Build the data pipeline using Spark PaaS option on top of data stored on cloud storage

  4. D

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

Show answer

Correct answer

  • C

    Build the data pipeline using Spark PaaS option on top of data stored on cloud storage

Question 8

+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, is able to seamlessly react to machines going offline by again making new copies of itself in new machines, and otherwise leaves behind no trace of its workings. 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

  • B

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

Question 9

+3 marksOne or more correct options

Would IRCTC's railway ticket booking application be suitable for a serverless implementation?

Select all that apply.

  1. A

    No, because each use of the application by a prospective passenger for ticket search, date choosing, ticket seat blocking and ticket purchase is together a high complexity operation

  2. B

    No, because each use of the application by a prospective passenger for ticket search, date choosing, ticket seat blocking and ticket purchase will take a long time

  3. C

    No, because a failed step in the use of the application can result in duplicate payments

  4. D

    No, because the number of ticket searches cannot be scaled by simply running the application in multiple machines

  5. E

    No, because multiple prospective passengers have to use on a single machine (i.e. no embarrassingly parallel computation)

Show answer

Correct answers

  • A

    No, because each use of the application by a prospective passenger for ticket search, date choosing, ticket seat blocking and ticket purchase is together a high complexity operation

  • B

    No, because each use of the application by a prospective passenger for ticket search, date choosing, ticket seat blocking and ticket purchase will take a long time

  • C

    No, because a failed step in the use of the application can result in duplicate payments

Question 10

+2 marksOne correct option

Linux is an example of an operating system. Which of the following is considered as the "operating system of a cluster of machines" and why?

  1. A

    Hive, because it executes SQL queries without users having to worry about memory and disk, much like Linux

  2. B

    Spark, because it executes Python jobs without users having to worry about memory and disk, much like Linux

  3. C

    Zookeeper, because it ensures the consistency of state for all machines in the cluster

  4. D

    YARN, because it manages available resources of the cluster

Show answer

Correct answer

  • D

    YARN, because it manages available resources of the cluster

Question 11

+2 marksOne correct option
  1. A

    Set of lines one for each ID

  2. B

    Set of words one for each occurrence against each ID

  3. C

    Set of words one for each unique occurrence across IDs

  4. D

    Set of lists where each line becomes a list of words

Show answer

Correct answer

  • B

    Set of words one for each occurrence against each ID

Question 12

+3 marksOne or more correct options

You are provided with a Spark program that picks out a list of suspicious transactions based on the amount of the transaction being higher than a threshold and the geographic location of the transaction matching a known set of suspected locations provided in a small file. The Spark program is written to pull all the transactions from the Workers to the Driver and then apply the logic of threshold filtering and geographic location matching. Which of the following changes will you make to the program to improve performance?

Select all that apply.

  1. A

    Use broadcast variables

  2. B

    Hardcode threshold value as a filter condition in the Driver program

  3. C

    Filter for transactions in the Workers before bringing to the Driver

  4. D

    Hardcode threshold value as a filter condition in the Workers itself

Show answer

Correct answers

  • A

    Use broadcast variables

  • C

    Filter for transactions in the Workers before bringing to the Driver

  • D

    Hardcode threshold value as a filter condition in the Workers itself

Question 13

+2 marksOne correct option
  1. A

    Bucket name of the added file

  2. B

    Name of the added file

  3. C

    Time of creation of the file

  4. D

    Event type of the triggered event

Show answer

Correct answer

  • D

    Event type of the triggered event

Question 14

+2 marksOne correct option
  1. A

    All odd numbers are computed

  2. B

    The program throws an error

  3. C

    Nothing is computed

Show answer

Correct answer

  • C

    Nothing is computed

Question 15

+2 marksOne correct option

Consider a file “data.bin” which is formatted as follows: every data record is in the form of pairs of values of the form “column name,column value”, with each pair 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

  • C

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

Question 16

+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:

python
sc = pyspark.SparkContext ()
train_master = … #python dictionary of trains in India (about 1L trains in total)
bookings_rdd = … #Spark RDD that is having all ticket bookings of format (train_no, date, seats, ticket_price)
bookings_rdd.map( train_no => train_master.has_key(train_no) ).count ()

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 & 1

  2. B

    i & 1 followed by 2

  3. C

    i & 1 followed by 2 & 3

  4. D

    ii & 2

  5. E

    ii & 2 & 3

  6. F

    ii & 3

Show answer

Correct answer

  • D

    ii & 2

Question 17

+2 marksOne correct option

What is the output of the following code?

python
sc = pyspark.SparkContext ()
words = sc.parallelize (
['arude','rudy','helloworld','big data','rudy is rude','pyspark is not rude','rudeity','rude']
)
words_filter = words.filter(lambda x:'rude' in x)
filtered = words_filter.collect()
print(len(filtered))
  1. A

    1

  2. B

    5

  3. C

    3

  4. D

    4

Show answer

Correct answer

  • B

    5

Question 18

+2 marksOne correct option

What is the output of the following code when deployed on a spark cluster?

python
sc = pyspark.SparkContext ()
data = [1, 2, 3, 4, 5]
total = 0
rdd = sc.parallelize (data)
def increment (x):
global total
total += x
rdd.foreach (increment)
print (total)
  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • C

Question 19

+2 marksOne correct option
  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • C

Question 20

+3 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 where all Creates are new rows and all Updates are in-place, 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 stored as SCD Type II dimension tables 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

  • B

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

  • C

    Share transactions stored as facts & share prices stored as SCD Type II dimension tables in a PostgreSQL database

  • E

    Google drive account that stores all historical census data for India

Question 21

+3 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 all services used in big data are monitored, administered and cleaned at appropriate intervals.

  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.

  • 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 22

+3 marksOne or more correct options

Which of the following statements is/ are true for Google Cloud Functions?

Select all that apply.

  1. A

    Google Cloud functions work on stateless paradigm - one function invocation doesn’t depend on the previous function invocations.

  2. B

    Google cloud functions can be triggered by deletion of an object in GCS.

  3. C

    Google Cloud Functions can automatically scale-up compute in case of high load.

  4. D

    A single execution of a google cloud function is timed indefinitely till the operation finishes.

Show answer

Correct answers

  • A

    Google Cloud functions work on stateless paradigm - one function invocation doesn’t depend on the previous function invocations.

  • B

    Google cloud functions can be triggered by deletion of an object in GCS.

  • C

    Google Cloud Functions can automatically scale-up compute in case of high load.