QUESTIONS AND ANSWERS | 2026/2027
UPDATE | 100% CORRECT - GT.
129 Questions with Answers and Detailed Rationales
100 PERCENT GUARANTEED PASS
INSTANT DOWNLOAD ANSWERS INCLUDED
IMPORTANCE OF THIS DOCUMENT
This comprehensive examination preparation guide has been meticulously developed to help you succeed in the
CSE 6040 MIDTERM 2 EXAM | QUESTIONS AND ANSWERS | 2026/2027 UPDATE | 100% CORRECT - GT.. It
contains 129 carefully selected questions that reflect the most current exam content and testing strategies. Each
question is accompanied by a correct answer and a detailed rationale that explains the underlying
pathophysiology, pharmacology, or clinical reasoning.
Self-Assessment – Test your knowledge and Exam Preparation – Familiarize yourself with the
identify areas requiring further question format and content
study areas
Concept Reinforcement – Deepen your Confidence Building – Develop test-taking
understanding through strategies and reduce
evidence-based exam anxiety
rationales
Time Management – Practice answering
questions under simulated
exam conditions
Review Summary 129 Questions
Foundations - Application - CSE 6040 2 AND 2026/2027 Update 100 Correct - GT Computing FOR DATA
Analysis Python Numpy Pandas SQL Spark Graduate
All answers with rationales
,Table of Contents
Content Area Questions Key Topics
Probability AND Statistics 1-22 Pandas, Dataframe, Operations, Correctly, YOU NEED
Linear Algebra AND Matrix 23-44 Spark, Dataframe, Value, Operation, Correctly
Operations
Optimization AND Gradient 45-66 Graph, Describes, Technique, Distributed, Standard
Descent
DATA Wrangling AND 67-88 Pandas, Operation, Dataframe, Graph, Numpy
Cleaning
Exploratory DATA Analysis 89-110 Large, Operation, YOU NEED, Format, Value
Machine Learning 111-129 Large, Spark, Dataframe, Compute, Columns
Fundamentals
TOTAL 129 All questions include answers and detailed rationales
,Section A - Probability AND Statistics
Q1.
You have a pandas DataFrame with millions of rows and you need to apply a custom
function to each row that depends on the previous row's computed value. Which
approach is most efficient and correct?
A. Use df.apply with axis=1 and a Python B. Use a for loop with itertuples and update
function that reads the previous result from a list.
a global variable.
C. Vectorize the logic using numpy D. Use pd.concat with shifted columns and
operations and cumsum or shift. apply a vectorized function.
Correct: C - Vectorize the logic using numpy operations and cumsum or shift.
Rationale:Vectorizing with numpy operations like cumsum or shift leverages C-level loops
and avoids Python-level iteration. Options A and B are slow due to Python overhead. Option
D can help but may not handle dependencies on previous computed values; C is the most
efficient and correct for many sequential dependencies that can be expressed as cumulative
operations.
Q2.
When using Spark DataFrames, which of the following operations triggers a shuffle?
A. filter() B. select()
C. groupBy().agg() D. withColumn()
Correct: C - groupBy().agg()
Rationale:groupBy().agg() requires shuffling data across partitions to group by keys. filter,
select, and withColumn are narrow transformations that do not require data movement across
partitions.
Q3.
Consider the following SQL query on a table 'orders' with columns: order_id, customer_id,
order_date, amount. Which query correctly finds the top 3 customers by total amount
spent, but only including orders from the last 30 days?
A. SELECT customer_id, SUM(amount) AS B. SELECT customer_id, SUM(amount) AS
total FROM orders WHERE order_date >= total FROM orders GROUP BY customer_id
DATE_SUB(CURDATE(), INTERVAL 30 ORDER BY total DESC LIMIT 3;
DAY) GROUP BY customer_id ORDER BY
total DESC LIMIT 3;
Page 3
, Section A - Probability AND Statistics
C. SELECT customer_id, amount FROM D. SELECT customer_id, SUM(amount) AS
orders ORDER BY amount DESC LIMIT 3; total FROM orders WHERE order_date >=
DATE_SUB(CURDATE(), INTERVAL 30
DAY) ORDER BY total DESC LIMIT 3;
Correct: A - SELECT customer_id, SUM(amount) AS total FROM orders WHERE
order_date >= DATE_SUB(CURDATE(), INTERVAL 30 DAY) GROUP BY customer_id
ORDER BY total DESC LIMIT 3;
Rationale:A filters by date, groups by customer, sums amounts, orders by total, and limits to
3. B ignores the date filter. C does not aggregate. D orders by total without grouping, causing
a syntax error.
Q4.
A pandas Series has a MultiIndex with levels 'year' and 'month'. You want to compute the
month-over-month percentage change in the value for each year independently. Which
code achieves this?
A. s.groupby(level='year').pct_change() B. s.pct_change()
C. s.unstack().pct_change(axis=1).stack() D. s.groupby(level='month').pct_change()
Correct: A - s.groupby(level='year').pct_change()
Rationale:groupby(level='year') groups by year, then pct_change() computes percentage
change within each group, giving month-over-month change for each year. B computes
overall change ignoring year boundaries. C may not preserve order correctly. D groups by
month, not year.
Q5.
In NumPy, you have a 2D array X of shape (1000, 500). Which expression computes the
row-wise mean centered data (each row minus its mean) efficiently?
A. X - X.mean(axis=0) B. X - X.mean(axis=1, keepdims=True)
C. X - X.mean(axis=1) D. (X - X.mean()) / X.std()
Correct: B - X - X.mean(axis=1, keepdims=True)
Rationale:X.mean(axis=1, keepdims=True) computes row means and keeps the dimension,
allowing broadcasting to subtract from each row. A subtracts column means. C without
keepdims results in a 1D array that broadcasts incorrectly. D standardizes the whole array,
not row-wise mean centering.
Page 4