Quiz
Scala Quiz - 1
Este quiz tem tempo limite, por isso abre no player de sempre.
Perguntas do quiz (10)
1What is NOT necessarily a property of a monoid ?
- AAssociativity
- BIdentity
- CFunctions map & flatMap
- DClosure
2SBT can execute tasks in parallel ?
- AVerdadeiro
- BFalso
3What is the LEAST true statement for an actor akka ?
- ACommunicates using messages
- BUsed for concurrency management
- CAsynchronous and non-blocking
- DUsed for parallel programming
4Future.successful(10)
Future.successful(20)
The above mentioned 2 futures run on two different threads ?- AVerdadeiro
- BFalso
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 ?- AmySeqMap = List(How, are, you, doing)
mySeqFlatMap = List(Hello, world, doing, soon) - BmySeqMap = List(List(How, are, you, doing))
mySeqFlatMap = List(Hello, world, doing, soon) - CmySeqMap = List(Hello, world, doing, soon)
mySeqFlatMap = List(List(How, are, you, doing)) - DmySeqMap = List(List(How, are, you, doing))
mySeqFlatMap = List(Hello, world, doing, are, you, soon)
- AmySeqMap = List(How, are, you, doing)
6case class People(name: String, age: Int)
val people1 = People("Jon", 30)
val people2 = People("Jon", 30)
people1 == people2 ?- AVerdadeiro
- BFalso
7A FUNCTOR must have ?
- Amap function
- BflatMap function
- Cmap and flatMap both
- Dnone of the above
8trait F[+A] {
def {...}
}
What does +A represent ?- AUpper bound
- BContravariant type parameter
- CCovariant type parameter
- DLower bound
9What's a closure ?
- AA function whose return value depends upon a variable declared outside of that function
- BA function that takes another function as an argument
- CA function that returns a function as argument
- DA function that returns a future
10Which of the following statements about a scala Either are true (multiple responses possible) ?
- AIt has two subtypes Left and Right
- BLeft represents success case and Right represents error case
- CLeft represents error case and Right represents success case
- DBoth Left and Right are case classes
Informações
- Descrição
- The 1st scala quiz for Scala.IO
- Autor
- himanshu arora
- Idioma
- English
- Visualizações
- 282
- Etiquetas
- Avaliação
- Ainda sem avaliações Avalie este quiz