โ† All Mettl Flashcard Decks

Coding Skills Flashcards

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

Read the first 7 Coding Skills flashcards as text
  1. Which of the following correctly describes a hash collision?

    Answer: Two different keys produce the same hash value

    A collision occurs when two distinct keys hash to the same index in the table.

  2. What is the worst-case space complexity of recursive quicksort due to call stack usage?

    Answer: O(n)

    In the worst case (already sorted input), quicksort recurses n times, using O(n) stack space.

  3. In Java, which keyword prevents a method from being overridden in a subclass?

    Answer: final

    Declaring a method 'final' prevents subclasses from overriding it.

  4. What does a REST API use to indicate that a resource was successfully created?

    Answer: HTTP 201 Created

    HTTP 201 Created is the standard response for a successful POST that creates a new resource.

  5. Which of the following is NOT a valid way to declare a variable in JavaScript (ES6+)?

    Answer: def x = 5;

    'def' is used in Python, not JavaScript; valid JS declarations use var, let, or const.

  6. What is memoization primarily used for in programming?

    Answer: Caching results of expensive function calls to avoid redundant computation

    Memoization stores previously computed results so repeated calls with the same input return instantly.

  7. In Git, what does `git stash` do?

    Answer: Temporarily shelves uncommitted changes so the working directory is clean

    git stash saves dirty working directory changes onto a stack so you can switch contexts cleanly.