Prepare and test your skills

Prepare and test your skills

Free sample question, answered and explained below. The Professional Data Engineer practice bank has 1,353 more like it. Try 10 free: instant score, no account.
An analytics team in an enterprise retail organization is designing a BigQuery analytical table for sales transactions. The table ingests approximately 40 GB of new data daily and will store several years of historical transactions.
The team identified the following query access patterns and operational constraints:
store_id (medium cardinality), followed by customer_id (high cardinality), and occasionally include order_statusHow should the table be partitioned and clustered to optimize query performance and cost?
transaction_timestamp, store_id, and customer_id without configuring table partitioning.This approach relies entirely on table clustering across timestamp and entity attributes on an unpartitioned table without creating distinct physical partitions.
transaction_timestamp sorts storage blocks, it does not physically segment data into independent partition files, resulting in less deterministic partition pruning compared to date partitioning.This strategy would be appropriate if individual date partitions would contain less than 10 GB of data, or if the table exceeded the maximum limit of 4,000 partitions across its lifecycle.
Clustering alone is ideal for tables requiring sorting across many high-cardinality dimensions where strict pre-execution cost estimation is not a business requirement.
DATE(transaction_timestamp) and cluster the table by customer_id, order_status, and store_id.This design correctly partitions by DATE(transaction_timestamp), but clusters columns in the order of customer_id, order_status, and store_id.
CLUSTER BY clause to organize and sort storage blocks from left to right. Because store_id is placed at the end of the clustering definition, queries filtering only by store_id (or store_id and customer_id) cannot effectively prune blocks.customer_id) in queries that filter primarily by store_id prevents optimal block pruning, forcing workers to scan unnecessary blocks and consume more slot time.This column ordering would be optimal if queries predominantly filtered on customer_id as the primary filter before narrowing down by order_status and store_id.
To maximize block pruning, always order clustering columns in the CLUSTER BY clause according to the frequency and hierarchy of how columns appear in query WHERE clauses.
store_id and cluster the table by transaction_timestamp and customer_id.This design uses integer-range partitioning on store_id to physically segment data into numeric buckets, while clustering the data inside each bucket by timestamp and customer identifier.
store_id forces queries filtering on time windows to scan across all store partitions, resulting in massive partition scans.This pattern would be correct if queries exclusively filtered on numeric store ranges without temporal filters, or in multi-tenant systems where tenant ID is an integer and queries never span tenants.
Always choose the primary query filter dimension (most commonly date/time in append-heavy transaction datasets) as the table partitioning key.
DATE(transaction_timestamp) and cluster the table by store_id, customer_id, and order_status.This solution combines time-unit table partitioning on DATE(transaction_timestamp) with multi-column clustering on store_id, customer_id, and order_status.
DATE(transaction_timestamp) creates distinct physical segments per day. Because partition metadata is known prior to query execution, BigQuery provides granular and deterministic query cost estimates in the query dry-run/preview before running.store_id, customer_id, order_status). Queries filtering by store_id alone or store_id combined with customer_id follow the left-to-right sort order, enabling BigQuery to skip non-matching blocks completely.customer_id and medium-cardinality fields like store_id benefit from block metadata min/max pruning.Combining partitioning on the primary temporal filter with clustering ordered by the most frequent filter columns (store_id first, then customer_id, then order_status) strictly follows BigQuery design best practices for query pruning and cost optimization.
Answer them yourself and get your score the moment you finish. No account needed.
Full access includes
Keep the momentum going with these hand-picked practice scenarios
Last updated Validated