โ† All CodeSignal Technical Assessment Flashcard Decks

Domain-Specific Knowledges Flashcards

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

Read the first 7 Domain-Specific Knowledges flashcards as text
  1. In object-oriented programming, what is the difference between composition and inheritance?

    Answer: Composition models 'has-a' relationships by embedding objects; inheritance models 'is-a' relationships via subclassing

    Composition delegates behavior to contained objects (has-a), while inheritance acquires behavior from a parent class (is-a), and composition is generally preferred for flexibility.

  2. Which tree traversal visits nodes in ascending order for a Binary Search Tree?

    Answer: In-order (left, root, right)

    In-order traversal of a BST visits the left subtree, then the root, then the right subtree, yielding keys in sorted ascending order.

  3. Which HTTP caching header tells the browser the maximum number of seconds a response may be cached before revalidation?

    Answer: Cache-Control: max-age

    Cache-Control: max-age=N directs caches to consider the response fresh for N seconds from the time it was received.

  4. What is the output of `print(0.1 + 0.2 == 0.3)` in Python?

    Answer: False

    IEEE 754 floating-point representation cannot exactly represent 0.1 or 0.2, so their sum slightly exceeds 0.3, making the equality check False.

  5. In software testing, what does 'code coverage' measure?

    Answer: The percentage of source code lines or branches exercised by a test suite

    Code coverage reports which lines, branches, or paths are executed during tests, helping identify untested portions of the codebase.

  6. Which data structure is most appropriate for implementing a priority queue?

    Answer: Binary Heap

    A binary heap provides O(log n) insertion and O(log n) extraction of the minimum (or maximum), making it the standard backing structure for priority queues.

  7. In OAuth 2.0, what is the purpose of an 'access token'?

    Answer: It is a credential that grants the bearer limited access to protected resources on behalf of the resource owner

    An access token is a short-lived credential issued by the authorization server that an API uses to grant scoped access without exposing user credentials.