Epic Skills Assessment Epic Skills Assessment Fictional Programming Language Logic Questions and Answers 2 — Questions and Answers
Question 1: In a fictional programming language, the operator '~~' reverses a string. What is the output of ~~"EPIC"?
- CIPE (Correct answer)
- EPCI
- PICE
- ICEP
Correct answer: CIPE
The ~~ operator reverses the string "EPIC" to produce "CIPE".
Question 2: A fictional language uses 'GRAB x FROM y' to extract element x from array y. If y = [10, 20, 30, 40], what does GRAB 3 FROM y return assuming 1-based indexing?
- 30 (Correct answer)
- 20
- 40
- 10
Correct answer: 30
With 1-based indexing, position 3 in the array [10, 20, 30, 40] is 30.
Question 3: In a fictional language, 'MORPH(a, b)' returns a new value where each digit of a is increased by b mod 10. What is MORPH(123, 5)?
- 678 (Correct answer)
- 628
- 173
- 579
Correct answer: 678
Each digit is increased by 5 mod 10: 1+5=6, 2+5=7, 3+5=8, producing 678.
Question 4: A fictional language defines 'FUSE(x, y)' as interleaving characters of two equal-length strings. What is FUSE("AB", "12")?
- A1B2 (Correct answer)
- AB12
- 1A2B
- 12AB
Correct answer: A1B2
FUSE interleaves characters alternately: A, 1, B, 2, resulting in "A1B2".
Question 5: In a fictional language, 'SIFT(arr, condition)' removes elements that meet the condition. What does SIFT([5, 12, 3, 18, 7], >10) return?
- [5, 3, 7] (Correct answer)
- [12, 18]
- [5, 12, 3, 18, 7]
- [3, 7]
Correct answer: [5, 3, 7]
SIFT removes elements greater than 10 (12 and 18), leaving [5, 3, 7].
Question 6: A fictional language uses 'CHAIN(f, g)(x)' to apply g first, then f. If f(x) = x + 3 and g(x) = x * 2, what is CHAIN(f, g)(4)?
- 11 (Correct answer)
- 14
- 10
- 22
Correct answer: 11
First g(4) = 8, then f(8) = 11, so CHAIN(f, g)(4) = 11.
In a fictional programming language, the operator '~~' reverses a string.
What is the output of ~~"EPIC"?