Bird
Raised Fist0
GCPcloud~20 mins

Bigtable schema design in GCP - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Bigtable Schema Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding Row Key Design in Bigtable
Why is it important to design row keys in Bigtable to avoid sequential patterns?
ABecause sequential row keys cause data to be stored in multiple tables automatically.
BBecause sequential row keys increase storage costs significantly.
CBecause sequential row keys prevent data from being compressed.
DBecause sequential row keys can cause hotspotting, leading to uneven load on nodes.
Attempts:
2 left
💡 Hint
Think about how Bigtable distributes data across nodes.
❓ query_result
intermediate
2:00remaining
Predicting Data Retrieval Order
Given a Bigtable with row keys formatted as 'userID#timestamp', what will be the order of rows returned when scanning the table?
ARows will be returned sorted by userID ascending, then timestamp ascending.
BRows will be returned in random order.
CRows will be returned sorted by timestamp ascending, then userID ascending.
DRows will be returned sorted by userID descending, then timestamp descending.
Attempts:
2 left
💡 Hint
Remember how Bigtable sorts rows lexicographically by row key.
📝 Syntax
advanced
2:00remaining
Identifying Invalid Row Key Design
Which of the following row key designs is invalid because it can cause performance issues in Bigtable?
AUsing a random UUID as the row key.
BUsing a hashed user ID as the prefix of the row key (e.g., 'a1b2c3#20240601').
CUsing a timestamp as the prefix of the row key (e.g., '20240601#user123').
DUsing a reversed timestamp as the prefix of the row key (e.g., '10964202#user123').
Attempts:
2 left
💡 Hint
Consider how row key prefixes affect data distribution.
❓ optimization
advanced
2:00remaining
Optimizing Column Family Usage
Which practice optimizes Bigtable schema design regarding column families?
APut all columns into a single column family regardless of access patterns.
BGroup columns with similar access patterns into the same column family.
CCreate a separate column family for every individual column.
DAvoid using column families and store all data in row keys.
Attempts:
2 left
💡 Hint
Think about how column families affect read and write efficiency.
🔧 Debug
expert
3:00remaining
Diagnosing Hotspotting in Bigtable
A Bigtable instance is experiencing slow write performance. The row keys are user IDs followed by timestamps in ascending order (e.g., 'user123#20240601'). What is the most likely cause?
ARow keys are causing hotspotting because timestamps are ascending, leading to sequential writes on the same node.
BThe row keys are too short, causing collisions.
CThe table has too many column families, causing overhead.
DColumn families are too large, causing slow writes.
Attempts:
2 left
💡 Hint
Consider how row key order affects write distribution.

Practice

(1/5)
1. What is the main purpose of designing a row key carefully in Bigtable schema design?
easy
A. To balance load and enable fast queries
B. To store large binary files
C. To create multiple databases
D. To encrypt data automatically

Solution

  1. Step 1: Understand the role of row keys in Bigtable

    Row keys uniquely identify rows and determine data distribution across nodes.
  2. Step 2: Analyze the impact of row key design

    Good row key design balances load and speeds up queries by avoiding hotspots.
  3. Final Answer:

    To balance load and enable fast queries -> Option A
  4. Quick Check:

    Row key design = balance load + fast queries [OK]
Hint: Row keys control data distribution and query speed [OK]
Common Mistakes:
  • Thinking row keys store data themselves
  • Confusing row keys with column families
  • Assuming row keys encrypt data
2. Which of the following is the correct way to group related columns in Bigtable?
easy
A. Using multiple row keys
B. Using separate tables
C. Using column families
D. Using indexes

Solution

  1. Step 1: Recall Bigtable's data organization

    Bigtable organizes columns into column families to group related data.
  2. Step 2: Identify the correct grouping method

    Column families group related columns for performance and management.
  3. Final Answer:

    Using column families -> Option C
  4. Quick Check:

    Related columns = column families [OK]
Hint: Group related columns with column families [OK]
Common Mistakes:
  • Confusing row keys with column grouping
  • Thinking indexes group columns
  • Using separate tables unnecessarily
3. Given a Bigtable with row keys designed as userID#timestamp, what is the main benefit of this design?
medium
A. It enables efficient queries for a single user's recent activity
B. It groups all data by timestamp only
C. It allows fast retrieval of all users' data at once
D. It prevents any data duplication

Solution

  1. Step 1: Analyze the row key format

    The row key combines userID and timestamp, so rows are sorted by user and time.
  2. Step 2: Understand query benefits

    This design allows quick access to recent activity for a specific user by scanning a key range.
  3. Final Answer:

    It enables efficient queries for a single user's recent activity -> Option A
  4. Quick Check:

    Row key userID#timestamp = fast user recent queries [OK]
Hint: Row keys with userID first speed user-specific queries [OK]
Common Mistakes:
  • Assuming it groups all users' data together
  • Thinking it only sorts by timestamp
  • Believing it prevents duplication
4. You notice that your Bigtable cluster has hotspots causing slow queries. Which schema design change can help fix this?
medium
A. Use a sequential numeric row key
B. Add a random prefix to the row key
C. Group all columns into one column family
D. Remove timestamps from row keys

Solution

  1. Step 1: Identify cause of hotspots

    Sequential row keys cause data to cluster on few nodes, creating hotspots.
  2. Step 2: Apply solution to distribute load

    Adding a random prefix spreads data across nodes, balancing load and reducing hotspots.
  3. Final Answer:

    Add a random prefix to the row key -> Option B
  4. Quick Check:

    Random prefix = balanced load, fewer hotspots [OK]
Hint: Randomize row keys to avoid hotspots [OK]
Common Mistakes:
  • Using sequential keys which cause hotspots
  • Grouping columns doesn't fix hotspots
  • Removing timestamps reduces query flexibility
5. You want to design a Bigtable schema for IoT sensor data that arrives frequently from many devices. Which design choice best supports fast queries for recent data per device and balanced load?
hard
A. Row key as randomUUID with sensor data in multiple tables
B. Row key as timestamp#deviceID with all columns in one family
C. Row key as deviceID only, with timestamps as columns
D. Row key as deviceID#timestamp with column families for sensor types

Solution

  1. Step 1: Consider query pattern

    Queries focus on recent data per device, so deviceID first in row key helps range scans.
  2. Step 2: Consider load balancing and data grouping

    Using column families for sensor types groups related data efficiently; timestamp after deviceID orders data by time.
  3. Final Answer:

    Row key as deviceID#timestamp with column families for sensor types -> Option D
  4. Quick Check:

    DeviceID#timestamp + column families = fast, balanced queries [OK]
Hint: Use deviceID first in row key, group columns by type [OK]
Common Mistakes:
  • Putting timestamp first slows device queries
  • Using random UUID breaks data locality
  • Storing timestamps as columns complicates queries
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard