Bird
Raised Fist0
Hadoopdata~20 mins

HBase data model (column families) in Hadoop - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
HBase Column Family Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding Column Families in HBase

In HBase, what is the primary purpose of grouping columns into column families?

ATo physically store related columns together on disk for efficient access
BTo enforce data type constraints on columns within the family
CTo automatically replicate data across different clusters
DTo define user access permissions for individual columns
Attempts:
2 left
💡 Hint

Think about how HBase organizes data on disk to improve read/write performance.

❓ dax_lod_result
intermediate
2:00remaining
Column Family Storage Impact on Data Retrieval

Consider an HBase table with two column families: info and metrics. If you query only columns from the info family, what is the expected impact on data retrieval performance?

AOnly the <strong>info</strong> family data blocks are read, improving query speed
BBoth <strong>info</strong> and <strong>metrics</strong> families are read, no performance gain
CThe entire row is scanned regardless of column family, slowing down the query
DData from <strong>metrics</strong> family is cached automatically, speeding up retrieval
Attempts:
2 left
💡 Hint

Recall how HBase stores column families separately on disk.

❓ data_modeling
advanced
2:30remaining
Designing Column Families for Efficient Writes

You are designing an HBase table for a sensor data application. Sensors send frequent updates for temperature and humidity. Which column family design will optimize write performance?

ACreate one column family for all sensor data (temperature and humidity together)
BCreate separate column families for temperature and humidity data
CCreate a column family for metadata and store sensor data as JSON in one column
DUse one column family but store temperature and humidity in different rows
Attempts:
2 left
💡 Hint

Think about how HBase handles writes to different column families.

🔧 Debug
advanced
2:30remaining
Identifying Column Family Misconfiguration

An HBase table has two column families: cf1 and cf2. After adding many columns to cf1, you notice slow read performance. Which misconfiguration is most likely causing this?

AUsing different column families for unrelated data
BColumn families are not compressed, causing slow reads
CToo many columns in a single column family causing large data blocks
DRow keys are not unique, causing read conflicts
Attempts:
2 left
💡 Hint

Consider how column family size affects disk I/O.

🎯 Scenario
expert
3:00remaining
Optimizing Column Family Design for Mixed Access Patterns

Your HBase table stores user profiles and their activity logs. Profiles are read frequently but updated rarely. Activity logs are written frequently but read less often. How should you design column families to optimize both read and write performance?

AStore profiles in one table and activity logs in a separate HBase table
BUse one column family for both profiles and activity logs to simplify schema
CStore profiles as JSON in one column family and activity logs as separate columns in another
DCreate separate column families: one for profiles and one for activity logs
Attempts:
2 left
💡 Hint

Think about how HBase handles read and write workloads per column family.

Practice

(1/5)
1. What is the main purpose of column families in HBase?
easy
A. To encrypt data automatically
B. To store data in rows instead of columns
C. To create indexes for faster searching
D. To group related columns together for better organization

Solution

  1. Step 1: Understand the role of column families

    Column families group related columns in HBase tables to organize data logically.
  2. Step 2: Identify the main purpose

    This grouping helps manage storage and access efficiently by keeping related data together.
  3. Final Answer:

    To group related columns together for better organization -> Option D
  4. Quick Check:

    Column families = Group related columns [OK]
Hint: Think of column families as folders grouping related files [OK]
Common Mistakes:
  • Confusing column families with rows
  • Thinking column families create indexes
  • Assuming column families encrypt data
2. Which of the following is the correct way to define a column family in an HBase table schema?
easy
A. create 'mytable', 'cf1'
B. CREATE TABLE mytable (rowkey STRING, cf1:col1 STRING)
C. INSERT INTO mytable (cf1) VALUES ('value')
D. ALTER TABLE mytable ADD COLUMN cf1

Solution

  1. Step 1: Recall HBase shell syntax for creating tables

    In HBase shell, tables are created with column families using: create 'table_name', 'column_family'
  2. Step 2: Match the correct syntax

    create 'mytable', 'cf1' matches this syntax exactly, defining 'cf1' as a column family.
  3. Final Answer:

    create 'mytable', 'cf1' -> Option A
  4. Quick Check:

    HBase create table syntax = create 'table', 'cf' [OK]
Hint: Use HBase shell syntax: create 'table', 'column_family' [OK]
Common Mistakes:
  • Using SQL syntax instead of HBase shell
  • Trying to add columns like in relational DBs
  • Confusing insert with create commands
3. Given an HBase table with column families cf1 and cf2, what happens if you insert data only into cf1:colA for a row?
medium
A. Only cf1:colA stores data; cf2 columns remain empty for that row
B. Data is automatically copied to cf2
C. The row is rejected because all column families must have data
D. The entire row is deleted

Solution

  1. Step 1: Understand column family independence

    In HBase, column families are independent; data can be stored in any family without affecting others.
  2. Step 2: Analyze the effect of inserting data into one family

    Inserting data into cf1:colA stores data only there; cf2 columns remain empty for that row.
  3. Final Answer:

    Only cf1:colA stores data; cf2 columns remain empty for that row -> Option A
  4. Quick Check:

    Column families store data independently [OK]
Hint: Data in one column family doesn't affect others [OK]
Common Mistakes:
  • Assuming data copies across column families
  • Thinking all families must have data per row
  • Believing row is deleted if some families are empty
4. You tried to create an HBase table with this command: create 'mytable' 'cf1' 'cf2' but got an error. What is the likely cause?
medium
A. You cannot create multiple column families in one command
B. The syntax requires column families as separate arguments with commas
C. Column family names must be enclosed in double quotes
D. Table names cannot contain numbers

Solution

  1. Step 1: Review HBase create table syntax

    The correct syntax is: create 'table_name', 'cf1', 'cf2' with commas between column families.
  2. Step 2: Identify the error in the command

    The command is missing commas between column families, which is invalid syntax in HBase shell.
  3. Final Answer:

    The syntax requires column families as separate arguments with commas -> Option B
  4. Quick Check:

    HBase create syntax = with commas between column families [OK]
Hint: List column families with commas in create command [OK]
Common Mistakes:
  • Omitting commas between column families
  • Using quotes incorrectly
  • Thinking table names can't have numbers
5. You want to design an HBase table to store customer data with addresses and orders. Which is the best way to use column families?
hard
A. Create one column family for all data: 'cf_all'
B. Create a column family per customer
C. Create separate column families like 'address' and 'orders' to group related columns
D. Store addresses as rows and orders as columns in one family

Solution

  1. Step 1: Understand column family design principles

    Column families group related columns to improve performance and reflect real-world categories.
  2. Step 2: Apply to customer data scenario

    Separating 'address' and 'orders' into different column families groups related data logically and optimizes storage.
  3. Final Answer:

    Create separate column families like 'address' and 'orders' to group related columns -> Option C
  4. Quick Check:

    Use column families to group related data categories [OK]
Hint: Group related data in separate column families for clarity [OK]
Common Mistakes:
  • Putting all data in one family causing inefficiency
  • Creating a family per customer wastes resources
  • Mixing rows and columns incorrectly
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