Programming with Scala MCQs Solution | TCS Fresco Play


Programming with Scala MCQs Solution | TCS Fresco Play

Programming with Scala MCQs Solution | TCS Fresco Play

Disclaimer: The primary purpose of providing this solution is to assist and support anyone who are unable to complete these courses due to a technical issue or a lack of expertise. This website's information or data are solely for the purpose of knowledge and education.

Make an effort to understand these solutions and apply them to your Hands-On difficulties. (It is not advisable that copy and paste these solutions).

All Question of the MCQs Present Below for Ease Use Ctrl + F with the question name to find the Question. All the Best!

1. Which of the following are the key concepts of Functional Programming a. Immutability b. Pure functions c. Inheritance d. Referential Transparency .


2. Functional programming language cannot be an object oriented language too (True/False)

3. Scala is a pure functional programming language (True/False)

4. You can modify an immutable object once created (Yes/No)

5. Can the following pseudo function be considered a pure function ? function getMeTimeAdded(arg Integer) = currentTime + Integer

6. For the given statement, val s = List(1,2,3)
What would be the type of s?

7. Is this a valid expression val f: Int = (x: Int) => x + 1

8. What is the preferred qualifier for defining a variable in Scala.

9. What would be the output of following snippet
val s = List(1,2,3,4)
val t = List(5,6,7,8)
val n = s ++ t
.......List(1, 2, 3, 4, 5, 6, 7, 8)

10. What is the default class List is imported from ?

11. What would be the output of following code snippet.
val l = List(1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 5, 5, 8)

12. AnyVal is best type of all primitive data types

13. Scala supports only single inheritance

14. Scalability is an important trait of a functional programming language?

15. Consider the following code snippet
def prnt = {print("scala"); 1}
def fun(a:Int,b: => Int) = print(a)

16. What will be the output for function call fun(prnt,5)?

17. Is this operation valid
var s = "String 1"
s = "String 2"

18. Which of the following programming paradigm does Scala support?
All the above

19. Scala classes can contain static members

20. AnyVal is best type of all primitive data types

21. Which of the following type allows only single instance to exist in global scope

22. Which of the following cannot have a constructor

23. Functions are first class objects in function programming

24. Consider the following code snippet (a: Int) => a*a. Above code snippet is an example of anonymous function. Which one is the correct expression?
val f = (x: Int) => x + 1

25. Expressions in Scala evaluated using method called?

26. Scala compiler will compile the following expression successfully
val s: Int = 5.5

27. Which all frameworks are developed using Scala

28. Object keyword is used to define a singleton class in Scala

29. Given the following snippet, what would be the output
val l = List(1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 5, 5, 8)
................List(3, 5, 5, 8)

30. Which of the following expression has side effect
var y = 0; def Inc = y=y+1

31. Which of the following feature in Java resembles trait in Scala
abstract class

32. Scala can be run only on JVM.

33. Singleton is created in Scala using keyword

34. In functional programming language functions can be
can only be passed as call by value.....can pass as an argument
Singleton object in Scala can be made executable
by extending App or with the main function
Scala has immutable collections

35. What would be the output of this code
val n = List(1,2,3,4,5)
println( % 2))
............List(1, 0, 1, 0, 1)

36. Mentioning function return type is optional in Scala

37. Mathematical functions are best implemented in?
functional programming language

Credit for the above notes, goes to the respective owners. 

If you have any queries, please feel free to ask on the comment section.
If you want MCQs and Hands-On solutions for any courses, Please feel free to ask on the comment section too.

Please share and support our page!

Post a Comment

Post a Comment (0)

#buttons=(Accept !) #days=(20)

Our website uses cookies to enhance your experience. Learn More
Accept !

Join Telegram Channel

Join MNCAnswers To Get Instant Updates

Join Telegram Channel