Exercises 03¶
Course 03: course name¶
Week 01: Some name¶
Quiz 01¶
-
Which of the following are true when it comes to the business value of big data? (Select all that apply.)
- The size of the data businesses collect is growing
- Businesses are increasingly making data-driven decisions
- Automated technologies mean that data scientists and data analysts are no longer needed
-
Spark uses... (Select all that apply.)
- One very large computer that is able to run computation against large databases
- A distributed cluster of networked computers made of a driver node and many executor nodes
- Your database technology (e.g., Postgres or SQL Server) to run Spark queries
- A distributed cluster of networked computers made of many driver nodes and many executor nodes
- A driver node to distribute work across a number of executor nodes
-
How does Spark execute code backed by DataFrames? (Select all that apply.)
- It executes code determined in advance
- It optimizes your query by figuring out the best "how" to execute what you want
- It iterates over all of the source data to exhaustively evaluate queries
- It separates the "logical plan" of what you want to accomplish from the "physical plan" of how to do it so it can optimize the query
-
What are the properties of Spark DataFrames? (Select all that apply.)
- Resilient: Fault-tolerant
- Distributed: Computed across multiple nodes
- Dataset: Collection of partitioned data
- Tables: Operates as any table in SQL environments
-
What is the difference between Spark and database technologies? (Select all that apply.)
- Spark does not interact with databases but uses its proprietary DataFrame technology instead
- Spark is a highly optimized compute engine and is not a database
- Spark in an alternative to traditional databases
- Spark operates for both data storage and computation
- Spark is a computation engine and is not for data storage
-
What is Amdahl's law of scalability? (Select all that apply.)
- A formula that gives the theoretical speedup as a function of the percentage of a computation that can be parallelized
- Amdahl's law states that the speedup of a task is a function of how much of that task can be parallelized
- A formula that gives the number of processors (or other unit of parallelism) needed to complete a task
- A formula that gives the theoretical speedup as a function of the size of a partition (or subset) of data
- A formula that gives the expected speed of a single processor performing a computation
-
Spark offers a unified approach to analytics. What does this include? (Select all that apply.)
- Spark unifies applications such as SQL queries, streaming, and machine learning
- Spark allows analysts, data scientists, and data engineers to all use the same core technology
- Spark code can be written in the following languages: SQL, Scala, Java, Python, and R
- Spark is able to connect to data where it lives in any number of sources, unifying the components of a data application
- Spark unifies databases with optimized computation allowing for faster computation against the data it stores
-
What is a Databricks notebook?
- A single Spark query
- A collaborative, interactive workspace that allows you to execute Spark queries at scale
- A cluster that executes Spark code
- A Spark instance that executes queries
-
How can you get data into Databricks? (Select all that apply.)
- By "mounting" data backed by cloud storage
- By registering the data as a table
- By connecting to Dropbox or Google Drive
- By uploading it through the user interface
-
What are the qualities of big data? (Select all that apply.)
- Variety: the diversity of data
- Valorous: the positives impact of data
- Velocity: the speed of data
- Volume: the amount of data
- Veracity: the reliability of data
Answers 01¶
| Question | Answer |
|---|---|
| 1 | i, ii |
| 2 | ii, v |
| 3 | ii, iv |
| 4 | i, ii, iii |
| 5 | ii, v |
| 6 | i, ii |
| 7 | all |
| 8 | ii |
| 9 | i, ii, iv |
| 10 | i, iii, iv, v |
Quiz 02¶
-
What are the different units of parallelism? (Select all that apply.)
- Partition
- Task
- Executor
- Core
-
What is a partition?
- A division of computation that executes a query
- The result of data filtered by a WHERE clause
- A synonym with "task"
- A portion of a large distributed set of data
-
What is the difference between in-memory computing and other technologies? (Select all that apply.)
- In-memory operations were not realistic in older technologies when memory was more expensive
- In-memory operates from RAM while other technologies operate from disk
- In-memory computing is slower than other types of computing
- Computation not done in-memory (such as Hadoop) reads and writes from disk in between each step
-
Why is caching important?
- It improves queries against data read one or more times
- It always stores data in-memory to improve performance
- It reformats data already stored in RAM for faster access
- It stores data on the cluster to improve query performance
-
Which of the following is a wide transformation? (Select all that apply.)
GROUP BYORDER BYWHERESELECT
-
Broadcast joins...
- Shuffle both of the tables, minimizing data transfer by transferring data in parallel
- Transfer the smaller of two tables to the larger, increasing data transfer requirements
- Transfer the smaller of two tables to the larger, minimizing data transfer
- Shuffle both of the tables, minimizing computational resources
-
When is it appropriate to use a shuffle join?
- Never. Broadcast joins always out-perform shuffle joins.
- When the smaller table is significantly smaller than the larger table
- When both tables are very small
- When both tables are moderately sized or large
-
Which of the following are bottlenecks you can detect with the Spark UI? (Select all that apply.)
- Shuffle writes
- Shuffle reads
- Incompatible data formats
- Data Skew
-
What is a stage boundary?
- When all of the slots or available units of processing have to sync with one another
- A narrow transformation
- An action caused by a SQL query is predicate
- Any transition between Spark tasks
-
What happens when Spark code is executed in local mode?
- A cluster of virtual machines is used rather than physical machines
- The code is executed against a local cluster
- The executor and driver are on the same machine
- The code is executed in the cloud
Answers 02¶
| Question | Answer |
|---|---|
| 1 | i, ii, iii, iv |
| 2 | iv |
| 3 | ii, iv |
| 4 | iv |
| 5 | i, ii |
| 6 | iii |
| 7 | iv |
| 8 | i, ii, iv |
| 9 | i |
| 10 | iii |
Quiz 03¶
-
Decoupling storage and compute means storing data in one location and processing it using a separate resource. What are the benefits of this design principle? (Select all that apply.)
- It results in copies of the data in case of a data center outage
- Resources are isolated and therefore more manageable and debuggable
- It allows for elastic resources so larger storage or compute resources are used only when needed
- It makes updates to new software versions easier
-
You want to run a report entailing summary statistics on a large dataset sitting in a database. What is the main resource limitation of this task?
- CPU: computation is more demanding than the data transfer
- CPU: the transfer of data is more demanding than the computation
- IO: the transfer of data is more demanding than the computation
- IO: computation is more demanding that the data transfer
-
Processing virtual shopping cart orders in real time is an example of...
- Online Analytical Processing (OLAP)
- Online Transaction Processing (OLTP)
-
When are BLOB stores an appropriate place to store data? (Select all that apply.)
- For online transaction processing on a website
- For cheap storage
- For storing large files
- For a "data lake" of largely unstructured data
-
JDBC is the standard protocol for interacting with databases in the Java environment. How do parallel connections work between Spark and a database using JDBC?
- Specify the number of partitions using COALESCE. Spark then creates one parallel connection for each partition.
- Specify the number of partitions using REPARTITION. Spark then creates one parallel connection for each partition.
- Specify a column, number of partitions, and the column's minimum and maximum values. Spark then divides that range of values between parallel connections.
- Specify the numPartitions configuration setting. Spark then creates one parallel connection for each partition.
-
What are some of the advantages of the file format Parquet over CSV? (Select all that apply.)
- Compression
- Parallelism
- Corruptible
- Columnar
-
SQL is normally used to query tabular (or "structured") data. Semi-structured data like JSON is common in big data environments. Why? (Select all that apply.)
- It allows for data change over time
- It allows for easy joins between relational JSON tables
- It allows for complex data types
- It does not need a formal structure
- It allows for missing data
-
Data writes in Spark can happen in serial or in parallel. What controls this parallelism?
- The number of stages in a write operation
- The number of data partitions in a DataFrame
- The numPartitions setting in the Spark configuration
- The number of jobs in a write operation
-
Fill in the blanks with the appropriate response below: A _ table manages _and a DROP TABLE command will result in data loss.
- Managed, both the data and metadata such as the schema and data location
- Unmanaged, only the metadata such as the schema and data location
- Unmanaged, both the data and metadata such as the schema and data location
- Managed, only the metadata such as the schema and data location
Answers 03¶
| Question | Answer |
|---|---|
| 1 | ii, iii, iv |
| 2 | iii |
| 3 | ii |
| 4 | ii, iii, iv |
| 5 | iii |
| 6 | i, ii, iv |
| 7 | i, ii, v |
| 8 | ii |
| 9 | i |
Quiz 04¶
-
Machine learning is suited to solve which of the following tasks? (Select all that apply.)
- Image Recognition
- A/B Testing
- Fraud Detection
- Churn Analysis
- Natural Language Processing
- Reporting
- Financial Forecasting
-
Is a model that is 99% accurate at predicting breast cancer a good model?
- Likely yes because it accounts for false negatives and we'd want to make sure we catch every case of cancer
- Likely yes because this is generally a high score
- Likely no because there are too many false positives
- Likely no because there are not many cases of cancer in a general population
-
What is an appropriate baseline model to compare a machine learning solution to?
- The average of the dataset
- The minimum value of the dataset
- Zero
-
What is Machine Learning? (Select all that apply.)
- Statistical moments calculated against a dataset
- Learning patterns in your data without being explicitly programmed
- Hand-coded logic
- A function that maps features to an output
-
(Fill in the blanks with the appropriate answer below.) Predicting whether a website user is fraudulent or not is an example of ___ machine learning. It is a ____ task.
- unsupervised, classification
- supervised, classification
- supervised, regression
- unsupervised, regression
-
(Fill in the blanks with the appropriate answer below.) Grouping similar users together based on past activity is an example of _ machine learning. It is a _ task.
- unsupervised, clustering
- unsupervised, classification
- supervised, clustering
- supervised, classification
-
Predicting the next quarter of a company's earnings is an example of...
- Reinforcement
- Clustering
- Classification
- Semi-supervised
- Regression
-
Why do we want to perform a train/test split before we train a machine learning model? (Select all that apply.)
- To calculate a baseline model
- To evaluate how our model performs on unseen data
- To give us subsets of our data so we can compare a model trained on one versus the model trained on the other
- To keep the model from "overfitting" where it memorizes the data it has seen
-
What is a linear regression model learning about your data?
- The best split points in a decision tree
- The average of the data
- The value of the closest points to the one you're trying to predict
- The formula for the line of best fit
-
How do you define a custom function not already part of core Spark?
- You can't write your own functions in Spark
- By extending the open source code base
- With a User-Defined Function
Answers 04¶
| Question | Answer |
|---|---|
| 1 | i, ii, iii, iv, v, vii |
| 2 | iv |
| 3 | i |
| 4 | ii, iv |
| 5 | ii |
| 6 | i |
| 7 | iv |
| 8 | ii, iv |
| 9 | iv |
| 10 | iv |