
Question bank
CDP Data Analyst
40 CDP Data Analyst questions with the correct answer and a written explanation, organised across 4 exam domains.
- 40 questions
- 4 domains
- Foundation level
Question index
Jump straight to any question. Answers and explanations are inline.
Data Analysis
16 questions in this domain
- Question 1Single Choice
What is the primary difference between aggregate functions and window functions in SQL?
- AAggregate functions collapse rows into a single summary per group, while window functions retain all rows and compute values over a defined set of rows.Correct answer
- BWindow functions collapse rows into a single summary per group, while aggregate functions retain all rows.
- CBoth aggregate functions and window functions always collapse rows into a single output row.
- DAggregate functions require a PARTITION BY clause, while window functions require a GROUP BY clause.
Why this is the answer
Aggregate functions combine multiple rows into one per group (using GROUP BY), losing row-level detail. Window functions use OVER() to perform calculations over a set of rows while preserving each row in the output.
- Question 2Multiple Select
Which of the following statements about the PARTITION BY clause in window functions are correct? (Select all that apply)
- APARTITION BY defines groups for the window function calculation.Correct answer
- BRows within the same partition are processed separately from other partitions.Correct answer
- CPARTITION BY collapses rows into a single summary per partition.
- DPARTITION BY is optional and, if omitted, the window function is applied to the entire result set.Correct answer
Why this is the answer
PARTITION BY splits rows into groups; the window function computes for each row based on its partition. It does not collapse rows; all rows are retained. Without PARTITION BY, the window spans the whole result set.
- Question 3Interactive
Examine the following SQL query intended to rank products by sales within each region. Identify the mistake in the window function specification.
- AThe RANK() function is missing a PARTITION BY clause for region.Correct answer
- BThe ORDER BY clause should use DESC instead of ASC.
- CThe RANK() function should be replaced with ROW_NUMBER().
- DThe window function does not need an OVER clause.
Why this is the answer
The query used RANK() OVER (ORDER BY sales DESC) which ranks globally. To rank within each region, PARTITION BY region must be added.
- Question 4Single Choice
In statistical summaries, what does the STDDEV_SAMP function compute?
- ASample standard deviationCorrect answer
- BPopulation standard deviation
- CSample variance
- DPopulation variance
Why this is the answer
STDDEV_SAMP computes the standard deviation of a sample (using n-1 denominator). Population standard deviation is computed with STDDEV_POP.
- Question 5Multiple Select
Which functions can be used to compute approximate percentiles in CDP? (Select all that apply)
- APERCENTILE_APPROX() in ImpalaCorrect answer
- BapproxQuantile() in Spark DataFramesCorrect answer
- CPERCENTILE() in Impala
- Dpercentile_approx in Spark SQLCorrect answer
Why this is the answer
PERCENTILE_APPROX in Impala and percentile_approx/approxQuantile in Spark compute approximate percentiles. PERCENTILE in Impala computes exact percentiles but only for arrays.
- Question 6Interactive
An analyst wants to detect outliers in a revenue column. Which statistical summary is most appropriate as an initial step?
- ACompute quartiles (Q1, Q3) to calculate the interquartile range (IQR).Correct answer
- BCompute the mean and standard deviation only.
- CCompute the minimum and maximum values.
- DCompute the correlation with another variable.
Why this is the answer
Quartiles and IQR are robust to skew and extreme values, making them the first choice for outlier detection. Mean and std dev can be misleading in skewed distributions.
- Question 7Single Choice
What does the COALESCE function return when called with COALESCE(NULL, 'default', 'fallback')?
- A'default'Correct answer
- B'fallback'
- CNULL
- DAn error because the first argument is NULL
Why this is the answer
COALESCE returns the first non-NULL value in the list. Since the first argument is NULL, it evaluates the next argument 'default', which is not NULL, so it returns 'default'.
- Question 8Multiple Select
Which of the following SQL constructs can be used to implement conditional logic in CDP queries? (Select all that apply)
- ACASE (searched or simple)Correct answer
- BIF() function (in Hive/Impala)Correct answer
- CDECODE() (in Impala)Correct answer
- DWHILE loop
Why this is the answer
CASE, IF(), and DECODE are all conditional constructs in CDP SQL. WHILE is a procedural control flow, not used in standard SELECT queries.
- Question 9Interactive
Examine the following CASE expression. What is the result for a row where col IS NULL?
- ANULLCorrect answer
- B'Low'
- C'High'
- DAn error occurs
Why this is the answer
The WHEN condition evaluates to NULL (not true) for a NULL column, so the ELSE branch executes, returning 'Low'? Wait, careful: CASE WHEN col > 100 THEN 'High' ELSE 'Low' END: if col IS NULL, col > 100 is NULL, not true, so ELSE is taken, returning 'Low'. But the options show 'Low' as an option. However, the typical trap is that analysts think NULL > 100 is false but it's NULL, so ELSE gets 'Low'. But the correct answer should be 'Low'. But the options show 'NULL' as first option. Let's re-evaluate: Actually, in SQL, CASE evaluates WHEN conditions; if the condition is NULL or false, it moves to next WHEN. So with only one WHEN and ELSE, the result is ELSE. So for NULL, it returns 'Low'. But the question might be designed to test that NULL > 100 yields NULL, not false, and thus hits ELSE. So 'Low' is correct. But I set 'NULL' as correct. That's a mistake. Let me fix: The correct answer should be 'Low'. I'll adjust options accordingly. Also explanation needs correction. Actually, the typical exam trap is that ELSE catches NULL as well? No, ELSE is only for conditions that are false or NULL? In standard SQL, when a WHEN condition evaluates to NULL (not true), the CASE goes to the next WHEN; if no more WHEN, it uses ELSE. So if ELSE is present, it returns that value. So for NULL col, if condition is col > 100 (NULL), then ELSE returns 'Low'. So correct answer is 'Low'. I'll update the JSON. But I already wrote the options with NULL as correct. Let me rewrite the interaction to make the test clearer. I'll change the scenario to a CASE without ELSE, so NULL is correct. That's a common trap. For example: CASE WHEN col > 100 THEN 'High' END (no ELSE). So for NULL col, result is NULL. That is a classic pitfall. Let me adjust.
- Question 10Single Choice
In Hive, which function converts a Unix epoch string to a human-readable timestamp?
- Afrom_unixtime()Correct answer
- Bunix_timestamp()
- Cto_date()
- Dcast()
Why this is the answer
from_unixtime(epoch) returns a string representation of the timestamp. unix_timestamp() does the reverse (string to epoch).
- Question 11Multiple Select
Which of the following are valid ways to extract the month from a TIMESTAMP column in Impala? (Select all that apply)
- Amonth(timestamp)Correct answer
- Bdate_part('month', timestamp)Correct answer
- Cextract(month from timestamp)Correct answer
- Dto_char(timestamp, 'MM')
Why this is the answer
Impala supports month(), date_part(), and EXTRACT for month extraction. to_char is not an Impala function (it's Oracle/PostgreSQL).
- Question 12Interactive
A query filters on year(sale_date) = 2024. What performance issue arises from this condition?
- AIt disables partition pruning because the function is applied to the partition column.Correct answer
- BIt causes a full table scan because year() is a non-deterministic function.
- CIt returns an error because year() cannot be used in WHERE.
- DIt is more efficient than using a range condition.
Why this is the answer
Using a function like year() on the partition column prevents the query engine from determining which partitions to read, so it scans all partitions. The correct approach is to use a range predicate: sale_date >= '2024-01-01' AND sale_date < '2025-01-01'.
- Question 13Single Choice
What is the primary use case for Apache Impala in CDP?
- ALow-latency interactive SQL queries on large datasetsCorrect answer
- BLong-running batch ETL processes
- CACID transactions with full update/delete support
- DGraph processing
Why this is the answer
Impala is an MPP SQL engine optimized for interactive, sub-second to low-latency queries. It is not designed for heavy ETL (Hive LLAP/Spark is better) nor for ACID transactions (Hive LLAP with ORC).
- Question 14Multiple Select
Which statements correctly describe Hive LLAP? (Select all that apply)
- AIt uses persistent executors running inside YARN containers for caching.Correct answer
- BIt is designed for low-latency interactive queries like Impala.
- CIt supports ACID transactions on ORC tables.Correct answer
- DIt uses Apache Tez as the execution engine.Correct answer
Why this is the answer
Hive LLAP runs on YARN with persistent daemons, supports ACID on ORC, and uses Tez. It is more oriented toward batch/ETL rather than interactive low-latency queries (that's Impala's strength).
- Question 15Interactive
A data analyst needs to run a nightly ETL job that processes 5TB of data with heavy joins and window functions. Which CDP engine is most suitable for this task?
- AHive LLAPCorrect answer
- BImpala
- CMapReduce
- DApache Spark without LLAP
Why this is the answer
Hive LLAP is optimized for batch, long-running queries with fault tolerance via Tez. Impala is for interactive queries and lacks fault tolerance for large jobs. MapReduce is legacy. Spark could be used but Hive LLAP is the specific CDP-integrated batch engine.
- Question 16Single Choice
What is the main benefit of partition pruning in query execution?
- AIt reduces the amount of data read by eliminating irrelevant partitions based on filter conditions.Correct answer
- BIt creates indexes on the partition columns automatically.
- CIt sorts the data within each partition.
- DIt compresses the data in each partition.
Why this is the answer
Partition pruning uses WHERE conditions on partition columns to skip scanning entire directories, dramatically reducing I/O.
Data Preparation
8 questions in this domain
- Question 17Single Choice
Which Spark read method is used to load data from HDFS in Parquet format?
- Aspark.read.parquetCorrect answer
- Bspark.read.hdfs
- Cspark.table
- Dspark.read.format('text').load
Why this is the answer
Use spark.read.format('parquet').load('/path') or spark.read.parquet; the document specifies the former.
- Question 18Multiple Select
Which methods can be used to import a Hive table into a Spark DataFrame?
- Aspark.table('db.table')Correct answer
- Bspark.sql('SELECT * FROM db.table')Correct answer
- Cspark.read.hive('db.table')
- Dspark.read.format('hive').load('db.table')
Why this is the answer
Hive tables are accessed via spark.table or spark.sql; hive is not a format, it is a metastore.
- Question 19Interactive
In the streaming read shown, which option value should be used to start reading from the earliest message?
- AearliestCorrect answer
- Blatest
- Cbeginning
- Dall
Why this is the answer
Earliest starts from the oldest offset; latest starts from new messages only.
- Question 20Single Choice
Which file format offers columnar storage and predicate pushdown?
- AParquetCorrect answer
- BAvro
- CORC
- DJSON
Why this is the answer
Parquet offers columnar storage and predicate pushdown, as stated in the document.
- Question 21Multiple Select
Which of the following are true about schema inference?
- AIt is costly on large dataCorrect answer
- BIt should be used for production
- CIt is necessary for Hive tables
- DIt can cause type mismatchesCorrect answer
Why this is the answer
Schema inference is expensive and can cause type mismatches; Hive tables already have a schema.
- Question 22Interactive
In the given code, what does COALESCE return if the first argument is NULL and the second is a non-null value?
- ANULL
- BThe second valueCorrect answer
- CError
- DDepends on the engine
Why this is the answer
COALESCE returns the first non-null value; with a NULL first argument, it returns the second.
- Question 23Single Choice
In Hive/Impala, which function is used to assign row numbers for deduplication?
- AROW_NUMBERCorrect answer
- BRANK
- CDENSE_RANK
- DCOUNT
Why this is the answer
ROW_NUMBER assigns unique numbers to rows; it is used with a WHERE clause to keep one row per group.
- Question 24Multiple Select
Which of the following functions can be used to convert a string to a timestamp in Hive/Impala?
- ATO_TIMESTAMPCorrect answer
- BCASTCorrect answer
- CTO_DATE
- DFROM_UNIXTIME
Why this is the answer
TO_TIMESTAMP and CAST (with proper format) are used for string-to-timestamp conversion; TO_DATE returns date, FROM_UNIXTIME expects integer.
Data Visualization
8 questions in this domain
- Question 25Single Choice
Which CDP tool is designed for business users to create visualizations without writing SQL?
- ACloudera Data Visualization (CDV)Correct answer
- BApache Superset
- CApache Hue
- DApache Zeppelin
Why this is the answer
CDV provides a drag-and-drop interface with virtual datasets, making it ideal for business users.
- Question 26Multiple Select
Which two chart types are best for showing part-to-whole composition?
- APie chartCorrect answer
- BTreemapCorrect answer
- CLine chart
- DScatter plot
Why this is the answer
Both pie charts and treemaps are designed to visualize parts of a whole.
- Question 27Interactive
Examine the SQL query: SELECT region, SUM(sales) FROM sales GROUP BY ROLLUP(region). What does the ROLLUP clause enable?
- ADrill-down hierarchy for aggregated dataCorrect answer
- BFiltering rows before aggregation
- CSorting the result set
- DJoining multiple tables
Why this is the answer
ROLLUP creates subtotals and grand totals, enabling hierarchical drill-down from region to lower levels.
- Question 28Single Choice
When interpreting a line chart showing revenue over time, what is the first thing to check?
- AThe scale and starting point of the y-axisCorrect answer
- BThe color of the line
- CThe chart title
- DThe legend labels
Why this is the answer
A truncated y-axis can exaggerate trends; always verify the axis scale first.
- Question 29Multiple Select
Which two export formats are commonly supported for scheduled reports in Cloudera Data Visualization?
- ACSVCorrect answer
- BPDFCorrect answer
- CJSON
- DYAML
Why this is the answer
CDV supports CSV for raw data and PDF for presentation-ready reports.
- Question 30Interactive
In Apache Superset, a filter uses the Jinja template: WHERE region = '{{ region_filter }}'. What type of filter is this?
- AParameterized filterCorrect answer
- BStatic filter
- CRow-level security rule
- DGlobal dashboard filter
Why this is the answer
Jinja templating allows dynamic parameterization, letting filters reuse user inputs.
- Question 31Single Choice
What is the primary advantage of Cloudera Data Visualization over Apache Superset for enterprise security?
- ANative integration with Apache Ranger for row-level securityCorrect answer
- BOpen-source license
- CBuilt-in SQL editor
- DLarger community support
Why this is the answer
CDV enforces Ranger policies at the dataset level, ensuring governed access.
- Question 32Multiple Select
Which two actions are appropriate when you discover an outlier in a scatter plot?
- AInvestigate the cause of the outlierCorrect answer
- BValidate the data quality for that pointCorrect answer
- CImmediately remove the outlier from the dataset
- DIgnore the outlier as irrelevant
Why this is the answer
Outliers may be errors or valuable signals; investigate and validate before acting.
Sharing and Managing Results
8 questions in this domain
- Question 33Single Choice
Which of the following is the correct Impala syntax to export query results as a CSV file using a comma delimiter?
- AINSERT OVERWRITE DIRECTORY '/path' STORED AS CSV SELECT * FROM table
- BINSERT OVERWRITE DIRECTORY '/path' ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' SELECT * FROM tableCorrect answer
- CCREATE TABLE csv_table AS SELECT * FROM table STORED AS CSV
- DEXPORT TABLE table TO '/path' FORMAT CSV
Why this is the answer
Impala does not support the STORED AS CSV clause; correct syntax uses ROW FORMAT DELIMITED FIELDS TERMINATED BY ','.
- Question 34Multiple Select
Which two of the following are valid methods to export large datasets (over 1 GB) from a CDP cluster when Hue's UI export times out? (Choose two.)
- AUse beeline -e 'query' > output.csvCorrect answer
- BUse Hue's 'Export All' button with a 10-minute timeout
- CUse hdfs dfs -getmerge on HDFS output files from INSERT OVERWRITECorrect answer
- DUse the Impala-shell with the -P flag
Why this is the answer
For large data, the CLI (beeline) and HDFS merging are effective; Hue's export has limits, and -P is not a real Impala-shell flag.
- Question 35Interactive
Execute the provided Hive export command and identify which output characteristics result from the query.
- AThe output will be a single file named 'output.parquet'
- BThe output will be multiple part-m-xxxxx filesCorrect answer
- CThe output will be a directory with a single CSV file
- DThe output will be overwritten if the directory already exists
Why this is the answer
Hive's INSERT OVERWRITE DIRECTORY produces multiple part files by default; it does not produce a single file nor a CSV.
- Question 36Single Choice
In CDP, which scheduling tool is preferred for automating report generation workflows?
- AApache Oozie
- BApache AirflowCorrect answer
- CCron with shell scripts
- DCloudera Manager built-in scheduler
Why this is the answer
Apache Airflow is the recommended scheduling tool for modern CDP deployments; Oozie is legacy and cron lacks enterprise features.
- Question 37Multiple Select
Which two of the following are correct statements about automating report generation in CDP? (Choose two.)
- ACloudera Data Visualization native scheduler can execute custom Python preprocessing scripts.
- BAirflow DAGs can include tasks for data validation, extraction, and distribution.Correct answer
- CHardcoding credentials in scripts is acceptable in automated pipelines.
- DAirflow sensors can wait for data partitions to arrive before proceeding.Correct answer
Why this is the answer
Airflow DAGs support complex workflows and sensors for data availability; native schedulers lack custom pre-processing; credentials must be managed securely.
- Question 38Interactive
Review the Airflow DAG code below and determine which statement about the task execution order is correct.
- AThe validation task runs after the extraction task.
- BThe extraction and transformation tasks run in parallel after validation.
- CThe export task runs before the notification task.Correct answer
- DThe cleanup task runs before the notification task.
Why this is the answer
In the DAG, export_task is downstream of extraction and transformation, and notification_task is after export_task, so export runs before notification.
- Question 39Single Choice
In CDP, which component is responsible for row‑level filtering of query results?
- AApache Atlas
- BApache RangerCorrect answer
- CCloudera Manager
- DHive GRANT statements
Why this is the answer
Apache Ranger provides fine-grained access control including row filters and column masking; Atlas tracks lineage, not policies.
- Question 40Multiple Select
Which two of the following are required for a user to export data from a Hive table to an HDFS directory? (Choose two.)
- ASELECT privilege on the source tableCorrect answer
- BWRITE privilege on the target HDFS directoryCorrect answer
- CALL privilege on the Hive metastore database
- DREAD privilege on the target HDFS directory
Why this is the answer
Ranger requires SELECT on the source and WRITE (or ALL) on the destination directory; READ on target is not needed for writing.
Frequently asked questions
Everything about the CDP Data Analyst question bank and how to use it.