Docsity

PrepIQ Certified Function Point Practitioner CFPP Ultimate Exam, Exams of Technology

Toggle sidebar
bg1
PrepIQ Certified Function Point
Practitioner CFPP Ultimate Exam
**Question 1. Which Python data structure provides O(1) average-time complexity
for membership tests?**
A) List
B) Tuple
C) Set
D) Dictionary
Answer: C
Explanation: Sets are implemented as hash tables, giving constant-time average
performance for `in` checks, unlike lists which require linear scans.
**Question 2. In a try-except-finally block, which clause is guaranteed to execute
regardless of whether an exception occurs?**
A) try
B) except
C) else
D) finally
Answer: D
Explanation: The `finally` block runs after the try and any except blocks, even if the
try completes successfully or an exception is re-raised.
**Question 3. Which of the following is a correct lambda expression that squares its
input?**
A) `lambda x: x ** 2`
B) `lambda x: return x * x`
C) `lambda x: x ^ 2`
D) `lambda x => x*x`
Answer: A
Explanation: The syntax `lambda x: x ** 2` defines an anonymous function
returning the square of `x`. `return` cannot be used inside a lambda, `^` is bitwise
XOR, and `=>` is not Python syntax.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32

Partial preview of the text

Download PrepIQ Certified Function Point Practitioner CFPP Ultimate Exam and more Exams Technology in PDF only on Docsity!

Practitioner CFPP Ultimate Exam

Question 1. Which Python data structure provides O(1) average-time complexity for membership tests? A) List B) Tuple C) Set D) Dictionary Answer: C Explanation: Sets are implemented as hash tables, giving constant-time average performance for in checks, unlike lists which require linear scans. Question 2. In a try-except-finally block, which clause is guaranteed to execute regardless of whether an exception occurs? A) try B) except C) else D) finally Answer: D Explanation: The finally block runs after the try and any except blocks, even if the try completes successfully or an exception is re-raised. Question 3. Which of the following is a correct lambda expression that squares its input? A) lambda x: x ** 2 B) lambda x: return x * x C) lambda x: x ^ 2 D) lambda x => x*x Answer: A Explanation: The syntax lambda x: x ** 2 defines an anonymous function returning the square of x. return cannot be used inside a lambda, ^ is bitwise XOR, and => is not Python syntax.

Practitioner CFPP Ultimate Exam

Question 4. When creating an isolated Python environment, which command initializes a virtual environment named venv? A) pip install venv B) python -m venv venv C) conda create -n venv python D) virtualenv venv Answer: B Explanation: python -m venv venv creates a directory venv containing a self-contained Python interpreter and site-packages. Option D works if virtualenv is installed, but the standard library provides venv. Question 5. In pytest, which decorator marks a test function as expecting a specific exception? A) @pytest.mark.exception B) @pytest.raises C) with pytest.raises(ValueError): D) @pytest.expect Answer: C Explanation: with pytest.raises(ValueError): is a context manager that asserts the block raises the specified exception. There is no @pytest.raises decorator. Question 6. Which Pandas method fills missing numeric values with the mean of the column? A) df.fillna(df.mean()) B) df.replace(np.nan, df.mean()) C) df.impute('mean') D) df.fillna('mean') Answer: A Explanation: df.fillna(df.mean()) replaces NaN in each column with that column’s mean. replace works on exact matches, not NaN, and the other options are invalid.

Practitioner CFPP Ultimate Exam

Question 10. Which Spark execution mode evaluates transformations only when an action is called? A) Eager evaluation B) Immediate execution C) Lazy evaluation D) Real-time evaluation Answer: C Explanation: Spark builds a logical plan for transformations and triggers computation only when an action (e.g., collect, write) is invoked—this is lazy evaluation. Question 11. Which of the following is a correct way to register a Python UDF that returns an IntegerType in PySpark? A) spark.udf.register("my_udf", lambda x: len(x), IntegerType()) B) spark.udf.register("my_udf", lambda x: len(x), returnType=IntegerType) C) spark.udf.register("my_udf", lambda x: len(x), IntegerType()) D) spark.udf.register("my_udf", lambda x: len(x)) Answer: C Explanation: The third argument must be an instance of a Spark SQL data type, e.g., IntegerType(). Option A passes the type as a separate argument, which is invalid syntax. Question 12. In Snowpark for Python, which method materializes a DataFrame into a Snowflake table? A) df.collect() B) df.write.save_as_table("my_table") C) df.to_pandas() D) df.show() Answer: B

