CertSafari

    Free Snowflake SnowPro Advanced: Data Scientist (DSA-C03) Sample Questions

    35 free sample questions from our bank of 479+, covering every exam domain, with answers and detailed explanations. Updated August 2026.

    Domain 1: Data Science Concepts

    1.2 Outline machine learning problem types.

    1.What is the primary distinguishing factor between binary classification and multi-class classification?

    1. A.The type of input data (structured vs. unstructured)
    2. B.The number of possible output categories
    3. C.The use of labeled versus unlabeled data
    4. D.The prediction of a continuous versus a discrete value
    Show answer & explanation

    Correct answer: BThe number of possible output categories

    • A. Incorrect. The type of input data, whether structured or unstructured, does not distinguish between binary and multi-class classification. Both types of classification models can be trained on various data formats.
    • B. Correct. This is the fundamental difference. Binary classification predicts one of two possible outcomes (e.g., yes/no, true/false), meaning it has exactly two output categories. Multi-class classification predicts one of more than two possible outcomes (e.g., cat/dog/bird).
    • C. Incorrect. Both binary and multi-class classification are types of supervised learning, which means they both require labeled data for training. The use of labeled versus unlabeled data is the primary distinction between supervised and unsupervised learning.
    • D. Incorrect. Both binary and multi-class classification problems involve predicting a discrete, categorical value (a class label). The distinction between predicting a continuous value (like price or temperature) and a discrete value is what separates regression from classification.

    1.2 Outline machine learning problem types

    2.Which TWO of the following are direct applications of binary classification?(Select 2)

    1. A.Predicting tomorrow's exact stock price for a company
    2. B.Determining if an email is spam or not spam
    3. C.Grouping customers into distinct, unknown purchasing segments
    4. D.Forecasting a company's total quarterly sales revenue
    5. E.Identifying whether a credit card transaction is fraudulent or legitimate
    Show answer & explanation

    Correct answers: B, EDetermining if an email is spam or not spam; Identifying whether a credit card transaction is fraudulent or legitimate

    • A. Incorrect. Predicting an exact stock price is a regression problem, not classification. Regression models are used to predict a continuous numerical value, whereas classification models predict a discrete category or label.
    • B. Correct. This is a classic example of binary classification. The goal is to categorize an email into one of two distinct classes: 'spam' or 'not spam'.
    • C. Incorrect. Grouping items into distinct but previously unknown segments is an unsupervised learning problem known as clustering. Classification requires pre-defined labels for training, which are absent in this scenario.
    • D. Incorrect. Forecasting sales revenue involves predicting a continuous numerical value. This is a regression problem, similar to predicting a stock price.
    • E. Correct. This is a direct application of binary classification. Each transaction is classified into one of two possible outcomes: 'fraudulent' or 'legitimate'.

    1.2 Outline machine learning problem types.

    3.A climatologist has 50 years of daily temperature data for a specific city. The goal is to build a model to predict the average daily temperature for the next 365 days. Why is this a time-series forecasting problem rather than a simple linear regression problem?

    1. A.Because it predicts a continuous value.
    2. B.Because the dataset is very large.
    3. C.Because the order and temporal dependence of the data points are critical for accurate prediction.
    4. D.Because it involves unstructured data.
    Show answer & explanation

    Correct answer: CBecause the order and temporal dependence of the data points are critical for accurate prediction.

    • A. Incorrect. Both simple linear regression and time-series forecasting models can be used to predict continuous values. This characteristic defines a regression task in general but does not distinguish between these specific model types.
    • B. Incorrect. The size of the dataset does not determine the type of machine learning problem. Both simple linear regression and time-series models can be applied to both large and small datasets.
    • C. Correct. This is the fundamental distinction. Time-series data has an inherent temporal order where observations are not independent. The temperature on one day is highly dependent on previous days (autocorrelation) and may exhibit seasonality and trends. Time-series models are specifically designed to capture these temporal dependencies, which simple linear regression models ignore by assuming data points are independent.
    • D. Incorrect. Daily temperature data organized by date is a classic example of structured data, not unstructured data like text, images, or audio files.

    1.3 Summarize the machine learning lifecycle.

    4.A data analyst needs to create an interactive dashboard for business stakeholders to explore customer segmentation results. The results are stored in a large Snowflake table. The stakeholders are not technical and need a simple point-and-click interface. The entire solution must remain within the Snowflake ecosystem to comply with data residency policies. Which tool is the most appropriate choice?

    1. A.Snowsight Dashboards
    2. B.A custom Python application using the Snowflake Connector
    3. C.Tableau connected directly to Snowflake
    4. D.Exporting data to a local file for use in Excel
    Show answer & explanation

    Correct answer: ASnowsight Dashboards

    • A. Correct. Snowsight is the native web interface for Snowflake and includes features for creating and sharing interactive dashboards. It allows analysts to build dashboards with various chart types and filters, providing a simple point-and-click experience for non-technical stakeholders. Most importantly, it is an integral part of the Snowflake platform, ensuring the entire solution remains within the Snowflake ecosystem and complies with strict data residency policies.
    • B. Incorrect. Developing a custom Python application would require significant development effort, technical expertise, and ongoing maintenance. It would not provide the out-of-the-box, simple point-and-click interface that business stakeholders require for a dashboarding solution.
    • C. Incorrect. While Tableau is a powerful business intelligence tool that can connect directly to Snowflake to create interactive dashboards, it is a third-party application. The requirement that the 'entire solution must remain within the Snowflake ecosystem' makes this option non-compliant, as the visualization and interaction layer would exist outside of Snowflake's platform.
    • D. Incorrect. Exporting data to a local file and using Excel directly violates the core requirement to keep the solution within the Snowflake ecosystem. This approach creates data security risks, introduces data staleness, and would not comply with the stated data residency policies.

    1.3 Summarize the machine learning lifecycle.

    5.In a multi-class classification problem, what does the diagonal of a confusion matrix represent?

    1. A.The total number of predictions for each class.
    2. B.The instances where the model incorrectly classified an observation.
    3. C.The instances where the model correctly classified an observation for each class.
    4. D.The average F1-score across all classes.
    Show answer & explanation

    Correct answer: CThe instances where the model correctly classified an observation for each class.

    • A. This is incorrect. The sum of a column represents the total number of predictions for that class (true positives + false positives), while the sum of a row represents the total actual instances for that class. The diagonal itself only shows the correct predictions for each class.
    • B. This is incorrect. The instances where the model incorrectly classified an observation are represented by the off-diagonal elements of the confusion matrix. These values show where the predicted class did not match the actual class.
    • C. This is correct. In a confusion matrix, the diagonal elements (from top-left to bottom-right) represent the count of instances where the predicted label is equal to the true label. These are the correctly classified observations, also known as the true positives for each respective class.
    • D. This is incorrect. The F1-score is a performance metric derived from the precision and recall values, which are calculated using the values in the confusion matrix (True Positives, False Positives, False Negatives). However, the F1-score itself is a separate calculation and is not directly represented by the diagonal.

    1.1 Define machine learning concepts for data science workloads.

    6.A marketing team wants to predict which specific marketing channel (e.g., 'Email', 'Social Media', 'PPC', 'Organic Search') will lead to a conversion for a new customer. The model will be trained on data from past customers. What specific type of machine learning problem is this?

    1. A.Binary classification
    2. B.Regression
    3. C.Multi-class classification
    4. D.Clustering
    Show answer & explanation

    Correct answer: CMulti-class classification

    • A. Incorrect. Binary classification is a supervised learning task where the goal is to predict one of two possible outcomes (e.g., yes/no, true/false, convert/not convert). Since this problem involves predicting one of several marketing channels (more than two), binary classification is not the correct approach.
    • B. Incorrect. Regression is used to predict a continuous numerical value, such as a customer's lifetime value or the price of a house. This problem requires predicting a discrete category (the name of the marketing channel), not a continuous number.
    • C. Correct. This is a multi-class classification problem because the objective is to predict a single outcome from a finite set of more than two distinct, non-overlapping categories. The model must classify a new customer into one of the specific marketing channels ('Email', 'Social Media', 'PPC', etc.).
    • D. Incorrect. Clustering is an unsupervised learning technique used to discover natural groupings or clusters in data without predefined labels. This problem is a supervised learning task because it uses historical, labeled data (past customers and their conversion channels) to train a model to make future predictions.

    1.1 Define machine learning concepts for data science workloads.

    7.A data scientist is building a model to predict employee attrition from a dataset where only 5% of employees have left. Which of the following are valid strategies to address this class imbalance?(Select 2)

    1. A.Use accuracy as the primary evaluation metric.
    2. B.Resample the data by oversampling the minority class or undersampling the majority class.
    3. C.Use a regression algorithm instead of a classifier.
    4. D.Generate synthetic data for the minority class using a technique like SMOTE.
    5. E.Ignore the imbalance as it is not significant enough to affect the model.
    Show answer & explanation

    Correct answers: B, DResample the data by oversampling the minority class or undersampling the majority class.; Generate synthetic data for the minority class using a technique like SMOTE.

    • A. Incorrect. For imbalanced datasets, accuracy is a misleading metric. A model that always predicts the majority class (no attrition) would achieve 95% accuracy but would be useless for identifying employees at risk of leaving. Better metrics include Precision, Recall, F1-score, and AUC.
    • B. Correct. Resampling is a standard and effective strategy for handling class imbalance. Oversampling involves increasing the number of instances in the minority class, while undersampling reduces the instances in the majority class. Both techniques aim to create a more balanced dataset for the model to train on, helping it learn patterns from both classes effectively.
    • C. Incorrect. This is a classification problem (predicting a binary outcome: attrition or no attrition), not a regression problem (predicting a continuous value). Using a regression algorithm is fundamentally inappropriate for this task and does not address the class imbalance.
    • D. Correct. Techniques like SMOTE (Synthetic Minority Over-sampling Technique) are advanced methods to address class imbalance. SMOTE generates new, synthetic data points for the minority class by interpolating between existing minority class instances, rather than simply duplicating them. This helps to create a more balanced and robust dataset, improving model performance on the minority class.
    • E. Incorrect. A 95% to 5% class split is a significant imbalance. Ignoring it will likely result in a model that is heavily biased towards the majority class and performs very poorly at its primary goal: predicting the minority class (employee attrition).

    1.1 Define machine learning concepts for data science workloads.

    8.A junior data scientist builds a linear regression model and reports a high R-squared value on the training data as proof of a good model. A senior data scientist cautions that R-squared can be misleading. Why is this caution important?

    1. A.A high R-squared on the training data might indicate overfitting, where the model performs poorly on unseen data.
    2. B.R-squared is only applicable to classification problems, not regression.
    3. C.Linear regression is an unsupervised technique, so R-squared is an irrelevant metric.
    4. D.The R-squared value always increases as more predictors are added, regardless of their utility.
    Show answer & explanation

    Correct answer: AA high R-squared on the training data might indicate overfitting, where the model performs poorly on unseen data.

    • A. This is the correct answer. A very high R-squared value on the training dataset suggests the model fits that specific data extremely well. However, this can be a sign of overfitting, where the model has learned the noise and random fluctuations in the training data rather than the underlying pattern. An overfit model will not generalize well and will perform poorly on new, unseen data, which is the ultimate test of a model's usefulness.
    • B. Incorrect. R-squared, or the coefficient of determination, is a standard metric used exclusively for evaluating the goodness-of-fit of regression models. It measures the proportion of variance in the dependent variable that is predictable from the independent variables. For classification problems, different metrics such as accuracy, precision, recall, and F1-score are used.
    • C. Incorrect. Linear regression is a fundamental supervised learning technique because it learns from labeled data (i.e., data with known outcomes for the target variable). R-squared is a primary and highly relevant metric for assessing the performance of a linear regression model.
    • D. Incorrect. While this statement is technically true for the standard R-squared metric (it will not decrease as predictors are added), it is a symptom of the larger problem, not the root cause of the caution. The core issue is overfitting and poor generalization. Adding more predictors, even irrelevant ones, can inflate the R-squared on the training set, which contributes to overfitting, but the fundamental concern for the senior data scientist is the model's potential failure on unseen data, as described in option A.

    1.4 Define statistical concepts for data science.

    9.In the context of a Student's t-distribution, what does the 'degrees of freedom' parameter primarily influence?

    1. A.The mean of the distribution.
    2. B.The skewness of the distribution.
    3. C.The shape of the distribution, specifically the thickness of its tails.
    4. D.The central point of the confidence interval.
    Show answer & explanation

    Correct answer: CThe shape of the distribution, specifically the thickness of its tails.

    • A. Incorrect. The standard Student's t-distribution is centered at a mean of zero, similar to the standard normal distribution. The degrees of freedom parameter does not alter the mean of the distribution.
    • B. Incorrect. The Student's t-distribution is symmetric about its mean. It has a skewness of zero and is not influenced by the degrees of freedom. The shape changes in terms of kurtosis (tail thickness), not skewness.
    • C. Correct. The degrees of freedom (df) is the primary parameter that defines the shape of the Student's t-distribution. Specifically, it controls the kurtosis, or the thickness of the tails. Distributions with lower degrees of freedom have heavier tails, assigning more probability to extreme values. As the degrees of freedom increase (typically with a larger sample size), the t-distribution converges to the standard normal distribution, and its tails become thinner.
    • D. Incorrect. The central point of a confidence interval is determined by the sample statistic, which is typically the sample mean. While the width of the confidence interval is influenced by the critical t-value (which depends on the degrees of freedom), the central point itself is not.

    1.4 Define statistical concepts for data science.

    10.A researcher is testing a new drug to reduce blood pressure. They have a small sample of 20 patients. They measure each patient's blood pressure before and after the treatment. To determine if the drug has a statistically significant effect, which statistical test is most appropriate for this scenario?

    1. A.An independent two-sample T-test.
    2. B.A Z-test for two proportions.
    3. C.A paired-sample T-test.
    4. D.A Chi-squared test of independence.
    Show answer & explanation

    Correct answer: CA paired-sample T-test.

    • A. Incorrect. An independent two-sample T-test is used to compare the means of two separate, unrelated groups. This scenario involves measuring the same group of patients twice (before and after treatment), meaning the samples are dependent or paired, not independent.
    • B. Incorrect. A Z-test for two proportions is designed to compare proportions or percentages between two groups. Blood pressure is a continuous variable, not a proportion, making this test unsuitable.
    • C. Correct. A paired-sample T-test is the most appropriate choice because it is specifically designed to compare the means of the same group under two different conditions or at two different times. It accounts for the dependency between the 'before' and 'after' measurements for each patient.
    • D. Incorrect. A Chi-squared test of independence is used to determine if there is a significant association between two categorical variables. This scenario involves a continuous variable (blood pressure), not categorical data.

    Domain 2: Data Preparation and Feature Engineering

    2.4 Visualize and interpret the data to present a business case.

    11.Which TWO statements accurately describe best practices for using visualizations to present a business case to a non-technical audience?(Select 2)

    1. A.Each visualization should be self-contained with a clear title, labeled axes, and a concise takeaway message.
    2. B.Prioritize complex and novel chart types to demonstrate the sophistication of the analysis.
    3. C.Include as many variables as possible in a single chart to provide a comprehensive overview.
    4. D.Use a consistent color scheme and formatting throughout the presentation to avoid confusion.
    5. E.Display raw SQL queries alongside the charts to show the data's origin and build trust.
    Show answer & explanation

    Correct answers: A, DEach visualization should be self-contained with a clear title, labeled axes, and a concise takeaway message.; Use a consistent color scheme and formatting throughout the presentation to avoid confusion.

    • A. Correct. This is a fundamental principle of effective data communication. A self-contained visualization with a clear title, properly labeled axes, and a key takeaway allows a non-technical audience to quickly grasp the main point without needing extensive external context or technical explanation.
    • B. Incorrect. For a non-technical audience, clarity and simplicity are paramount. Complex or unfamiliar chart types can be confusing and intimidating, hindering communication. It is better to use simple, commonly understood charts like bar charts or line graphs to convey insights effectively.
    • C. Incorrect. Including too many variables in a single chart often leads to a cluttered and overwhelming visualization, making it difficult for the audience to interpret. Best practice is to focus each chart on a few key variables to tell a clear and specific story.
    • D. Correct. Consistency in design elements like color, fonts, and layout is crucial. A consistent visual language reduces cognitive load, helps the audience follow the narrative across multiple slides, and prevents confusion that can arise from arbitrary changes in formatting.
    • E. Incorrect. Displaying raw code like SQL queries is inappropriate for a non-technical audience. It introduces unnecessary complexity and technical jargon that can be overwhelming and distracting, ultimately undermining the goal of clear communication.

    2.4 Visualize and interpret the data to present a business case.

    12.An analyst is preparing a dataset for a business presentation. They run the following SQL query in Snowsight: `SELECT AVG(sales_amount) AS mean_sales, MEDIAN(sales_amount) AS median_sales FROM sales;` The result is `mean_sales` = 5000 and `median_sales` = 800. What is the most important insight to communicate to the business based on this result?

    1. A.The sales data is clean and follows a normal distribution.
    2. B.The typical sale is around $5000, and this value should be used for forecasting.
    3. C.The sales data is highly skewed by a number of very large sales, and the median ($800) is a better representation of a 'typical' sale.
    4. D.There is likely an error in the data, as the mean and median should always be very close.
    Show answer & explanation

    Correct answer: CThe sales data is highly skewed by a number of very large sales, and the median ($800) is a better representation of a 'typical' sale.

    • A. Incorrect. The relationship between the mean and median is a key indicator of the data's distribution. In a symmetric or normal distribution, the mean and median are approximately equal. The large discrepancy here (mean=5000, median=800) is a clear sign that the data is not normally distributed.
    • B. Incorrect. The mean is heavily influenced by outliers. Since the mean is much larger than the median, it's being skewed by a few very large sales. Using this inflated value for forecasting a 'typical' sale would be misleading and inaccurate.
    • C. Correct. A mean (5000) that is significantly higher than the median (800) is the classic indicator of a right-skewed distribution. This means a relatively small number of very high-value sales are pulling the average up. In such cases, the median is a much more robust and representative measure of a 'typical' sale because it is not affected by these extreme outliers. This is the most critical insight for business understanding.
    • D. Incorrect. While the mean and median are close in a symmetric distribution, a significant difference between them is not an error. Instead, it is a key statistical property of a skewed distribution, providing valuable insight into the presence of outliers and the overall shape of the data.

    2.2 Perform exploratory data analysis in Snowflake.

    13.What is the primary conceptual difference between a Snowpark DataFrame and a Pandas DataFrame?

    1. A.Snowpark DataFrames are immutable, while Pandas DataFrames are mutable.
    2. B.Snowpark DataFrames are lazily evaluated and represent SQL queries to be executed on the server, while Pandas DataFrames hold data in memory on the client.
    3. C.Snowpark DataFrames can only contain structured data, while Pandas DataFrames can handle unstructured data like JSON and XML.
    4. D.Snowpark DataFrames use a row-based storage format, while Pandas DataFrames use a columnar format.
    Show answer & explanation

    Correct answer: BSnowpark DataFrames are lazily evaluated and represent SQL queries to be executed on the server, while Pandas DataFrames hold data in memory on the client.

    • A. Incorrect. While transformations on a Snowpark DataFrame return a new DataFrame object, the core concept distinguishing it is lazy evaluation, not immutability. Pandas DataFrames are explicitly mutable, allowing for in-place modifications.
    • B. Correct. This is the fundamental architectural difference. A Snowpark DataFrame is a proxy object that represents a SQL query. Transformations build up this query plan, but no computation occurs until an action (like `collect()` or `show()`) is called. This is lazy evaluation, and all processing happens on the Snowflake warehouse. Conversely, a Pandas DataFrame holds the actual data in the client's memory, and operations are executed immediately (eagerly) on that in-memory data.
    • C. Incorrect. Snowpark DataFrames fully support Snowflake's VARIANT, OBJECT, and ARRAY types, allowing them to process semi-structured data like JSON, Avro, and Parquet effectively. Pandas can also handle semi-structured data. This is not a primary differentiator.
    • D. Incorrect. This statement is factually wrong. Snowpark DataFrames operate on data stored in Snowflake's underlying micro-partitions, which use a columnar storage format. Pandas DataFrames are also based on a columnar memory format for performance. Therefore, both leverage columnar formats.

    2.2 Perform exploratory data analysis in Snowflake.

    14.In a linear regression analysis of marketing spend vs. customer acquisition, a negative `REGR_SLOPE` value would indicate what?

    1. A.The model is flawed and the results are invalid.
    2. B.There is no relationship between marketing spend and customer acquisition.
    3. C.As marketing spend increases, the number of acquired customers tends to decrease.
    4. D.As marketing spend increases, the rate of customer acquisition slows down.
    Show answer & explanation

    Correct answer: CAs marketing spend increases, the number of acquired customers tends to decrease.

    • A. Incorrect. A negative `REGR_SLOPE` value does not necessarily mean the model is flawed or the results are invalid. It is a valid outcome that simply indicates the direction of the relationship between the variables, which in this case is an inverse relationship.
    • B. Incorrect. A negative `REGR_SLOPE` value indicates a specific type of relationship: a negative or inverse correlation. A slope of or near zero would suggest no linear relationship, but a non-zero value, whether positive or negative, implies a relationship exists.
    • C. Correct. In linear regression, the slope represents the change in the dependent variable for a one-unit change in the independent variable. A negative slope means that as the independent variable (marketing spend) increases, the dependent variable (number of acquired customers) tends to decrease.
    • D. Incorrect. This option describes diminishing returns, where the rate of change itself changes. A constant negative slope, as indicated by `REGR_SLOPE`, means the decrease in customer acquisition is constant for each unit increase in marketing spend, not that the rate is slowing down.

    2.3 Perform feature engineering on Snowflake data.

    15.An organization has deployed a real-time credit scoring model that requires low-latency access to pre-computed features like '30_day_avg_transaction_value'. The data science team uses Snowpark to compute these features daily in a batch process. How can the Snowpark Feature Store be used to bridge the gap between batch computation and real-time serving?

    1. A.The Feature Store's online store provides low-latency key-value access to the latest feature values for the production model.
    2. B.The Feature Store automatically re-trains the model in real-time whenever new data arrives.
    3. C.The Feature Store's offline store is used to store the historical feature data for model training and validation.
    4. D.The Feature Store can only be used for batch predictions, not real-time serving.
    5. E.All feature computations must be moved from batch to a streaming process to use the Feature Store.
    Show answer & explanation

    Correct answer: AThe Feature Store's online store provides low-latency key-value access to the latest feature values for the production model.

    • A. Correct. The primary function of a feature store's online component is to decouple feature computation from feature serving. It provides a low-latency, key-value retrieval interface for the latest feature values. This allows a batch process to compute features periodically (e.g., daily) and publish them to the online store, from which the real-time model can fetch them instantly during inference.
    • B. Incorrect. The Snowpark Feature Store is responsible for managing, storing, and serving features. It does not have the capability to automatically trigger or perform model retraining. Model retraining is a separate process in the MLOps lifecycle, typically managed by orchestration tools.
    • C. Incorrect. While it is true that the offline store (a Snowflake table) is used for storing historical data for model training, it is not designed for the low-latency, single-row lookups required for real-time serving. The online store is the component that specifically addresses the real-time serving requirement.
    • D. Incorrect. This statement is factually wrong. A key benefit of the Snowpark Feature Store is its ability to support both batch predictions (using the offline store) and real-time serving (using the online store), making it a versatile solution for different deployment patterns.
    • E. Incorrect. The Feature Store is designed to work with features computed in batch. A common and powerful pattern is to use scheduled batch jobs to compute features and then ingest the results into the online store for real-time serving. It is not required to convert all feature engineering pipelines to streaming.

    2.3 Perform feature engineering on Snowflake data.

    16.A large enterprise has separate teams building a fraud detection model and a customer churn model. Both models rely on a common set of base features, such as 'customer_since_date', 'lifetime_value', and 'avg_monthly_spend'. To ensure consistency and avoid duplicating feature engineering logic, which Snowflake capabilities should be used?(Select 2)

    1. A.Each team should create their own separate feature engineering pipelines to maintain independence.
    2. B.Use the Snowpark Feature Store to create and register a `FeatureView` for the common features.
    3. C.Store the common feature engineering logic in a shared SQL script or Python file and have each team run it independently.
    4. D.Create a materialized view in Snowflake that pre-computes the common features, making them available for all teams to query.
    5. E.Use Snowflake's Data Sharing to share the raw tables and let each team build features from scratch.
    Show answer & explanation

    Correct answers: B, DUse the Snowpark Feature Store to create and register a `FeatureView` for the common features.; Create a materialized view in Snowflake that pre-computes the common features, making them available for all teams to query.

    • A. Incorrect. This approach directly contradicts the goal of avoiding duplication and ensuring consistency. Creating separate pipelines would lead to duplicated engineering effort, increased maintenance overhead, and a high risk of the two teams generating inconsistent features from the same source data.
    • B. Correct. The Snowpark Feature Store is a purpose-built solution for managing the ML feature lifecycle. Creating and registering a `FeatureView` centralizes the feature engineering logic, making it discoverable, reusable, and versionable. Both teams can then access this single, governed source of truth for their features, ensuring consistency.
    • C. Incorrect. While sharing a script is a step towards reusability, having each team run it independently introduces significant risk. There is no guarantee that both teams are using the same version of the script, leading to potential inconsistencies. This method lacks the centralized management and governance provided by a feature store or a database object.
    • D. Correct. A materialized view pre-computes the results of the feature engineering logic and stores them. This creates a durable, performant, and consistent object within Snowflake that both teams can query. It effectively centralizes the transformation logic in a single database object, ensuring anyone who queries it gets the exact same pre-calculated features.
    • E. Incorrect. Sharing only the raw data forces each team to re-implement the feature engineering logic from scratch. This maximizes duplicated effort and guarantees inconsistencies will arise between the teams' feature pipelines, which is the exact problem the question aims to solve.

    2.1 Prepare and clean data in Snowflake.

    17.Which of the following are valid and common SQL aggregate functions used for data preparation and analysis in Snowflake?(Select 3)

    1. A.`SUM()`
    2. B.`MEDIAN()`
    3. C.`LISTAGG()`
    4. D.`CONCAT()`
    5. E.`APPROX_COUNT_DISTINCT()`
    Show answer & explanation

    Correct answers: A, C, E`SUM()`; `LISTAGG()`; `APPROX_COUNT_DISTINCT()`

    • A. Correct. `SUM()` is a fundamental and universally common SQL aggregate function used to calculate the total sum of a set of numeric values. It is essential for a wide range of data preparation and analytical tasks.
    • B. Incorrect. While `MEDIAN()` is a valid aggregate function in Snowflake for statistical analysis, the other correct options represent a more diverse and fundamental set of functions covering standard numeric, string, and large-scale approximate aggregations, which are frequently tested.
    • C. Correct. `LISTAGG()` is a powerful and common aggregate function that concatenates string values from multiple rows into a single string, typically with a specified delimiter. It is extremely useful for data preparation, transformation, and creating summarized reports.
    • D. Incorrect. `CONCAT()` is a scalar string function, not an aggregate function. It operates on values within a single row to join strings together, whereas aggregate functions operate on values across a group of rows to produce a single result.
    • E. Correct. `APPROX_COUNT_DISTINCT()` is a highly efficient aggregate function that provides a very close approximation of the number of distinct values in a column. It is commonly used in Snowflake for performance-critical analysis on massive datasets where an exact count is not required and speed is paramount.

    2.1 Prepare and clean data in Snowflake.

    18.A logistics company tracks shipment statuses in a table. A `delivery_date` column is often `NULL` for shipments that are still in transit. An analyst needs to create a report column that shows the `delivery_date`, but if it is `NULL`, it should display the `estimated_delivery_date` instead. If both are `NULL`, it should display the text 'Pending'. Which SQL expression correctly implements this logic?

    1. A.IFNULL(delivery_date, estimated_delivery_date, 'Pending')
    2. B.COALESCE(CAST(delivery_date AS VARCHAR), CAST(estimated_delivery_date AS VARCHAR), 'Pending')
    3. C.NVL(delivery_date, estimated_delivery_date, 'Pending')
    4. D.DECODE(delivery_date, NULL, estimated_delivery_date, 'Pending')
    Show answer & explanation

    Correct answer: BCOALESCE(CAST(delivery_date AS VARCHAR), CAST(estimated_delivery_date AS VARCHAR), 'Pending')

    • A. Incorrect. The `IFNULL` function in Snowflake only accepts two arguments: an expression to check for NULL and a replacement value. It cannot process the third argument ('Pending') to handle the nested fallback logic required by the question.
    • B. Correct. The `COALESCE` function is designed to evaluate a list of expressions and return the first one that is not NULL. This perfectly matches the required fallback logic. Crucially, the date columns are cast to `VARCHAR` to ensure data type compatibility with the final fallback value, which is the string 'Pending'. Without the cast, Snowflake would raise an error trying to return a DATE/TIMESTAMP and a VARCHAR from the same expression.
    • C. Incorrect. The `NVL` function is a synonym for `IFNULL` in Snowflake. Like `IFNULL`, it only accepts two arguments and cannot handle a multi-level fallback scenario.
    • D. Incorrect. The `DECODE` function is used for comparing an expression against a series of values, similar to a `CASE` statement. It is not the appropriate function for implementing a sequential fallback logic based on NULL values as `COALESCE` does.

    Domain 3: Model Development

    3.5 Interpret a model.

    19.A hospital uses a model to predict the length of stay (LOS) for new patients. The feature `ADMISSION_TYPE` (Emergency, Elective, Urgent) has a high impact. The PDP shows that 'Emergency' admissions have a significantly higher predicted LOS than 'Elective' admissions. How can the hospital administration use this insight?

    1. A.Stop accepting 'Emergency' admissions to reduce the average LOS.
    2. B.Conclude the model is biased and retrain it without the `ADMISSION_TYPE` feature.
    3. C.Use this information for resource planning, allocating more beds and staff resources to handle the expected longer stays for emergency admissions.
    4. D.Question the data quality, as admission type should not influence the length of stay.
    Show answer & explanation

    Correct answer: CUse this information for resource planning, allocating more beds and staff resources to handle the expected longer stays for emergency admissions.

    • A. Incorrect. This is an unethical and impractical application of the model's insight. A hospital's primary function includes providing critical care for emergencies, and this action would violate that mission.
    • B. Incorrect. This conclusion is not justified. The correlation between emergency admissions and longer stays is logical and expected in a healthcare setting. Removing a high-impact, valid predictor like `ADMISSION_TYPE` would likely decrease the model's accuracy and predictive power.
    • C. Correct. This is the most practical and valuable application of the model's insight. By anticipating longer stays for emergency patients, the hospital can proactively allocate beds, staff, and other resources more effectively, leading to improved operational efficiency and better patient care.
    • D. Incorrect. Questioning the data quality based on this finding is unreasonable. The influence of admission type on the length of stay is a well-understood and logical relationship in medicine; emergency cases are typically more severe and require more intensive, longer-term care.

    3.4 Validate a data science model.

    20.A data scientist is evaluating a classification model and observes that the precision is 0.90, but the recall is 0.10. What does this combination of metrics most likely indicate?

    1. A.The model is highly accurate overall.
    2. B.The model is very good at identifying positive cases but makes many false positive errors.
    3. C.The model is very conservative in predicting the positive class, and while its positive predictions are likely correct, it misses most of the actual positive cases.
    4. D.The dataset is perfectly balanced.
    Show answer & explanation

    Correct answer: CThe model is very conservative in predicting the positive class, and while its positive predictions are likely correct, it misses most of the actual positive cases.

    • A. Incorrect. High precision alone does not guarantee high overall accuracy. A low recall of 0.10 signifies that the model has a high number of false negatives (it fails to identify 90% of the actual positive cases). This large number of misclassifications negatively impacts the overall accuracy.
    • B. Incorrect. This statement describes the opposite of the given metrics. A model that is 'very good at identifying positive cases' would have a high recall, not a low one (0.10). A model that 'makes many false positive errors' would have low precision, not a high one (0.90).
    • C. Correct. This statement accurately describes the situation. A high precision (0.90) means that when the model predicts the positive class, it is correct 90% of the time, so its 'positive predictions are likely correct'. A low recall (0.10) means the model only identifies 10% of the total actual positive cases, meaning it 'misses most of the actual positive cases'. This behavior is characteristic of a 'conservative' model that sets a high threshold for predicting the positive class.
    • D. Incorrect. Precision and recall are performance metrics of a model on a dataset; they do not provide direct information about the class distribution or balance of the dataset itself.

    3.4 Validate a data science model.

    21.A data scientist runs the following query to calculate evaluation metrics for a regression model in Snowflake: ```sql SELECT AVG(ABS(p.predicted_value - a.actual_value)) AS mae, SQRT(AVG(POW(p.predicted_value - a.actual_value, 2))) AS rmse, 1 - (SUM(POW(a.actual_value - p.predicted_value, 2)) / SUM(POW(a.actual_value - (SELECT AVG(actual_value) FROM ACTUALS), 2))) AS r2 FROM PREDICTIONS p JOIN ACTUALS a ON p.id = a.id; ``` Which statement correctly describes the R-squared (r2) calculation in this query?

    1. A.The query incorrectly calculates R-squared; it should use correlation instead.
    2. B.The query correctly calculates R-squared by comparing the sum of squared errors of the model to the sum of squared errors of a baseline mean model.
    3. C.The query will fail because window functions are required to calculate the total sum of squares.
    4. D.The query calculates Adjusted R-squared, not R-squared.
    Show answer & explanation

    Correct answer: BThe query correctly calculates R-squared by comparing the sum of squared errors of the model to the sum of squared errors of a baseline mean model.

    • A. Incorrect. The SQL query uses the standard definition for R-squared (Coefficient of Determination), which is `1 - (SSR / SST)`. While R-squared is related to the correlation coefficient in simple linear regression, this formula is the correct and general way to calculate it, and it does not rely on the `CORR()` function.
    • B. Correct. The query correctly implements the formula for R-squared. The numerator `SUM(POW(a.actual_value - p.predicted_value, 2))` calculates the Sum of Squared Residuals (SSR), which is the model's error. The denominator `SUM(POW(a.actual_value - (SELECT AVG(actual_value) FROM ACTUALS), 2))` calculates the Total Sum of Squares (SST), which represents the error of a simple baseline model that always predicts the mean. R-squared measures the proportion of variance in the dependent variable explained by the model compared to this baseline.
    • C. Incorrect. The query will execute successfully. A subquery `(SELECT AVG(actual_value) FROM ACTUALS)` is a valid and common method to calculate the overall mean required for the Total Sum of Squares (SST). While a window function like `AVG(actual_value) OVER ()` could also be used for this purpose, it is not required, and its absence does not cause the query to fail.
    • D. Incorrect. The query calculates the standard R-squared. The formula for Adjusted R-squared is different, as it incorporates the number of data points and the number of predictors to penalize model complexity. The given SQL code does not include these additional terms.

    3.3 Train a data science model.

    22.A data team is training a weekly sales forecasting model. They need to implement a robust backtesting strategy using walk-forward validation with a training window of 52 weeks and a validation window of 4 weeks. Which Snowflake objects or concepts could be effectively combined to implement this strategy?(Select 3)

    1. A.A Python UDTF that takes the time-series data and generates multiple train/validation split identifiers for each row.
    2. B.A looping construct within a Python or Snowflake Scripting stored procedure to iterate through the time splits.
    3. C.A Dynamic Table to automatically generate the splits whenever new weekly data arrives.
    4. D.A `QUALIFY` clause with a window function to identify the rows belonging to each training and validation window in a SQL query.
    5. E.An external function to an outside service that specializes in time-series splitting.
    Show answer & explanation

    Correct answers: A, B, DA Python UDTF that takes the time-series data and generates multiple train/validation split identifiers for each row.; A looping construct within a Python or Snowflake Scripting stored procedure to iterate through the time splits.; A `QUALIFY` clause with a window function to identify the rows belonging to each training and validation window in a SQL query.

    • A. This is a correct and effective approach. A Python User-Defined Table Function (UDTF) can process the entire time-series dataset and, for each input row, generate multiple output rows. These output rows can be tagged with a split identifier and a label ('train' or 'validation'), effectively creating a complete, flattened dataset for all walk-forward validation folds in a single, set-based operation.
    • B. This is a correct and very common approach. A stored procedure, using either Python or Snowflake Scripting, allows for an imperative, iterative implementation. A `FOR` or `WHILE` loop can programmatically define the start and end of each shifting 52-week training and 4-week validation window, executing the model training and evaluation logic within each iteration. This provides a robust and controllable framework for backtesting.
    • C. This is incorrect. Dynamic Tables are designed for declarative, incremental data pipelines that automatically refresh. They are not suited for the procedural, iterative logic required to generate multiple overlapping time-series splits for a walk-forward validation strategy.
    • D. This is a correct concept to use in combination with other objects. The `QUALIFY` clause filters the results of window functions, allowing for concise and efficient SQL. When used inside a stored procedure loop (Option B), a query can use a window function like `ROW_NUMBER()` and `QUALIFY` to elegantly select the specific rows for the current training or validation window without requiring complex subqueries or CTEs.
    • E. This is incorrect. While technically possible, using an external function introduces unnecessary complexity, network latency, and cost. Snowflake's native capabilities, such as UDTFs, stored procedures, and advanced SQL, are powerful enough to implement this splitting logic efficiently within the platform, making an external call an anti-pattern for this task.

    3.3 Train a science model.

    23.What is a key advantage of using Dynamic Tables for automating data transformations in an ML pipeline?

    1. A.They allow for arbitrary Python code execution to perform transformations.
    2. B.They provide a declarative way to define transformations, and Snowflake automatically manages the refresh schedule and dependency graph to meet a target latency.
    3. C.They are optimized exclusively for real-time, event-by-event transformations with sub-second latency.
    4. D.They bypass the need for a virtual warehouse, reducing compute costs for transformations.
    Show answer & explanation

    Correct answer: BThey provide a declarative way to define transformations, and Snowflake automatically manages the refresh schedule and dependency graph to meet a target latency.

    • A. Incorrect. Dynamic Tables are defined using a declarative SQL query. While this query can call Python UDFs, the primary mechanism is not for arbitrary Python code execution, which is more characteristic of Snowpark DataFrames. Their core advantage lies elsewhere.
    • B. Correct. This is the primary value proposition of Dynamic Tables. Users define the desired final state of a table using a SQL query and specify a target data freshness (`TARGET_LAG`). Snowflake then automatically manages the entire pipeline, including the dependency graph and refresh schedule, to materialize the results efficiently and meet the latency target. This greatly simplifies building and maintaining data transformation pipelines for ML.
    • C. Incorrect. Dynamic Tables are designed for near-real-time updates, but not for sub-second, event-by-event streaming transformations. The minimum target lag is one minute, making them suitable for frequent batch updates, not true real-time processing. Technologies like Streams would be more appropriate for event-level processing.
    • D. Incorrect. Dynamic Tables require compute resources to perform the data transformations during their refresh process. These refreshes consume credits and run on Snowflake-managed virtual warehouses. They do not bypass the need for compute; rather, they automate the process of using it.

    3.3 Train a data science model.

    24.An MLOps engineer is building a production pipeline. Task `TRAIN_MODEL_TASK` runs a stored procedure to train a model. Task `EVALUATE_MODEL_TASK` must run immediately after the training completes successfully. How should the engineer configure the tasks to ensure this dependency?(Select 2)

    1. A.Schedule `EVALUATE_MODEL_TASK` to run 5 minutes after `TRAIN_MODEL_TASK` is scheduled to start.
    2. B.Define `EVALUATE_MODEL_TASK` with an `AFTER TRAIN_MODEL_TASK` clause in its `CREATE TASK` statement.
    3. C.Place both stored procedure calls in sequence inside a single 'parent' stored procedure and have a single task call that parent.
    4. D.Configure `TRAIN_MODEL_TASK` to `ALTER TASK EVALUATE_MODEL_TASK RESUME` upon successful completion.
    5. E.Use conditional logic within the `EVALUATE_MODEL_TASK` to check if the model file exists.
    Show answer & explanation

    Correct answers: B, CDefine `EVALUATE_MODEL_TASK` with an `AFTER TRAIN_MODEL_TASK` clause in its `CREATE TASK` statement.; Place both stored procedure calls in sequence inside a single 'parent' stored procedure and have a single task call that parent.

    • A. Incorrect. This is a brittle, time-based approach, not an event-driven dependency. It does not guarantee that the training task has completed successfully. If the training takes longer than 5 minutes, the tasks could run concurrently or the evaluation could run on stale data. If it takes less, it introduces an unnecessary delay.
    • B. Correct. This is the standard and recommended method for creating dependencies between tasks in Snowflake, forming a Directed Acyclic Graph (DAG). The `AFTER` clause explicitly defines that `EVALUATE_MODEL_TASK` is a successor to `TRAIN_MODEL_TASK` and will only be scheduled to run after the predecessor completes successfully.
    • C. Correct. This is a valid orchestration pattern. By encapsulating both the training and evaluation stored procedure calls sequentially within a single 'parent' stored procedure, a single task can execute this entire workflow. The calls inside the procedure are executed in order, ensuring that evaluation runs immediately after training. If the training stored procedure fails, the parent procedure will error out, and the evaluation step will not be executed.
    • D. Incorrect. A task cannot alter another task as part of its definition. Furthermore, `ALTER TASK ... RESUME` only makes a suspended task eligible to run on its next scheduled time; it does not trigger an immediate execution. This is not a valid mechanism for creating an execution dependency.
    • E. Incorrect. This approach relies on polling, which is inefficient and does not guarantee immediate execution. The `EVALUATE_MODEL_TASK` would need to be scheduled to run frequently, consuming warehouse credits while checking for a condition, and execution would be delayed by up to the length of the polling interval.

    3.1 Connect data science tools directly to data in Snowflake.

    25.A machine learning team is using the Snowpark ML Model Registry to manage their models. A new model version has been trained and logged. Before deploying it, they need to programmatically access specific information about the model for documentation and validation purposes. Which two pieces of information can be directly retrieved from a registered model object in the Snowpark ML Registry?(Select 2)

    1. A.The raw training data used to create the model.
    2. B.The Python script that was used for the training run.
    3. C.The performance metrics that were explicitly logged with the model (e.g., accuracy, MSE).
    4. D.The name and version of the model.
    5. E.The execution time of each training epoch.
    Show answer & explanation

    Correct answers: C, DThe performance metrics that were explicitly logged with the model (e.g., accuracy, MSE).; The name and version of the model.

    • A. Incorrect. The model registry stores the model artifact and its associated metadata, not the raw training data itself. The training data can be very large and is typically stored separately in Snowflake tables.
    • B. Incorrect. While it's possible to log the training script as an associated artifact with a model version, it is not a standard, directly retrievable attribute of the model object in the way metrics or tags are. Code is typically managed in a separate version control system.
    • C. Correct. A key feature of the Snowpark ML Model Registry is the ability to log and retrieve performance metrics (e.g., accuracy, MSE, F1-score) with each model version. This allows for programmatic comparison and validation of models.
    • D. Correct. The model name and version are fundamental identifiers and core attributes of a registered model object. They are directly accessible properties used for programmatically retrieving, managing, and identifying specific model versions within the registry.
    • E. Incorrect. This level of granular, dynamic information from the training process is typically captured by experiment tracking tools. While a final training duration might be logged as a custom metric, per-epoch times are not standard attributes stored in the model registry object.

    3.1 Connect data science tools directly to data in Snowflake.

    26.An analyst is working with a table in Snowflake that contains a `VARIANT` column named `PAYLOAD`. This column stores JSON data. The analyst needs to use Snowpark Python to flatten this data, extracting the `user_id` (a number) and `event_type` (a string) from each JSON object into new columns. They also need to filter out all records where `event_type` is 'test_event'. Which three Snowpark components or methods would be used to accomplish this task?(Select 3)

    1. A.`df['PAYLOAD:user_id']` or `df.col('PAYLOAD')['user_id']` to access a nested element.
    2. B.The `.to_pandas()` method to flatten the data on the client.
    3. C.A type cast, such as `.cast(IntegerType())`, to convert the extracted variant value to the correct data type.
    4. D.The `.filter()` or `.where()` method to apply the filtering condition.
    5. E.The `snowflake.connector.connect()` function.
    Show answer & explanation

    Correct answers: A, C, D`df['PAYLOAD:user_id']` or `df.col('PAYLOAD')['user_id']` to access a nested element.; A type cast, such as `.cast(IntegerType())`, to convert the extracted variant value to the correct data type.; The `.filter()` or `.where()` method to apply the filtering condition.

    • A. This is a correct approach. Snowpark provides a specific syntax to access nested elements within a VARIANT column. Both `df['PAYLOAD:user_id']` (using a colon) and `df.col('PAYLOAD')['user_id']` (using bracket notation on a Column object) are valid and standard ways to traverse the JSON structure and extract a specific key's value.
    • B. This is incorrect. The `.to_pandas()` method executes the query and pulls the entire dataset from Snowflake into a client-side Pandas DataFrame. While Pandas can flatten JSON, doing so on the client is highly inefficient for large datasets and defeats the purpose of Snowpark, which is to push computation down to Snowflake's warehouses.
    • C. This is a correct and necessary step. When a value is extracted from a VARIANT column, its data type is still VARIANT. To treat `user_id` as a number for calculations or to enforce a proper schema, it must be explicitly converted using a method like `.cast(IntegerType())`. This is a crucial part of the flattening process.
    • D. This is a correct method. The `.filter()` method (or its alias `.where()`) is the standard way to apply row-level filtering conditions to a Snowpark DataFrame. To exclude specific records, one would apply a filter such as `df.filter(df['PAYLOAD']['event_type'] != 'test_event')`.
    • E. This is incorrect. The `snowflake.connector.connect()` function is part of the Snowflake Connector for Python, which is a lower-level DB-API compliant driver. Snowpark uses its own `Session` object, typically created with `Session.builder.configs(...).create()`, to establish a connection and work with DataFrames.

    3.2 Leverage GenAI and LLM models in Snowflake.

    27.According to Snowflake documentation, what are the primary requirements for the training data used to fine-tune a model with the Snowflake Cortex Fine-Tuning service?(Select 2)

    1. A.Data must be in a staged Parquet file.
    2. B.Data must be in a Snowflake table.
    3. C.The dataset must contain at least 1 million rows.
    4. D.The dataset must follow a structure with columns for prompts and completions.
    5. E.The data must be pre-processed into vector embeddings.
    Show answer & explanation

    Correct answers: B, DData must be in a Snowflake table.; The dataset must follow a structure with columns for prompts and completions.

    • A. Incorrect. While data might be loaded into Snowflake from staged files like Parquet, the Cortex Fine-Tuning service itself requires the data to be resident in a Snowflake table, not directly in a staged file.
    • B. Correct. A fundamental requirement for Snowflake Cortex Fine-Tuning is that the training data must reside within a Snowflake table. The service directly accesses this table to perform the fine-tuning process.
    • C. Incorrect. There is no requirement for a minimum of 1 million rows. Snowflake documentation suggests starting with as few as 100 high-quality examples, although more data generally leads to better results.
    • D. Correct. The training dataset must adhere to a specific structure. It needs to contain distinct columns for the input prompts and the desired output completions, allowing the model to learn the input-output relationship.
    • E. Incorrect. The Cortex Fine-Tuning service handles the necessary pre-processing, including tokenization and embedding, as part of the fine-tuning job. Users provide raw text data, not pre-computed vector embeddings.

    3.2 Leverage GenAI and LLM models in Snowflake.

    28.A hospital wants to use `SNOWFLAKE.CORTEX.SUMMARIZE` on physician notes containing Protected Health Information (PHI). To ensure compliance, what Snowflake features should they implement *before* calling the Cortex function?(Select 2)

    1. A.Use Snowflake's native PII detection and Dynamic Data Masking policies to redact or anonymize PHI.
    2. B.Send the data to a third-party anonymization service before ingesting it into Snowflake.
    3. C.Encrypt the raw text column using `ENCRYPT()`, and then decrypt it inside the prompt sent to the LLM.
    4. D.Rely on the Cortex LLM to automatically identify and ignore any PHI it encounters.
    5. E.Create a secure view on the raw data that applies masking policies, and have the Cortex pipeline query this view.
    Show answer & explanation

    Correct answers: A, EUse Snowflake's native PII detection and Dynamic Data Masking policies to redact or anonymize PHI.; Create a secure view on the raw data that applies masking policies, and have the Cortex pipeline query this view.

    • A. This is a correct approach. Snowflake's built-in governance features, such as Data Classification for PII detection and Dynamic Data Masking, are specifically designed to protect sensitive information. By applying masking policies to columns containing PHI, the data can be automatically redacted or anonymized before it is passed to the Cortex function, ensuring compliance with regulations like HIPAA.
    • B. This is an incorrect approach. While using a third-party service is a possible method for data anonymization, it introduces unnecessary complexity, cost, and potential security risks by moving sensitive data outside of the Snowflake ecosystem. The best practice is to leverage Snowflake's integrated and native security features for a more secure and efficient solution.
    • C. This is incorrect. For the `SUMMARIZE` function to work, it needs to process the plain text. If the data is decrypted just before being sent to the LLM, the raw PHI is still exposed during processing, which defeats the purpose of encryption and fails to meet compliance requirements.
    • D. This is incorrect and highly risky. Relying on an LLM to implicitly identify and ignore PHI is not a reliable or compliant security control. Regulations require explicit, auditable protection measures. Trusting the model's behavior does not provide the guarantees needed for handling sensitive data like PHI.
    • E. This is a correct approach and represents the best-practice implementation for option A. By applying masking policies to a base table and then creating a secure view on top of it, access to data is controlled by policy. When the Cortex function queries this view, the masking policies are enforced automatically by the query engine, ensuring that only the masked, compliant version of the data is processed.

    3.5 Interpret a model.

    29.A feature impact analysis for a sales forecasting model reveals that a feature named `IS_HOLIDAY` has a very high impact. However, the business analyst is surprised, as holidays are infrequent. What is the most likely reason for the model assigning such a high impact to this feature?

    1. A.The feature impact calculation is flawed because it uses a method that overweights rare binary features, so the high score for `IS_HOLIDAY` should be disregarded as a measurement artifact.
    2. B.The model has overfit to the `IS_HOLIDAY` feature by memorizing noise on the few holiday examples, and its high impact score reflects this overfitting rather than genuine predictive power.
    3. C.On the specific days that are holidays, this feature is extremely predictive of a sales anomaly (e.g., a large spike or dip), so its overall contribution to model accuracy is high despite its infrequency.
    4. D.The feature impact calculation inherently favors binary features over continuous features because it uses a metric that scales with feature cardinality, making `IS_HOLIDAY` appear disproportionately important.
    Show answer & explanation

    Correct answer: COn the specific days that are holidays, this feature is extremely predictive of a sales anomaly (e.g., a large spike or dip), so its overall contribution to model accuracy is high despite its infrequency.

    • A. Incorrect. It is premature to assume the feature impact calculation is flawed. A high impact score, even for an infrequent feature, often reflects its genuine importance to the model's predictions and should be investigated rather than disregarded.
    • B. Incorrect. While overfitting can be a concern, it is not the most direct or fundamental reason for the high impact score. The score primarily reflects the feature's predictive power. The core reason for the high impact is the large effect the feature has on the target variable when it is present, not necessarily just an artifact of overfitting to noise.
    • C. Correct. Feature impact measures a feature's overall contribution to the model's predictive accuracy. An infrequent event, like a holiday, can have a massive and highly predictable effect on the target variable (e.g., a Black Friday sales spike). When the `IS_HOLIDAY` feature is active, it may be the single most important predictor for that day, significantly reducing the model's overall error. This large contribution, even if it happens rarely, results in a high overall impact score.
    • D. Incorrect. Standard feature impact calculation methods, such as permutation importance or SHAP, do not have an inherent bias that favors binary features over continuous ones. The impact is determined by the feature's predictive contribution, regardless of its data type.

    Domain 4: Model Deployment

    4.2 Determine the effectiveness of a model and retrain if necessary.

    30.A data scientist has trained a classification model and wants to deploy it as a Java UDF in Snowflake for batch evaluation against a new dataset. Which of the following steps are necessary to accomplish this?(Select 3)

    1. A.Serialize the trained model object into a file (e.g., pickle, joblib).
    2. B.Upload the model file and any required dependency files to a Snowflake internal stage.
    3. C.Create a Java UDF, referencing the files on the stage, that loads the model and implements a prediction method.
    4. D.Create a Snowpark DataFrame to directly call the model without a UDF.
    5. E.Register the model in the Snowflake Model Registry, which automatically creates the UDF.
    Show answer & explanation

    Correct answers: A, B, CSerialize the trained model object into a file (e.g., pickle, joblib).; Upload the model file and any required dependency files to a Snowflake internal stage.; Create a Java UDF, referencing the files on the stage, that loads the model and implements a prediction method.

    • A. To deploy a model trained outside of Snowflake, it must first be saved to a file. Serialization is the process of converting the in-memory model object into a format (like PMML, ONNX, or a proprietary Java serialization format) that can be stored on disk. This step is crucial to persist the model so it can be uploaded and used in another environment.
    • B. Snowflake UDFs run in a secure, sandboxed environment and cannot directly access external filesystems. To make the serialized model file and any required Java libraries (JARs) available to the UDF, they must first be uploaded to a Snowflake stage (either internal or external). This is a mandatory step to make the artifacts accessible within the Snowflake environment.
    • C. This is the core deployment step. The `CREATE FUNCTION` DDL statement defines the Java UDF and uses an `IMPORTS` clause to specify the path to the model file and any dependency JARs on the stage. The Java code for the UDF must contain the logic to load the serialized model from the staged file at runtime and implement the prediction method that will be called from SQL.
    • D. This is incorrect. While a Snowpark DataFrame would be used to *call* the deployed UDF on a dataset for batch scoring, the DataFrame itself cannot directly interact with a model file. The model's prediction logic must be encapsulated within an executable object like a UDF or a stored procedure to be callable within Snowflake's engine.
    • E. This is incorrect. The Snowflake Model Registry is a feature for managing the lifecycle of machine learning models, primarily those built with Snowpark ML. While it can simplify deployment for models it manages, it is not a required or fundamental step for deploying a custom Java UDF from a pre-trained model file. The process described in options A, B, and C is the standard, underlying method.

    4.2 Determine the effectiveness of a model and retrain if necessary.

    31.The term 'model decay' or 'model degradation' refers to which phenomenon?

    1. A.The process of a model's file becoming corrupted over time on storage.
    2. B.The decrease in a model's predictive power on new data over time due to changes in the environment.
    3. C.A planned reduction in model complexity to improve inference speed.
    4. D.The gradual increase in the number of features used by the model.
    Show answer & explanation

    Correct answer: BThe decrease in a model's predictive power on new data over time due to changes in the environment.

    • A. Incorrect. This describes a technical issue related to file or storage corruption, which is distinct from model decay. Model decay is a performance issue, not a physical data integrity problem.
    • B. Correct. Model decay, also known as model degradation or concept drift, is the phenomenon where a model's predictive performance diminishes over time. This occurs because the statistical properties of the input data (the environment) change, making the patterns the model learned during training less relevant to the new data.
    • C. Incorrect. This describes a deliberate model optimization technique, such as pruning or quantization, aimed at improving efficiency. Model decay is an unintended and undesirable decline in performance, not a planned modification.
    • D. Incorrect. This describes a change in the model's architecture or feature set, which is part of feature engineering or model evolution. Model decay is concerned with the decline in performance of a static model, not its structural changes.

    4.1 Move a data science model into production.

    32.An MLOps engineer has used the Snowflake Model Registry to log a new version of a demand forecasting model named `FORECAST_V3`. They now need to deploy this specific model version as a permanent SQL function for the business intelligence team to use. Which sequence of actions is correct?

    1. A.Write a `CREATE FUNCTION` statement manually, pointing to the model artifacts in the registry's internal stage.
    2. B.Use `snow model deploy` from the SnowSQL CLI, specifying the model name and version.
    3. C.In a Snowpark Python script, get a reference to the model version from the registry and call the `.deploy()` method on it.
    4. D.Create an External Function that calls the Model Registry's internal deployment API.
    Show answer & explanation

    Correct answer: CIn a Snowpark Python script, get a reference to the model version from the registry and call the `.deploy()` method on it.

    • A. Incorrect. Manually creating a function by pointing to internal stage files bypasses the entire purpose of the Snowflake Model Registry. This approach ignores the registry's built-in versioning, governance, and streamlined deployment capabilities, making it an incorrect and unmanageable practice.
    • B. Incorrect. This option contains a critical inaccuracy. The `snow model deploy` command is part of the Snowflake CLI (invoked with `snow`), not the SnowSQL client. SnowSQL is a command-line client for executing SQL queries, not for managing model deployments via dedicated commands.
    • C. Correct. This describes the proper programmatic method for deploying a model from the registry. Using the Snowpark ML library, a user can get a reference to a specific model version (which returns a `ModelReference` object). This object has a `.deploy()` method that directly handles the creation of a permanent User-Defined Function (UDF) in the database, making it available for SQL queries.
    • D. Incorrect. External Functions are designed to call code running outside of Snowflake, such as an API endpoint on a cloud provider. This is completely irrelevant for deploying a model that is already stored and managed within Snowflake's own Model Registry as a native SQL function.

    4.1 Move a data science model into production.

    33.A financial institution is required by regulators to track exactly which model version was used to make every loan approval decision. They use the Snowflake Model Registry to manage their credit risk models. How can they best implement a robust governance and auditability system for their model predictions?(Select 3)

    1. A.When storing a prediction, also store the unique version name or SHA of the model retrieved from the Model Registry.
    2. B.Use model aliases or tags like 'production' and 'challenger' within the Model Registry to clearly mark the status of each model version.
    3. C.Leverage the Model Registry's lineage tracking to see which data was used to train the model version that made a specific decision.
    4. D.Store the entire serialized model object in a BLOB column alongside every prediction made.
    5. E.Rely on the warehouse query history to determine which UDF, and therefore which model, was active at the time of the decision.
    Show answer & explanation

    Correct answers: A, B, CWhen storing a prediction, also store the unique version name or SHA of the model retrieved from the Model Registry.; Use model aliases or tags like 'production' and 'challenger' within the Model Registry to clearly mark the status of each model version.; Leverage the Model Registry's lineage tracking to see which data was used to train the model version that made a specific decision.

    • A. This is a fundamental and correct practice for model auditability. Storing the model's unique version identifier (its name or SHA hash) directly in the same record as the prediction creates an immutable, explicit link. This allows auditors to trace every single decision back to the exact model version that produced it, directly satisfying the core regulatory requirement.
    • B. This is a correct and crucial governance practice. Using aliases or tags like 'production', 'challenger', or 'archived' provides essential context about the model's role within the MLOps lifecycle. For an audit, this helps explain not just *which* version was used, but also its approved status at the time of the prediction, forming a key part of a comprehensive governance framework.
    • C. This is correct as it addresses a deeper level of auditability. The Snowflake Model Registry's lineage capabilities allow tracing a model version back to the specific training data and code used to create it. For regulators, this provides a complete, end-to-end audit trail from the raw data used for training all the way to the final business decision, ensuring full transparency.
    • D. This is incorrect because it is extremely inefficient and impractical. Storing the entire serialized model object with every prediction would lead to massive data duplication and exorbitant storage costs. A simple, lightweight version identifier as described in option A is all that is needed to link the prediction back to the single, centrally-stored model object in the registry.
    • E. This is an incorrect and unreliable method. Warehouse query history is transient (with a limited retention period) and is not designed for permanent, row-level auditing. It may be difficult to parse, might not contain the specific model version if a generic UDF is used, and is not a robust solution for a critical regulatory requirement.

    4.3 Outline model lifecycle and validation tools.

    34.An organization has a data pipeline where a stream on a landing table is consumed every 15 minutes by a `preprocess_task`. This populates a `feature_store` table. A second, resource-intensive task, `retrain_model_task`, should only run when at least 10,000 new rows have been accumulated in the `feature_store` table. How should this dependency be implemented efficiently in Snowflake?

    1. A.Create a second stream on `feature_store` and have `retrain_model_task` run on a schedule, with a `WHEN` clause checking if the stream contains more than 10,000 rows.
    2. B.Modify `preprocess_task` to insert a record into a separate `trigger_table` and have `retrain_model_task` check the `COUNT(*)` of that table.
    3. C.Create a stream on the `feature_store` table. Define `retrain_model_task` to run after `preprocess_task` in a task graph. The task's called stored procedure should first check the stream's row count and exit if it's below 10,000.
    4. D.Schedule `retrain_model_task` to run daily and have it query `feature_store` using `CHANGES` to see if more than 10,000 rows have been added.
    Show answer & explanation

    Correct answer: CCreate a stream on the `feature_store` table. Define `retrain_model_task` to run after `preprocess_task` in a task graph. The task's called stored procedure should first check the stream's row count and exit if it's below 10,000.

    • A. This approach is incorrect because the `WHEN` clause in a Snowflake task definition does not support arbitrary conditions like checking a stream's row count. It only accepts the `SYSTEM$STREAM_HAS_DATA('stream_name')` function, which returns a simple boolean indicating if the stream is non-empty, not the number of rows it contains.
    • B. This is an inefficient and overly complex solution. It requires creating and maintaining an additional `trigger_table` and modifying the existing `preprocess_task`. This manual approach circumvents Snowflake's powerful, built-in change data capture capabilities provided by streams, which are designed for this exact purpose.
    • C. This is the most efficient and idiomatic Snowflake solution. It correctly uses a stream on the `feature_store` table to track new rows with minimal overhead. By setting up a task graph where `retrain_model_task` runs `AFTER preprocess_task`, the logic is triggered only when new data is potentially available. The stored procedure called by the task can then perform a very lightweight `COUNT(*)` query on the stream. If the count is below the threshold, the procedure exits immediately, consuming negligible resources. This ensures the expensive retraining logic only executes when the specific condition is met.
    • D. This method is inefficient because it relies on a fixed daily schedule. The `retrain_model_task` would run and consume compute credits every day to check for changes, regardless of whether the 10,000-row threshold has been met. This is less cost-effective and less responsive than an event-driven approach using streams and task dependencies.

    4.3 Outline model lifecycle and validation tools.

    35.A team wants to run an A/B test in production between two model versions, `v8` and `v9`. They need to create a single SQL UDF, `predict_ab(...)`, that internally routes 50% of requests to `v8` and 50% to `v9`. How can this be implemented inside the UDF's handler code?

    1. A.Use `MODEL REFERENCE` to pass both model versions to the UDF and use an `IF/ELSE` block.
    2. B.The UDF handler should instantiate two separate `ModelReference` objects, one for `v8` and one for `v9`, and then use a random number generator to decide which model's `predict()` method to call.
    3. C.Set two aliases, `champion` for `v8` and `challenger` for `v9`, and use a `CASE` statement in the SQL query that calls the UDF to alternate between them.
    4. D.This is not possible within a single UDF; two separate UDFs must be created and the calling application must handle the 50/50 split.
    Show answer & explanation

    Correct answer: BThe UDF handler should instantiate two separate `ModelReference` objects, one for `v8` and one for `v9`, and then use a random number generator to decide which model's `predict()` method to call.

    • A. Incorrect. The `MODEL REFERENCE` clause is used in the `CREATE FUNCTION` statement to bind a primary model to the UDF, not to pass multiple models as runtime arguments. Furthermore, a simple `IF/ELSE` block without a randomization component cannot achieve the probabilistic 50/50 split required for an A/B test.
    • B. Correct. This describes the canonical approach for implementing A/B testing within a single UDF. Inside the Python handler code, one can use the Snowflake Model Registry API to look up and instantiate separate `ModelReference` objects for each version (`v8` and `v9`). A random number generator (e.g., `if random.random() < 0.5`) can then be used to conditionally invoke the `.predict()` method on one of the two model objects, thereby handling the 50/50 routing logic internally.
    • C. Incorrect. This approach moves the A/B testing logic out of the UDF and into the calling SQL query. The question explicitly requires the routing to be implemented *inside* the UDF's handler code. While setting model aliases is a valid feature, using a `CASE` statement in the outer query violates this core requirement.
    • D. Incorrect. This statement is false. Snowflake's Python UDFs are fully capable of containing complex logic, including programmatic access to the Model Registry to load multiple model versions and implement conditional routing. Therefore, it is entirely possible to perform the A/B test within a single UDF as described in option B.

    Want the full experience?

    These are just samples. Practice the full Snowflake SnowPro Advanced: Data Scientist (DSA-C03) question bank in quiz mode — free, no signup, with domain practice and exam simulation.