Challenge - 5 Problems
Stats Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
Output of basic stats aggregation
What is the output of this Elasticsearch aggregation query on a dataset with numeric field
price containing values [10, 20, 30, 40]?Elasticsearch
{
"size": 0,
"aggs": {
"price_stats": {
"stats": {
"field": "price"
}
}
}
}Attempts:
2 left
💡 Hint
Remember that
stats aggregation returns count, min, max, avg, and sum for the specified field.✗ Incorrect
The stats aggregation calculates count (4 values), min (10), max (40), avg (25), and sum (100) correctly for the given values.
❓ Predict Output
intermediate2:00remaining
Extended stats aggregation output
Given the following Elasticsearch query on field
score with values [5, 7, 9, 11], what is the output of the extended_stats aggregation?Elasticsearch
{
"size": 0,
"aggs": {
"score_stats": {
"extended_stats": {
"field": "score"
}
}
}
}Attempts:
2 left
💡 Hint
Extended stats include sum_of_squares, variance, and standard deviation with precise floating point values.
✗ Incorrect
The extended_stats aggregation calculates all stats including sum_of_squares (5²+7²+9²+11²=276), variance, and std deviation correctly for the 4 values.
🧠 Conceptual
advanced1:30remaining
Understanding variance calculation in extended_stats
Which statement correctly describes how Elasticsearch calculates variance in the
extended_stats aggregation?Attempts:
2 left
💡 Hint
Elasticsearch uses population variance formula in extended_stats aggregation.
✗ Incorrect
Elasticsearch calculates variance as the average squared difference from the mean dividing by count (population variance), not count minus one.
❓ Predict Output
advanced2:00remaining
Output of extended_stats with missing values
What is the output of this
extended_stats aggregation on field rating with values [4, null, 6, 8] where null is missing?Elasticsearch
{
"size": 0,
"aggs": {
"rating_stats": {
"extended_stats": {
"field": "rating"
}
}
}
}Attempts:
2 left
💡 Hint
Null values are ignored in stats aggregations, so count is less than total values.
✗ Incorrect
Null values are ignored, so count is 3. The stats are calculated only on [4,6,8].
🔧 Debug
expert1:30remaining
Identify the error in this extended_stats aggregation query
What error will Elasticsearch return when running this aggregation query?
Elasticsearch
{
"size": 0,
"aggs": {
"stats_error": {
"extended_stats": {
"field": "nonexistent_field"
}
}
}
}Attempts:
2 left
💡 Hint
Elasticsearch handles missing fields gracefully in aggregations.
✗ Incorrect
If the field does not exist, Elasticsearch returns count 0 and null or zero for other stats without throwing an error.