Snowflake Certified SnowPro Specialty - Snowpark (SPS-C01) Free Practice Test
Question 1
You have a Snowpark application that processes sensitive data'. To enhance security, you want to use key pair authentication and ensure that the private key is never exposed in plain text within the application or logs. Which of the following strategies offers the most robust protection against accidental key exposure, even in the event of a security breach of the application server itself?
Correct Answer: B
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 2
You have a Snowpark DataFrame containing sales data with columns 'sale_date', and 'sale_amount'. You need to calculate the cumulative sales amount for each product over time, ordered by 'sale_date'. Which of the following Snowpark code snippets correctly implements this using window functions?
Correct Answer: A
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 3
You are developing a Snowpark Python application that connects to Snowflake using key pair authentication. You have the private key stored securely in an environment variable named 'SNOWFLAKE PRIVATE KEY. Which of the following code snippets correctly establishes a Snowpark session using this method, assuming all other necessary connection parameters (account, user, database, schema, warehouse) are also set as environment variables?
Correct Answer: B
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 4
You are tasked with optimizing a Snowpark application that performs complex data transformations on a large dataset (1 TB) stored in Snowflake. The application currently uses Snowpark DataFrames and is experiencing slow performance. You suspect the issue might be related to data transfer overhead between the Snowflake engine and the Python environment. Which of the following strategies would be MOST effective in minimizing this overhead and improving performance?
Correct Answer: A,C,D
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 5
You are using Snowflake Notebooks to develop a Snowpark application and want to leverage a custom Python library that is not available in the default environment. What steps are necessary to make this library available within your Snowflake Notebook?
Correct Answer: C
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 6
You are tasked with automating the creation of Snowpark sessions using key pair authentication for multiple users. You have a function that retrieves connection parameters (account, user, private key, etc.) for each user from a secure configuration file. The private keys are stored in PEM format. However, some users' private keys are password-protected. Which of the following approaches ensures the secure and correct establishment of Snowpark sessions for all users, including those with password-protected private keys? Assume get_user config(username)' retrieves the user's configuration, including the private key and password (if any).
Correct Answer: B
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 7
You have a Snowflake table named 'raw events' with a VARIANT column named 'event data'. The 'event data' column contains JSON objects with a field 'timestamp' that is sometimes represented as a string and sometimes as a number (Unix epoch). You need to create a Snowpark DataFrame that extracts the 'timestamp' as a timestamp object, handling both string and numeric representations. Which of the following code snippets correctly accomplishes this, avoiding errors when encountering incompatible types?
Correct Answer: C
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 8
You have a Snowpark DataFrame containing customer order data with columns , and 'order_amount' . You need to identify customers who placed orders exceeding $1000 on more than 3 separate days. Which Snowpark code snippet correctly achieves this? Assume SparkSession 'spark' and DataFrame are already defined.
Correct Answer: B
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 9
You are setting up a development environment for Snowpark using Anaconda and encounter the following error: 'ModuleNotFoundError: No module named 'snowflake.snowpark". You have already installed the package using pip. What is the MOST likely cause of this error and how do you resolve it?
Correct Answer: B,C
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 10
You are tasked with optimizing the performance of a Snowpark Python application that performs complex data transformations on a large dataset of IoT sensor readings. The application uses a Snowpark-optimized warehouse. You notice that the application is consistently slow, with CPU utilization on the warehouse fluctuating significantly. Which of the following actions would be MOST effective in addressing this performance issue? Assume the dataset is partitioned on the 'sensor_id' column within Snowflake.
Correct Answer: A,D,E
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).