Download our latest MNC Answers Application at Play Store. Download Now

Scala Constructs 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)

7. What would be the type of s?


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


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


10. 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)

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


12. 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)



13. AnyVal is best type of all primitive data types


14. Scala supports only single inheritance


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


16. Consider the following code snippet

def prnt = {print("scala"); 1}

def fun(a:Int,b: => Int) = print(a)

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


18. Is this operation valid

var s = "String 1"



s = "String 2"


19. Which of the following programming paradigm does Scala support?

All the above

20. Scala classes can contain static members


21. AnyVal is best type of all primitive data types


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


23. Which of the following cannot have a constructor


24. Functions are first class objects in function programming


25. Consider the following code snippet (a: Int) => a*a. Above code snippet is an example of

anonymous function

26. Which one is the correct expression?

val f = (x: Int) => x + 1

27. Expressions in Scala evaluated using method called?


28. Scala compiler will compile the following expression successfully

val s: Int = 5.5


29. Which all frameworks are developed using Scala


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


31. 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)

32. Which of the following expression has side effect

var y = 0; def Inc = y=y+1

33. Which of the following feature in Java resembles trait in Scala

abstract class

34. Scala can be run only on JVM.


35. Singleton is created in Scala using keyword


36. In functional programming language functions can be

can only be passed as call by value.....can pass as an argument

37. Singleton object in Scala can be made executable

by extending App or with the main function

38. Scala has immutable collections


39. What would be the output of this code

val n = List(1,2,3,4,5)

println( % 2))

............List(1, 0, 1, 0, 1)

40. Mentioning function return type is optional in Scala


41. Mathematical functions are best implemented in?

functional programming language

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!