Practitioner CFPP Ultimate Exam

Explanation: write.save_as_table creates or replaces a Snowflake table with the DataFrame’s contents. collect returns rows to the driver, to_pandas creates a Pandas DF, and show only displays data. Question 13. Which HTTP library is most commonly used in Python for simple REST API calls? A) urllib B) requests C) http.client D) aiohttp Answer: B Explanation: requests provides an intuitive API (get, post, etc.) and handles sessions, headers, and JSON conversion easily. The others are lower-level or asynchronous. Question 14. When uploading a large file to AWS S3 using boto3, which method enables multipart upload automatically? A) s3.put_object B) s3.upload_file C) s3.copy_object D) s3.create_multipart_upload Answer: B Explanation: upload_file abstracts multipart handling for files larger than 8 MB, whereas put_object sends the whole object in one request. Question 15. Which file format stores data in a columnar layout and supports schema evolution, making it ideal for analytical workloads? A) CSV B) JSON C) Parquet D) XML Answer: C

Practitioner CFPP Ultimate Exam

Explanation: The cron preset @daily schedules the DAG to execute once per day at 00:00 UTC. Question 19. Which Prefect construct replaces an Airflow DAG for defining workflow dependencies? A) Flow B) TaskGroup C) Pipeline D) Blueprint Answer: A Explanation: In Prefect, a Flow object defines a set of tasks and their dependencies, analogous to an Airflow DAG. Question 20. In a CI/CD pipeline for data engineering, which Git command is used to fetch the latest changes from the remote repository without merging? A) git pull B) git fetch C) git clone D) git rebase Answer: B Explanation: git fetch updates local remote tracking branches but does not merge them into the current branch. pull performs fetch + merge. Question 21. Which Python module provides a standard way to emit log messages with levels such as INFO, WARNING, and ERROR? A) logging B) loguru C) traceback D) syslog Answer: A

Practitioner CFPP Ultimate Exam

Explanation: The built-in logging module supports hierarchical loggers, handlers, and level filtering. loguru is third-party, while traceback deals with exception stacks. Question 22. When storing credentials in AWS Secrets Manager, which boto client method retrieves the secret value? A) client.get_secret B) client.describe_secret C) client.get_secret_value D) client.fetch_secret Answer: C Explanation: client.get_secret_value(SecretId='...') returns the secret string or binary. The other method names do not exist. Question 23. Which cryptography library class is used for symmetric encryption with AES in CBC mode? A) Fernet B) AESGCM C) Cipher with algorithms.AES and modes.CBC D) RSA Answer: C Explanation: Cipher(algorithms.AES(key), modes.CBC(iv)) creates an AES-CBC encryptor/decryptor. Fernet is a higher-level construct, AESGCM uses GCM mode, and RSA is asymmetric. Question 24. Great Expectations’ “expectation” that a column contains no nulls is defined by which method? A) expect_column_values_to_be_unique B) expect_column_values_to_not_be_null C) expect_column_values_to_be_null D) expect_column_values_to_be_between Answer: B

Practitioner CFPP Ultimate Exam

