A function that takes another function as argument
A function that returns a function
Any of the above two
None of above
Question 2
Question
Which of the following is most adapted for parallel processing ?
Answer
Akka Actors
Scala Futures
Scala Options
Scala Either
Question 3
Question
val result = for {
x <- Future(20)
y <- Future(10) if y > 10
} yield x + y
what's the value of result ?
Answer
Success(30)
30
Failure
Question 4
Question
Which one is FALSE about an actor akka ?
Answer
Can communicate with an actor using tell function
Can communicate with an actor using ask pattern
Messages can be passed to an actor using ActorRef handle of that actor
Messages can be passed to an actor using Actor instance of that actor
Question 5
Question
A monad is a functor which also has a flatMap ?
Answer
True
False
Question 6
Question
What's NOT true about a type class in scala ?
Answer
It enables ad hoc polymorphism
It uses implicts, implicitly and bound context syntax
Addition of a new functionality in type class can be done without any changes to the original code
Type class is an abstract class
Question 7
Question
SBT performs incremental recompilations ?
Answer
True
False
Question 8
Question
val mySeq = Seq("Hello world", "Hello how are you", "Are you well", "Hello guys")
val result = mySeq.flatMap(_.split(" ")).map(_.length).filter(v => v < 4).reduce(_ + _)
What's result ?
Answer
28
43
15
None of the above
Question 9
Question
trait F[-A] {
}
What does -A represent ?
Answer
Covariant type parameter
Contravariant type parameter
Lower bound
Upper bound
Question 10
Question
Choose right responses for a partial function (multiple responses possible)
Answer
A PartialFunction must provide a method isDefinedAt
A PartialFunction must provide a method apply
Can be lifted to a normal function with return type wrapped in an option
Akka actor's receive method is not an example of partial function