← All IKM Flashcard Decks

Data Structures and Algorithms Flashcards

7 cards from real IKM practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.

Read the first 7 Data Structures and Algorithms flashcards as text
  1. Which combination of data structures gives O(1) get and put operations for an LRU cache?

    Answer: Hash map and doubly linked list

    The hash map finds nodes in O(1), and the doubly linked list moves or evicts nodes in O(1).

  2. What is the time complexity of the standard dynamic programming solution to the 0/1 knapsack problem with n items and capacity W?

    Answer: O(nW)

    The DP table has n × W cells, and each cell is filled in constant time.

  3. Memoizing a recursive Fibonacci function reduces its time complexity from exponential to what?

    Answer: O(n)

    Each Fibonacci value from 0 to n is computed once and then reused, so the work is linear.

  4. What must be true for binary search to work correctly in O(log n) time?

    Answer: The collection is sorted and supports random access

    Binary search needs sorted order to discard half the range and random access to jump to the middle in O(1).

  5. Which data structure is most natural for checking whether parentheses in an expression are balanced?

    Answer: Stack

    Each closing bracket must match the most recent unmatched opening bracket, which is last-in-first-out behavior.

  6. What is the amortized time per append to a dynamic array that doubles its capacity when full?

    Answer: O(1)

    The total copying cost over n appends is at most about 2n, so each append averages O(1).

  7. What is the time complexity of searching for a key of length m in a trie?

    Answer: O(m)

    A trie lookup follows one edge per character, so the cost depends on key length rather than the number of stored keys.

Written and edited by , founder of Practice Test Geeks, with AI assistance. Exam facts are checked against the official sources linked below. Editorial policy

Sources & references

Exam facts on this page (fees, format, dates, passing scores) are checked against these official sources; the date is our last check. Editorial policy

  1. ikmnet.com — Test delivery, passing score · verified Oct 2026
  2. online.ikmnet.com — Eligibility, exam format, retake policy, score release, time limit · verified Oct 2026