Explanation: Windows does not support fork; the default spawn start method creates a fresh interpreter process, preventing shared-memory issues. Question 28. Which of the following techniques reduces memory usage when reading a large CSV with Pandas? A) df = pd.read_csv('file.csv') B) pd.read_csv('file.csv', dtype='object') C) pd.read_csv('file.csv', low_memory=False) D) pd.read_csv('file.csv', dtype={'id': 'int32'}, usecols=['id','value']) Answer: D Explanation: Specifying smaller dtypes and limiting columns with usecols reduces the in-memory footprint. Option C disables low-memory mode, increasing consumption. Question 29. Which Python construct is best suited for applying a function to each element of a large list in a memory-efficient way? A) List comprehension B) map with a generator expression C) for loop building a new list D) filter returning a list Answer: B Explanation: map returns a lazy iterator; when combined with a generator expression it processes items one-by-one without materializing the full result list, saving memory. Question 30. In PySpark, which method persists a DataFrame in memory only (no disk) for reuse? A) df.cache() B) df.persist(StorageLevel.DISK_ONLY) C) df.persist(StorageLevel.MEMORY_AND_DISK) D) df.checkpoint() Answer: A

Practitioner CFPP Ultimate Exam

Explanation: cache() is a shortcut for persist(StorageLevel.MEMORY_ONLY), storing the DataFrame in RAM without spilling to disk. Question 31. Which Snowpark method converts a Snowpark DataFrame to a Pandas DataFrame? A) to_pandas() B) collect().to_pandas() C) toPandas() D) to_pandas() (same as A) Answer: A Explanation: Snowpark provides a to_pandas() method that pulls the data into a local Pandas DataFrame. The other options are incorrect syntax. Question 32. When using the requests library, which parameter sends JSON data in the request body? A) data= B) json= C) payload= D) params= Answer: B Explanation: json= automatically serializes the Python object to JSON and sets the appropriate Content-Type header. data= sends raw form-encoded data. Question 33. Which of the following is a valid Avro schema primitive type? A) integer B) float64 C) string D) char Answer: C Explanation: Avro primitive types include null, boolean, int, long, float, double, bytes, and string. integer and char are not Avro types.

Practitioner CFPP Ultimate Exam

Question 37. In Pandas, which method returns a new DataFrame containing rows where column age is greater than 30? A) df.filter(df.age > 30) B) df.where(df.age > 30) C) df.loc[df.age > 30] D) df.select(df.age > 30) Answer: C Explanation: loc is used for label-based indexing; df.loc[df.age > 30] returns rows satisfying the condition. where keeps all rows and masks others with NaN. Question 38. Which Spark SQL function can be used to remove duplicate rows based on all columns? A) drop_duplicates() B) distinct() C) unique() D) remove_duplicates() Answer: B Explanation: distinct() returns a DataFrame with duplicate rows removed. drop_duplicates() exists in Pandas, not Spark. Question 39. Which of the following is NOT a valid partitioning scheme for writing Parquet files to an S3 bucket? A) year=2023/month=04/day=15/ B) date=2023-04-15/ C) hash=abcdef/ D) file=part-00001.parquet/ Answer: D Explanation: Partition directories should be key-value pairs; a filename as a partition key (file=) does not make sense and will be treated as a literal folder name, not a partition.

Practitioner CFPP Ultimate Exam

Question 40. In the context of data pipelines, what does the term “idempotent” refer to? A) A step that always produces the same output for the same input B) A step that can be executed in parallel C) A step that never fails D) A step that automatically retries on error Answer: A Explanation: Idempotent operations yield identical results when run multiple times with the same inputs, which is crucial for reliable retries. Question 41. Which Python decorator from functools can be used to cache results of a pure function? A) @lru_cache B) @cache C) @memoize D) @cached_property Answer: A Explanation: functools.lru_cache caches function calls based on arguments. @cache exists in Python 3.9+ as an alias, but lru_cache is the classic, explicit answer. Question 42. When using boto3 to assume an IAM role, which method obtains temporary credentials? A) client.assume_role B) client.get_role_credentials C) client.sts.assume_role D) client.security_token_service.assume_role Answer: C Explanation: The STS (Security Token Service) client provides assume_role, returning temporary access keys. The other method names are incorrect.

Practitioner CFPP Ultimate Exam

