Courseiva

FC0-U71 Software Development Concepts Practice Question

A developer needs to store a collection of student names and their corresponding grades. The data should be accessed quickly by student name. Which data structure is most appropriate?

⚠ Common exam trap

CompTIA ITF+ often tests the distinction between sequential data structures (arrays, queues, stacks) and associative data structures (dictionaries), trapping candidates who confuse 'ordered collection' with 'keyed access'.

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

✓

Dictionary

A dictionary (also known as a hash map or associative array) stores key-value pairs, allowing O(1) average-time lookups by key. Since the developer needs to access grades quickly by student name, the dictionary's hashing mechanism directly maps each name to its corresponding grade, making it the most appropriate choice.

Answer analysis

Option-by-option breakdown

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

  • ✗

    Array

    Why it's wrong here

    An array indexes elements by numeric position, so retrieving a grade by student name requires a linear search rather than direct lookup. It is tempting because arrays suit ordered lists traversed sequentially, such as storing marks in roll-number order where positional access suffices.

  • ✗

    Queue

    Why it's wrong here

    A queue enforces first-in-first-out ordering, exposing only the head and tail, so no mechanism retrieves a grade by student name. It is tempting because queues correctly model ordered processing, such as print jobs or packet buffers awaiting sequential handling.

  • ✗

    Stack

    Why it's wrong here

    A stack only exposes the most recently pushed element, so retrieving a grade by student name requires popping entries until the match is found. It is tempting because stacks store collections, and one would be correct when the requirement is last-in-first-out processing such as undo operations.

  • ✓

    Dictionary

    Why this is correct

    A dictionary stores key-value pairs, mapping each student name directly to a grade. Hash-based lookup gives average constant-time access by name, satisfying the quick retrieval requirement that a list or array would only meet through linear searching.

About these practice questions

Courseiva writes every FC0-U71 question from scratch — 988 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

1 more way this is tested on FC0-U71

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. A developer is writing a program that stores a collection of unique student IDs. The program needs to quickly look up a student by ID and does not require the IDs to be stored in any particular order. Which data structure is most appropriate for this task?

medium
  • ✓ A.Dictionary
  • B.Queue
  • C.Array
  • D.Stack

Why A: A dictionary (hash map) stores key-value pairs and provides average O(1) lookup by key, which is ideal for quickly retrieving a student record by unique ID. Since the IDs are unique and order does not matter, a dictionary's key uniqueness constraint and fast lookup make it the best fit. Arrays and other sequential structures would require O(n) search unless indexed by a contiguous integer range.

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This FC0-U71 practice question is part of Courseiva's free CompTIA 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 FC0-U71 exam.