QUESTIONS AND ANSWERS | 2026/2027
UPDATE | 100% CORRECT - GT.
150 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 1 EXAM | FULL QUESTIONS AND ANSWERS | 2026/2027 UPDATE | 100% CORRECT -
GT.. It contains 150 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 150 Questions
Foundations - Application - CSE 6040 1 FULL AND 2026/2027 Update 100 Correct - GT Computing FOR
DATA Analysis Python Numpy Pandas SQL Algorithms Graduate
All answers with rationales
,Table of Contents
Content Area Questions Key Topics
Python Programming 1-25 Pandas, YOU NEED, Column, Compute, Shape
Fundamentals
Numpy AND Vectorized 26-50 Correctly, Pandas, Expression, Column, Python
Computation
Pandas DATA Structures 51-75 Correctly, Pandas, Python, Shape, Describes
AND Operations
DATA Cleaning AND 76-100 Column, Pandas, Dataframe, Numpy, Correctly
Preprocessing
DATA Aggregation AND 101-125 Python, Correctly, Computes, Dataframe, Returns
Group Operations
Merging Joining AND 126-150 Column, Python, Pandas, Method, Dataframe
Concatenating DATA
TOTAL 150 All questions include answers and detailed rationales
,Section A - Python Programming Fundamentals
Q1.
Given a Pandas DataFrame with a MultiIndex of (date, stock) and columns ['price',
'volume'], which expression correctly computes the rolling 5-day average price per stock,
aligned to the last day of each window?
A. df.groupby(level='stock')['price'].rolling(5). B. df.groupby(level='stock')['price'].transform
mean().reset_index(level=0, drop=True) (lambda x: x.rolling(5).mean())
C. df.groupby(level='stock')['price'].rolling(5). D. df.groupby(level='stock')['price'].rolling(5,
mean().swaplevel().sort_index() min_periods=1).mean()
Correct: A - df.groupby(level='stock')['price'].rolling(5).mean().reset_index(level=0,
drop=True)
Rationale:Option A groups by the 'stock' level and applies rolling mean, then drops the extra
index level to align back to the original index. Option B uses transform, which returns a Series
but requires the index to match; it would work but not necessarily align if the index is not
sorted. Option C swaps levels incorrectly. Option D uses min_periods=1, which changes the
window behavior and still leaves the stock level in the index.
Q2.
In SQL, consider two tables: employees(id, name, dept_id) and departments(id, name).
Which query returns the names of departments that have no employees?
A. SELECT name FROM departments B. SELECT name FROM departments d
WHERE id NOT IN (SELECT dept_id LEFT JOIN employees e ON d.id =
FROM employees) e.dept_id WHERE e.id IS NULL
C. SELECT name FROM departments d D. All of the above
WHERE NOT EXISTS (SELECT 1 FROM
employees e WHERE e.dept_id = d.id)
Correct: D - All of the above
Rationale:All three queries are valid ways to find departments without employees. Option A
uses NOT IN, but it will fail if employees.dept_id contains NULLs. Option B uses a LEFT
JOIN and checks for NULL employee id. Option C uses NOT EXISTS, which is the most
robust and efficient. Since all are correct, the answer is D.
Q3.
Which of the following NumPy operations performs an element-wise multiplication of two
2D arrays, then sums along axis 1, and finally computes the square root of each element
in the resulting 1D array?
Page 3
, Section A - Python Programming Fundamentals
A. np.sqrt(np.sum(a * b, axis=1)) B. np.sqrt(np.dot(a, b.T).sum(axis=1))
C. np.sqrt(np.einsum('ij,ij->i', a, b)) D. np.linalg.norm(a - b, axis=1)
Correct: A - np.sqrt(np.sum(a * b, axis=1))
Rationale:Option A directly performs element-wise multiplication, sums along axis 1, and
takes the square root. Option B computes a matrix product, which is not the same. Option C
uses einsum to compute the sum of products along the last axis, which is equivalent but not
exactly the same as element-wise multiplication then sum; however, it is also correct. Option
D computes the Euclidean distance, not the squared sum. Since only A is unambiguously
correct, the answer is A.
Q4.
A data scientist needs to process a large CSV file that does not fit into memory. Which
Pandas approach is most memory-efficient for computing the mean of a specific column,
assuming the file has a header and no missing values?
A. pd.read_csv('file.csv', B. pd.read_csv('file.csv', chunksize=10000)
usecols=['target']).mean() and accumulate mean manually
C. pd.read_csv('file.csv', iterator=True) and D. pd.read_csv('file.csv',
concatenate chunks memory_map=True) and then compute
mean
Correct: B - pd.read_csv('file.csv', chunksize=10000) and accumulate mean manually
Rationale:Option B processes the file in chunks, which limits memory usage to the chunk
size. Option A still loads the entire column into memory. Option C concatenates chunks,
which eventually holds the entire data. Option D memory-maps the file, but still loads the full
column when computing mean. Chunking is the standard memory-efficient approach.
Q5.
Which of the following Python code snippets correctly defines a generator function that
yields the first n Fibonacci numbers?
A. def fib(n): B. def fib(n):
a, b = 0, 1 a, b = 0, 1
for _ in range(n): for _ in range(n):
yield a yield a
a, b = b, a+b a, b = b, a
C. def fib(n): D. def fib(n):
a, b = 0, 1 a, b = 0, 1
return [a, b] * n for _ in range(n):
yield a
a, b = a+b, b
Page 4