Scala Quiz | 5 Min Challenge for Scala Programming

1. Scala Quiz

After studying all the Scala Tutorial, now you are ready to face this Scala Quiz Challenge. This Scala Quiz will help you to boost your Scala knowledge and helps to prepare for Scala interview.

Each question of Scala Quiz is of multiple type questions (Scala MCQ’s) and contains relevant links a below, to get more information about Scala Programming Language.

Scala Quiz

Scala Quiz | 5 Min Challenge for Scala Programming

ALL THE BEST!! For Scala Quiz

Q.1. Without an explicit import, maps in Scala are by default:

Correct! Wrong!

Q.2. Functions and numbers are objects in Scala.

Correct! Wrong!

Q.3. Every class in Scala inherits from a super class. Implicitly, this is scala.AnyRef.

Correct! Wrong!

Q.4. What is Scala’s programming paradigm?

Correct! Wrong!

Q.5. We can have static members in classes.

Correct! Wrong!

Q.6. Scala is case-insensitive. Identifiers Name and name are the same things.

Correct! Wrong!

Q.7. What does type inference mean?

Correct! Wrong!

Q.8. Omitting a semicolon(;) at the end of a statement causes the compiler to throw an error.

Correct! Wrong!

Q.9. UNIT is a data type in Scala. It pertains to no meaningful information.

Correct! Wrong!

Q.10. Which of the following statements are true about Lists and Arrays?

Correct! Wrong!

Q.11. A class inheriting from a trait and implementing its interface inherits all code in it.

Correct! Wrong!

Q.12. Consider the following statements about vals and vars. Select the ones that are true.

Correct! Wrong!

Q.13. How do you turn the string “batmanstein” to the string “Man”?

Correct! Wrong!

Q.14. A closure is:

Correct! Wrong!

Q.15. We use the following keyword to define a function in Scala:

Correct! Wrong!

Q.16. Select the correct statements for Nil, Null, None, and Nothing.

Correct! Wrong!

Q.17. What is a monad in Scala?

Correct! Wrong!

Q.18. Select the true statements about iterators.

Correct! Wrong!

Q.19. We do not need to pass these parameters to a method when calling it:

Correct! Wrong!

Q.20. What is a type class in Scala?

Correct! Wrong!

We hope, you give all correct answers to this Scala Quiz. Have you enjoyed the Scala Quiz? Share your feedback with us!

Play Our Next Scala Quiz – Scala Tricky Quiz

5 Responses

  1. jefferson says:

    Q.17. How do you turn the string “batmanstein” to the string “Man”?
    b. “batmanstein”.drop(3).take(3).capitalize
    d. “batmanstein”.drop(3).capitalize.take(3)
    b and d are correct

    • DataFlair Team says:

      Hi Jefferson,
      Thanks for the observation for Scala quiz. We already made the necessary changes.\
      Keep exploring DataFlair

  2. Paresh says:

    Q.13. Select the statements that will successfully compile and run:
    a. val msg:String = "Testing" println(msg+" a horse ");
    b. var msg="Testing" println(msg+" a test")
    c. var msg="Testing" println("msg is :"+(msg=msg+" " +msg)
    d. All of the above

    What will be output, Can you give me explanation..!

    • DataFlair Team says:

      Hello Paresh,
      Nice Catch!
      Thanks for pointing out our typo mistake in this Scala Quiz. We make all the necessary changes. Now, all the statements will execute successfully.
      Regards,
      DataFlair

  3. Archana says:

    Q.19. What does the variable x hold in the following code:
    var x,y,z=(1,2,3)
    Correct answer should be 1

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.