Scala For Big Data Set 2
Free Online Best Scala For Big Data MCQ Questions for improve your basic knowledge of Scala For Big Data. This Scala For Big Data set 2 test that contains 25 Multiple Choice Questions with 4 options. You have to select the right answer to a question.
Start
Congratulations - you have completed Scala For Big Data Set 2.
You scored %%SCORE%% out of %%TOTAL%%.
Your performance has been rated as %%RATING%%
Your answers are highlighted below.
Question 1 |
Select the correct output___
val cool=Map(“a”->”aaa”, “b”->”bbb”, “a”->”ccc”)
println(cool(“a”))
A | "a" |
B | "aaa" |
C | "bbb" |
D | "ccc" |
Question 2 |
The following technique/construct lets us transform a function with multiple arguments into a chain of functions____
A | Extractors |
B | Traits |
C | Trait mixins |
D | Currying |
Question 3 |
Select the Scala construct that holds pairwise different elements of the same type_____
A | Sets |
B | Groups |
C | Forums |
D | Maps |
Question 4 |
Which of the following statements is untrue about a functor in Scala?
A | It is a mapping between categories |
B | It is a built-in construct in Scala |
C | It maps objects or entities of one category to those of another |
D | All of the above |
Question 5 |
Select the correct output:
val numbers=List(11,22,33)
var total=0
for(i<-numbers){
total+=I
}
println(total)
A | 33 |
B | 22 |
C | 11 |
D | 66 |
Question 6 |
Decide what the following code prints___
val odds=List(3,5,7)
var result=1
odds.foreach((num:Int)=>result*=num)
println(result)
A | 1 |
B | 105 |
C | List(105) |
D | List(3,5,7) |
Question 7 |
Which is the correct value of the following expression?
List(1,2,3)flatMap(x=>List(x,4))
A | List(1,2,3,4) |
B | List(1,4,2,4,3,4) |
C | List(4,4,4) |
D | List (1,2,3,x,4) |
Question 8 |
Choose the correct output__
object Dog{
def bark=”woof”
}
A | It prints “woof” |
B | It prints nothing |
C | It raises an exception |
D | None of the above |
Question 9 |
Scala is also a_____
A | Style Sheets Language |
B | Scripting Language |
C | Cloud Computing Language |
D | All of the above |
Question 10 |
Which of the following statements are true about Either?
A | It is a sealed abstract class |
B | We can use it to deal with possible missing values |
C | An instance of Either can be an instance of Left or Right |
D | All of the above |
Question 11 |
Select appropriate output___
def quadruple(x:Int):Int=x*4
val quadrupleCopy=quadruple _
println(quadrupleCopy(-1))
A | -4 |
B | 4 |
C | 20 |
D | The code throws an error |
Question 12 |
Select the correct output for the following code_____
var band={
var name=”sublime”
name
}
println(name)
A | It prints “sublime” |
B | It prints nothing |
C | The code raises an error |
D | syntax error |
Question 13 |
Select the true statements from the following____
A | All of the above |
B | A Future is an object |
C | A Future holds a value that may become available at a later point in time |
D | We can complete a promise only once |
Question 14 |
Is the following function pure?
def change:Unit={
x=x+10
}
A | It is pure |
B | It is not pure |
C | can not say |
D | some time |
Question 15 |
Choose the correct output for the following code____
val x:Option[String]=Some(“hi”)
println(x.get)
A | This prints Some(“hi”) |
B | This prints nothing |
C | The code throws an error |
D | This prints “hi” |
Question 16 |
Which of the following is true about Scala and Java?
A | Both work with popular IDEs like Eclipse, Netbeans, and IntelliJ |
B | Both run on the JVM |
C | We can call Scala from Java and Java from Scala |
D | All of the above |
Question 17 |
Looking at the previous code, can you predict the output of the following code?
val stuff=collection.mutable.Buffer(“blue”)
stuff+=44
println(stuff)
A | ArrayBuffer(blue, 44) |
B | ArrayBuffer(blue) |
C | Something else |
D | The code throws an error |
Question 18 |
Select the correct value specified by the following line of code____
“abcde” ensuring (_.length>3)
A | abc |
B | abcd |
C | abcde |
D | The code throws an error |
Question 19 |
Scala is a portmanteau for____
A | Scalar and Language |
B | Script and Language |
C | Sequential and Language |
D | Scalable and Language |
Question 20 |
What does this code print?
var y:Option[String]=None
y.get
A | This prints None |
B | This prints nothing |
C | This throws an exception |
D | None of the above |
Question 21 |
Its Java compatibility makes Scala suitable for____
A | Android Development |
B | Apple Development |
C | Microsoft Development |
D | Google Development |
Question 22 |
Select the correct output for the following code____
object Flash{
def superpower=”speed”
}
A | This prints “speed” |
B | This prints nothing |
C | This throws an error |
D | None of the above |
Question 23 |
How do you abruptly stop execution in the REPL?
A | Pressing Ctrl+C |
B | Pressing Ctrl+Q |
C | Pressing Ctrl+W |
D | All of the above |
Question 24 |
Select the correct output for the following code__
val leaders=collection.mutable.Buffer(“Reykon”)
leaders+=”obama”
println(leaders)
A | ArrayBuffer(Reykon, Obama) |
B | ArrayBuffer(Reykon) |
C | List(Reykon, obama) |
D | The code throws an error |
Question 25 |
For which kind of data should you use a case class?
A | Mutable data |
B | Immutable data |
C | both a and b |
D | None of the above |
Once you are finished, click the button below. Any items you have not completed will be marked incorrect.
Get Results
There are 25 questions to complete.
← |
List |
→ |
Return
Shaded items are complete.
1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 |
End |
Return
You have completed
questions
question
Your score is
Correct
Wrong
Partial-Credit
You have not finished your quiz. If you leave this page, your progress will be lost.
Correct Answer
You Selected
Not Attempted
Final Score on Quiz
Attempted Questions Correct
Attempted Questions Wrong
Questions Not Attempted
Total Questions on Quiz
Question Details
Results
Date
Score
Hint
Time allowed
minutes
seconds
Time used
Answer Choice(s) Selected
Question Text
All done
Need more practice!
Keep trying!
Not bad!
Good work!
Perfect!