โ† All Epic Skills Assessment Flashcard Decks

Fictional Programming Language Logic Flashcards

7 cards from real Epic Skills 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 Fictional Programming Language Logic flashcards as text
  1. In FictoScript, the `freeze` function applied to a list will:

    Answer: Make the list immutable so no elements can be added, removed, or changed

    `freeze` locks a data structure, making any subsequent mutation attempts raise a FrozenError.

  2. Which FictoScript feature allows a single function name to behave differently based on argument types?

    Answer: Overloading via `fn/type` dispatch

    FictoScript supports type-based dispatch by defining multiple `fn/type` signatures under the same function name.

  3. A FictoScript `lazy val` is evaluated:

    Answer: Only the first time it is accessed, then cached

    `lazy val` defers computation until first use, then memoizes the result so subsequent accesses are instant.

  4. In FictoScript, what does `filter(fn(x) => x mod 2 == 0, [1, 2, 3, 4, 5, 6])` return?

    Answer: [2, 4, 6]

    `filter` keeps only elements where the predicate returns true; here, even numbers pass the `mod 2 == 0` check.

  5. FictoScript's `trait` keyword is most similar to which concept in other languages?

    Answer: An interface or mixin that defines behavior a type must implement

    A `trait` defines a set of method signatures (and optionally default implementations) that types can adopt.

  6. What is the purpose of FictoScript's `seal` keyword applied to a module?

    Answer: Prevents external modules from extending or overriding the module's definitions

    A `seal`ed module cannot have its definitions monkey-patched or extended by other modules, ensuring stability.

  7. In FictoScript, if a `loop` body contains `break(42)`, what happens?

    Answer: The loop exits and the entire loop expression evaluates to 42

    FictoScript loops are expressions; `break(value)` exits the loop and returns that value as the loop's result.