GoConqr has a new look! Let us know what you think.

Quiz

Scala Quiz - 1

himanshu arora 10 questions

Take the quiz

This quiz has a time limit, so it opens in the usual player.

Questions in this quiz (10)

  1. 1What is NOT necessarily a property of a monoid ?
    1. AAssociativity
    2. BIdentity
    3. CFunctions map & flatMap
    4. DClosure
  2. 2SBT can execute tasks in parallel ?
    1. ATrue
    2. BFalse
  3. 3What is the LEAST true statement for an actor akka ?
    1. ACommunicates using messages
    2. BUsed for concurrency management
    3. CAsynchronous and non-blocking
    4. DUsed for parallel programming
  4. 4Future.successful(10)
    Future.successful(20)

    The above mentioned 2 futures run on two different threads ?
    1. ATrue
    2. BFalse
  5. 5val mySeq = Seq("Hello world", "How are you doing", "See you soon")
    val mySeqMap = mySeq.map(_.split(" ")).filter(_.length > 3)
    val mySeqFlatMap = mySeq.flatMap(_.split(" ")).filter(_.length > 3)

    What are the possible values of mySeqMap and mySeqFlatMap respectively ?
    1. AmySeqMap = List(How, are, you, doing)
      mySeqFlatMap = List(Hello, world, doing, soon)
    2. BmySeqMap = List(List(How, are, you, doing))
      mySeqFlatMap = List(Hello, world, doing, soon)
    3. CmySeqMap = List(Hello, world, doing, soon)
      mySeqFlatMap = List(List(How, are, you, doing))
    4. DmySeqMap = List(List(How, are, you, doing))
      mySeqFlatMap = List(Hello, world, doing, are, you, soon)
  6. 6case class People(name: String, age: Int)
    val people1 = People("Jon", 30)
    val people2 = People("Jon", 30)

    people1 == people2 ?
    1. ATrue
    2. BFalse
  7. 7A FUNCTOR must have ?
    1. Amap function
    2. BflatMap function
    3. Cmap and flatMap both
    4. Dnone of the above
  8. 8trait F[+A] {
    def {...}
    }

    What does +A represent ?
    1. AUpper bound
    2. BContravariant type parameter
    3. CCovariant type parameter
    4. DLower bound
  9. 9What's a closure ?
    1. AA function whose return value depends upon a variable declared outside of that function
    2. BA function that takes another function as an argument
    3. CA function that returns a function as argument
    4. DA function that returns a future
  10. 10Which of the following statements about a scala Either are true (multiple responses possible) ?
    1. AIt has two subtypes Left and Right
    2. BLeft represents success case and Right represents error case
    3. CLeft represents error case and Right represents success case
    4. DBoth Left and Right are case classes

Information

Description
The 1st scala quiz for Scala.IO
Language
English
Views
282
Rating
No ratings yet
Rate this quiz
Rate this quiz

Feedback

What is it about?

What do you think of the new look?

How do you like it?