Scala Quiz - 1

Beschreibung

The 1st scala quiz for Scala.IO
himanshu arora
Quiz von himanshu arora, aktualisiert more than 1 year ago
himanshu arora
Erstellt von himanshu arora vor fast 7 Jahre
258
0

Zusammenfassung der Ressource

Frage 1

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

Frage 2

Frage
SBT can execute tasks in parallel ?
Antworten
  • True
  • False

Frage 3

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

Frage 4

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

Frage 5

Frage
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 ?
Antworten
  • 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)

Frage 6

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

Frage 7

Frage
A FUNCTOR must have ?
Antworten
  • map function
  • flatMap function
  • map and flatMap both
  • none of the above

Frage 8

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

Frage 9

Frage
What's a closure ?
Antworten
  • 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

Frage 10

Frage
Which of the following statements about a scala Either are true (multiple responses possible) ?
Antworten
  • 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
Zusammenfassung anzeigen Zusammenfassung ausblenden

ähnlicher Inhalt

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