Question 46. Which Pandas function is used to reshape data from long to wide format? A) pivot() B) melt() C) stack() D) unstack() Answer: A Explanation: pivot (or pivot_table) converts a long DataFrame into a wide format based on index/columns. melt does the opposite. Question 47. In PySpark, which function adds a new column with a constant value to a DataFrame? A) df.withColumn('col', lit(5)) B) df.addColumn('col', 5) C) df.appendColumn('col', 5) D) df.select('*', 5 as col) Answer: A Explanation: withColumn together with lit creates a column filled with the constant value. The other syntaxes are not valid PySpark. Question 48. Which of the following statements about Python’s multiprocessing.Pool.map is true? A) It returns results in the order of task completion. B) It blocks until all tasks are finished. C) It cannot handle functions that raise exceptions. D) It always uses a separate process per element. Answer: B Explanation: Pool.map is a blocking call that waits for all worker processes to finish and returns results preserving the input order. It does handle exceptions (they are raised in the main process).

Practitioner CFPP Ultimate Exam

Question 49. Which Snowflake SQL command creates a stage that references an external S3 bucket? A) CREATE STAGE my_stage URL='s3://my-bucket/' B) CREATE EXTERNAL TABLE my_stage FROM S3 C) CREATE STAGE my_stage LOCATION='s3://my-bucket/' D) CREATE STAGE my_stage TYPE='S3' Answer: A Explanation: CREATE STAGE with the URL parameter defines an external stage pointing to an S3 location. The other syntaxes are invalid. Question 50. In the context of data pipelines, what does “schema drift” refer to? A) Gradual performance degradation over time B) Changes in source data structure that are not reflected in downstream schemas C) Loss of data due to network latency D) Automatic versioning of tables in a data warehouse Answer: B Explanation: Schema drift occurs when source fields are added, removed, or renamed without updating the target schema, potentially causing failures. Question 51. Which Python package provides a high-level interface for building data validation suites like Great Expectations? A) pandera B) cerberus C) voluptuous D) great_expectations Answer: D Explanation: The great_expectations package implements expectations, data docs, and profiling. pandera also offers validation but is not the same framework. Question 52. When using requests.get, which argument should be used to set a timeout of 10 seconds?

Practitioner CFPP Ultimate Exam

C) PIP_SOURCE

D) PIP_EXTRA_INDEX_URL

Answer: A Explanation: PIP_INDEX_URL overrides the default PyPI URL. PIP_EXTRA_INDEX_URL can add additional indexes, but the primary variable is PIP_INDEX_URL. Question 56. In a Pandas groupby operation, which method computes the sum of each numeric column per group? A) agg('sum') B) sum() C) apply(np.sum) D) All of the above Answer: D Explanation: All three approaches produce the same result: groupby(...).sum(), agg('sum'), or apply(np.sum). Question 57. Which of the following best describes the purpose of a “checkpoint” in Spark? A) Persist data to disk to break lineage and allow recovery B) Cache data in memory for faster reuse C) Create a snapshot of the cluster configuration D) Trigger lazy evaluation immediately Answer: A Explanation: checkpoint writes the DataFrame/RDD to reliable storage, truncating the DAG lineage and enabling fault recovery. Question 58. In Airflow, which parameter of a task determines whether downstream tasks wait for the upstream task to succeed? A) trigger_rule B) depends_on_past

Practitioner CFPP Ultimate Exam

C) wait_for_downstream D) execution_timeout Answer: A Explanation: trigger_rule (e.g., all_success, one_success) controls when downstream tasks are scheduled based on upstream outcomes. Question 59. Which Python standard library module can be used to generate a UUID version 4? A) uuid B) random C) hashlib D) secrets Answer: A Explanation: uuid.uuid4() creates a random UUID (version 4). secrets can generate random bytes but not UUID objects directly. Question 60. When using pandas.read_json with a large JSONLines file, which parameter improves memory efficiency? A) lines=True B) chunksize=10000 C) orient='records' D) All of the above Answer: D Explanation: lines=True treats each line as a separate JSON object, chunksize reads the file in manageable pieces, and orient='records' matches the JSONLines structure. Question 61. Which Spark SQL function can be used to extract the year from a timestamp column named event_ts? A) year(event_ts) B) extract_year(event_ts)