Courseiva
Management and OperationsmediumMultiple SelectObjective-mapped

DBS-C01 Management and Operations Practice Question

A company is using Amazon DynamoDB for a gaming application. The application stores player scores in a table with a partition key of player_id and a sort key of timestamp. The company wants to query the top 10 scores for a given player efficiently. Which TWO steps should the company take to optimize this query?

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Use the Query API with the LSI and scan index forward set to false to get the top scores.

The correct answers are A and B. A local secondary index (LSI) on the score attribute (option B) allows efficient sorting of items within the same partition key (player_id) by score. Using the Query API on this LSI with scanIndexForward set to false (option A) retrieves the top scores in descending order. Option C (Scan with filter) is inefficient as it reads the entire table. Option D (LSI on timestamp) is redundant because the base table already has timestamp as sort key and does not sort by score. Option E (GSI on score) would not be efficient for per-player queries because you would need to query by score globally, not per player.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Use the Query API with the LSI and scan index forward set to false to get the top scores.

    Why this is correct

    Querying the LSI with ScanIndexForward=false returns items in descending order, efficiently retrieving the top scores.

  • Create a local secondary index (LSI) on the score attribute with the same partition key.

    Why this is correct

    An LSI allows efficient querying and sorting by score within a player's partition.

  • Use a Scan operation with a filter expression to retrieve the top scores.

    Why it's wrong here

    Scan is inefficient and consumes many read capacity units.

  • Create a local secondary index on the timestamp attribute.

    Why it's wrong here

    The timestamp is already a sort key; an LSI on timestamp would not help sort by score.

  • Create a global secondary index (GSI) on the score attribute.

    Why it's wrong here

    A GSI would partition by score, not by player_id, so it would not efficiently retrieve top scores per player.

About these practice questions

One of 1,663 original DBS-C01 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This DBS-C01 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DBS-C01 exam.