Olete.in
Articles
Mock Tests
π§ͺ Scala framework MCQ Quiz Hub
Scala Multiple Choice Questions
Choose a topic to test your knowledge and improve your Scala framework skills
1. Which of the following technology is good for Stream technology?
Apache Spark
Apache Hadoop
Apache Flinkcorrect
None of the above
2. What are the types of scala identifiers?
Alphanumeric identifiers
Operator identifiers
Mixed identifiers
All of these
3. Scala is short form of
Scalable language
Sequential language
Script language
Scalar language
4. This optimizer is based on functional programming construct in A. Java B. Scala C. D. R
Java
Scala
Python
R
5. What is the three main part of Akka streams?
Source, Flow, Sink
Source, Flow, BidirectionalFlow
ReactiveStream, Source, Flow
Stream, Source, Reactive
6. What is the advantage of Scala?
High testability
Provides features of concurrent programming
High scalability
All of these
7. What are the different types of Scala literals?
Character Literalswrong
String Literals
Multi-Line strings
All of the above mentioned
8. How do we implement loops functionally?
Loop Constructs
Mutability
Side Effects
All of the these
9. What are the utility methods used in Scala?
String utility methods
Implicit conversion methods
Assertion utility methods
All of the above
10. 10. Now a days Scala's Java compatibility makes well suited for
Microsoft developmentwrong
Google development
Android developmentcorrect
Apple development
11. In Scala, apply() serves the purpose of closing the gap between Object-Oriented and Functional paradigms
True
False
both (a) and (b)
Error
12. The ___ method is utilized to select an element in the list by its index.
apply()
unapply()
Both A and B
All of the above
13. Without an explicit import, maps in Scala are by default:
Immutable
Mutable
None
None of the above
14. What is Scalaβs programming paradigm?
Statically-Typed
Functional
Object-Oriented
All of these
15. Which of the following not shows how to declare variables of the basic numeric types?
val b: Byte = 1 B.
val s: Short = 1
val f: Float = 3.0
None of the above
16. A list is a collection which contains ___ data.
immutable
mutable
both (a) and (b)
None of the above
17. Which one of the following is a feature of Scala strings?
It can be changed.
It is a mutable object.
It allows creating multiline strings by including the string inside three double quotes.
All of the above
18. How can you format a string?
Val formatted= β%s %iβ.format (mystring.myInt)
Val formatted= β%s %iβ.formatted (mystring.myInt)
Val formatted= β%s %iβ.formatstring(mystring.myInt)
Val formatted= β%s %iβ.formatstrings(mystring.myInt)
19. Scala is designed by _______.
Guido van Rossum
John Von Neumann
Martin Odersky
None of the above
20. Scala runs on the _____ platform.
C
C++
JavaScript
Java
21. ____ is a Scala compiler that compiles to JavaScript.
Scala.py
Scala.js
Scala.tkt
None of the above
22. Scala was released in the year ______.
2002
2004
2003
2005
23. Which among the following is a Scala Web Frameworks?
The Lift Framework
The Bowler framework
The Play framework
All of the above
24. We can execute a Scala program in ______ modes.
interactive mode
script mode
both (a) and (b)
None of the above
25. What are the Scala variables?
val myVal: Int=1
var myVar : Int=0;
both (a) and (b)
None of the above
26. What is Scala?
API
UI development tool
framework
programming language
27. Scala stands for ________.
Scalable language
Script language
Scalar language
Sequential language
28. What are the few collections in Scala?
Array
Sets
List
All of the above
29. Is Scala is Case Sensitive language?
Yes
No
Maybe
Can't say
30. Omitting a semicolon(;) at the end of a statement causes the compiler to throw an error.
Yes
No
May be
Can't say
31. What is Scala used for?
functional programming
strong static systems
both (a) and (b)
None of these
32. Which companies use Scala?
LinkedIn
Twitter
Tumblr
All of the above
33. Scala is written in ________ language
C
Java
Python
C++
34. What is a monad in Scala?
An object that wraps another
A singleton object
A function with a single parameter
None of the above
35. The advantage of Scala are __________.
High scalability
High maintainability and productivity
Less error-prone functional style
All of the above
36. Without an explicit import, maps in Scala are by default _______
Mutable
Immutable
both (a) and (b)
None of the above
37. _____ is used to define a function in Scala
function
def
func
All of the above
38. It is not required to pass these __________ parameters to a method while calling it. D.
Command-line arguments
Default parameters
Implicit parameters
Named arguments
39. Left and Right are case classes.
Yes
No
May be
Can't say
40. Java compatibility makes Scala suitable for _______
Apple Development
Android Development
Google Development
None of the above
41. Select the Scala construct that holds pairwise different elements of the same type
Groups
Sets
Maps
Forums
42. _______ is a Scala compiler that compiles to JavaScript.
Scala.js B.
Scala.py
Scala.tktcorrect
Scala.cppwrong
43. Which one of the following is not a method defined by java.lang.String class?
boolean contentEquals(StringBuffer sb)
String concat(String str)
byte getBytes()
All of the above
44. ____ abstraction from functional programming helps us deal with updating complex immutable nested objects.
Case classes
Lens
Extractors
None of the above
45. Which among the following is a Scala Web Frameworks?
The Play framework
The Lift Framework
The Bowler framework
All of the above
46. How do you abruptly stop execution in the REPL?
Pressing Ctrl+C
Pressing Ctrl+X
Pressing Ctrl+Z
Pressing Ctrl+V
47. The null value is of type _______
scl.Null
scala.n
scala.Null
None of the above
48. How should we end a stream to calculate sum of elements?
Sink.sum_
Sink.fold[Int, Int](0)(_ + _)
Sink.sum[Int](_
Sink.map(_ + _)
49. What is the advantage of Scala?
Less error prone functional style
High maintainability and productivity
High scalability
All of the above
50. When can you use traits?
If the behaviour will not be reused, then make it a concrete class. Anyhow it is not a reusable behaviour
In order to inherit from it in Java code, an abstract class can be used
If efficiency is a priority then lean towards using a class
All of the above
51. Programming language which uses both object-oriented programming and functional programming paradigms is
Scala
Ada
Pascal
Machine language
52. Scala is a short form of
Scalable language
Sequential language
Script language
Scalar language
53. One of the following is an erroneous function definition, can you spot it
def functionName(x:Int,y:Int):Int=x+ywrong
def functionName(x:Int,y:Int):Int={return x+y}
Sets
All of these
54. One of the following is an erroneous function definition, can you spot it
def functionName(x:Int,y:Int):Int=x+ywrong
def functionName(x:Int,y:Int):Int={return x+y}
def functionName(x:Int,y:Int):Int{x+y} ()
def functionName(x:Int,y:Int)={x+y
55. What are three main part of akka streams?
Source, Flow, Sink
Source, Flow, BidirectionalFlow
ReactiveStream, Source, Flow
Stream, Source, Reactive
56. What is Scala?
Programming language
Framework
Platform
None of the above
57. What are the Scala variables?
var myVar : Int=0;
val myVal: Int=1;
both (a) and (b)
None of the above
58. Which one of the following Programming languages uses both object-oriented programming and functional programming paradigms?
Scala
Machine language
Pascal
Ada
59. Scala stands for β____.β
Scalable language
Sequential language
Script language
Scalar language
60. What are the few collections in Scala?
Array
List
Sets
All of the above
61. Which of the following are the IDEs(Integrated Development Environments) for Scala?
IntelliJ IDEA
VS Code
GNU Emacs
All of the above
62. The ___ is a representation of a map of all published Scala libraries.
Scala Library Index
Scaladex
Scala Document
Both A and B
Submit