Scala Online Test | A Secret Box of Knowledge

1. Scala Online Test

After practicing Scala Quiz, we come up with a tricky Scala Online Test. This Scala Online Test has a more interesting MCQ’s for Scala Programming.

Before we start Our Scala online test let’s revise Scala Tutorial, for reference.

Scala Online Test | A Secret Box of Knowledge

Scala Online Test | A Secret Box of Knowledge

Scala Online Test – BEST OF LUCK!! 

Q.1 sbt is an open-source build tool for Scala and Java projects. Can it execute tasks in parallel?

Correct! Wrong!

Q.2 Which of the following statements is untrue about a functor in Scala?

Correct! Wrong!

Q.3 Select the true statements from the following:

Correct! Wrong!

Q.4 Left and Right are case classes. True or False?

Correct! Wrong!

Q.5 Which of the following statements are true about Either?

Correct! Wrong!

Q.6 What Boolean value do the following statements return?
case class People(name:String,age:Int)
val people1=People("Ayushi",22)
val people2=People("Ayushi",22)
people1==people2

Correct! Wrong!

Q.7 Select the correct output for the following code:
val leaders=collection.mutable.Buffer("Reykon")
leaders+="obama"
println(leaders)

Correct! Wrong!

Q.8 Looking at the previous code, can you predict the output of the following code?
val stuff=collection.mutable.Buffer("blue")
stuff+=44
println(stuff)

Correct! Wrong!

Q.9 Which of the following function definitions are erroneous?

Correct! Wrong!

Q.10 Scala is also a:

Correct! Wrong!

Join DataFlair on Telegram

Q.11 Of the following, select the Scala construct that holds pairwise different elements of the same type.

Correct! Wrong!

Q.12 Select the correct value specified by the following line of code:
"abcde" ensuring (_.length>3)

Correct! Wrong!

Q.13 Which is the correct value of the following expression?
List(1,2,3)flatMap(x=>List(x,4))

Correct! Wrong!

Q.14 For which kind of data should you use a case class?

Correct! Wrong!

Q.15 The following technique/construct lets us transform a function with multiple arguments into a chain of functions. Each of these has one single argument.

Correct! Wrong!

Q.16 How do you abruptly stop execution in the REPL?

Correct! Wrong!

Q.17 Which of the following is true about Scala and Java?

Correct! Wrong!

Q.18 Scala is a portmanteau for:

Correct! Wrong!

Q.19 Its Java compatibility makes Scala suitable for:

Correct! Wrong!

Q.20 A collection of type collection.Seq is immutable.

Correct! Wrong!

Have you enjoyed the Scala Quiz? Share your feedback with us through comment box!

Try our new Scala Quiz that contains important questions of Scala

2 Responses

  1. Konstantin says:

    I think you have this one backwards.

    Q.20 A collection of type collection.Seq is immutable.
    True
    Correct Answer: False

  2. DataFlair Team says:

    Hi Konstantin,
    Thanks for the observation, we have corrected the answer. You can refer our next Scala Quiz for more questions.
    Regards,
    DataFlair

Leave a Reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.