Scala Quiz - 1

Descripción

The 1st scala quiz for Scala.IO
himanshu arora
Test por himanshu arora, actualizado hace más de 1 año
himanshu arora
Creado por himanshu arora hace más de 6 años
258
0

Resumen del Recurso

Pregunta 1

Pregunta
What is NOT necessarily a property of a monoid ?
Respuesta
  • Associativity
  • Identity
  • Functions map & flatMap
  • Closure

Pregunta 2

Pregunta
SBT can execute tasks in parallel ?
Respuesta
  • True
  • False

Pregunta 3

Pregunta
What is the LEAST true statement for an actor akka ?
Respuesta
  • Communicates using messages
  • Used for concurrency management
  • Asynchronous and non-blocking
  • Used for parallel programming

Pregunta 4

Pregunta
Future.successful(10) Future.successful(20) The above mentioned 2 futures run on two different threads ?
Respuesta
  • True
  • False

Pregunta 5

Pregunta
val 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 ?
Respuesta
  • mySeqMap = List(How, are, you, doing) mySeqFlatMap = List(Hello, world, doing, soon)
  • mySeqMap = List(List(How, are, you, doing)) mySeqFlatMap = List(Hello, world, doing, soon)
  • mySeqMap = List(Hello, world, doing, soon) mySeqFlatMap = List(List(How, are, you, doing))
  • mySeqMap = List(List(How, are, you, doing)) mySeqFlatMap = List(Hello, world, doing, are, you, soon)

Pregunta 6

Pregunta
case class People(name: String, age: Int) val people1 = People("Jon", 30) val people2 = People("Jon", 30) people1 == people2 ?
Respuesta
  • True
  • False

Pregunta 7

Pregunta
A FUNCTOR must have ?
Respuesta
  • map function
  • flatMap function
  • map and flatMap both
  • none of the above

Pregunta 8

Pregunta
trait F[+A] { def {...} } What does +A represent ?
Respuesta
  • Upper bound
  • Contravariant type parameter
  • Covariant type parameter
  • Lower bound

Pregunta 9

Pregunta
What's a closure ?
Respuesta
  • A function whose return value depends upon a variable declared outside of that function
  • A function that takes another function as an argument
  • A function that returns a function as argument
  • A function that returns a future

Pregunta 10

Pregunta
Which of the following statements about a scala Either are true (multiple responses possible) ?
Respuesta
  • It has two subtypes Left and Right
  • Left represents success case and Right represents error case
  • Left represents error case and Right represents success case
  • Both Left and Right are case classes
Mostrar resumen completo Ocultar resumen completo

Similar

CCNA Security 210-260 IINS - Exam 3
Mike M
Application of technology in learning
Jeff Wall
Innovative Uses of Technology
John Marttila
Ch1 - The nature of IT Projects
mauricio5509
The Internet
Gee_0599
SQL Quiz
R M
CCNA Answers – CCNA Exam
Abdul Demir
Professional, Legal, and Ethical Issues in Information Security
mfundo.falteni
System Analysis
R A
Flash Cards Networks
JJ Pro Wrestler
EDUC260- Multimodal Literacies for a Digital Age
angelwoo2002