Search Header Logo

functional quiz 1.2

Authored by Azamat Leskhan

Computers

University

Used 80+ times

functional quiz 1.2
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

18 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is pattern matching?

a functionality that checks if a objects is an examplar of some particular class

tool that makes reccursion easier

alternative to if-else expressions

a technique where you test an expression to determine if it has certain characteristics

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a case class?

classes that cannot have fields

implementatoin of the inheritance concept in Scala programming language 

classes that are required to inherite a class or implement an interface

immutable classes that can be decomposed via pattern matching

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Why generics are important?

They generilize type that is used inside of a class

generalization of several modules that work similarly

generlization of a group of functions

?

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

During pattern matching, possible case classes are determined in compile time

true

false

neither

both

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a function of a map function?

Transform every member of collection in accordance to a function provided

Square every element in a list

check if element in a list

higher order function that create all possible combinations of elements in a list

function that create an object that describes collection of key-value pairs

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a correct implementation of a map function for class below:

class Example[A, B, C](a: A, b: B, c: C)

.

def map(f: (A, B, C) => Example[A, B, C]): Example[A, B, C] = f(a, b, c)

def map[D](f: (A, B, C) => D): D = f(a, b, c)

def map[D](f: (A, B, C) => D, g: A => A, h: B => B, k: C => C): D = f(g(a), h(b), k(c))

true

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the functions below can be used to implement a sum of a list?

filter

map

reduce

adjoin

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?