0
0
Elasticsearchquery~20 mins

Visualization types in Elasticsearch - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Elasticsearch Visualization Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
What is the output of this Elasticsearch aggregation visualization query?
Given the following Elasticsearch aggregation query for a bar chart visualization, what will be the count of documents in the bucket for the term "status:200"?
Elasticsearch
{
  "size": 0,
  "aggs": {
    "status_codes": {
      "terms": {
        "field": "status",
        "size": 3
      }
    }
  }
}
AThe bucket for status:200 will contain the count of all documents with status 200.
BThe bucket for status:200 will contain the count of all documents with status 404.
CThe bucket for status:200 will be empty because terms aggregation does not support numeric fields.
DThe bucket for status:200 will contain the total count of all documents regardless of status.
Attempts:
2 left
💡 Hint
Terms aggregation groups documents by unique values of a field.
🧠 Conceptual
intermediate
1:30remaining
What type of visualization is best for showing trends over time in Elasticsearch?
You want to visualize the number of sales per day over the last month using Elasticsearch aggregations. Which visualization type is most appropriate?
AGauge showing total sales count.
BData table listing all sales documents.
CPie chart showing sales distribution by product category.
DLine chart showing sales count per day over time.
Attempts:
2 left
💡 Hint
Trends over time are best shown with continuous time-based charts.
🔧 Debug
advanced
2:30remaining
Why does this Elasticsearch pie chart show only one slice?
You created a pie chart visualization with a terms aggregation on the field 'category'. However, the pie chart shows only one slice labeled 'Other'. What is the most likely cause?
Elasticsearch
{
  "size": 0,
  "aggs": {
    "categories": {
      "terms": {
        "field": "category",
        "size": 5,
        "min_doc_count": 10
      }
    }
  }
}
AThere are no documents with category values having at least 10 documents, so all are grouped into 'Other'.
BThe field 'category' is missing from all documents, so only 'Other' appears.
CThe size parameter is too large, causing aggregation to fail and show only 'Other'.
DPie charts cannot display terms aggregations with min_doc_count set.
Attempts:
2 left
💡 Hint
min_doc_count filters out buckets with fewer documents.
🧠 Conceptual
advanced
2:00remaining
Which Elasticsearch visualization type is best for showing hierarchical data?
You want to visualize data that has multiple levels, such as country > state > city. Which visualization type is best suited for this?
AData table with flat rows for each city.
BSunburst chart showing nested levels of location.
CBar chart showing total counts per country only.
DGauge showing total number of cities.
Attempts:
2 left
💡 Hint
Hierarchical data needs nested visualization.
📝 Syntax
expert
3:00remaining
What error does this Elasticsearch aggregation query produce?
Examine the following aggregation query and identify the error it will cause.
Elasticsearch
{
  "size": 0,
  "aggs": {
    "sales_over_time": {
      "date_histogram": {
        "field": "sale_date",
        "calendar_interval": "1d"
      }
    }
  }
}
ANo error; the query runs successfully and returns daily buckets.
BTypeError: 'date_histogram' requires a numeric field, but 'sale_date' is a date.
CDeprecation warning: 'interval' is deprecated; use 'calendar_interval' or 'fixed_interval' instead.
DRuntimeError: 'size' cannot be zero in aggregation queries.
Attempts:
2 left
💡 Hint
Elasticsearch changed the 'interval' parameter in date_histogram.