The LinkedIn Skill Assessments feature allows you to demonstrate your knowledge of the skills you’ve added on your profile. Job posters on LinkedIn can also add Skill Assessments as part of the job application process. This allows job posters to more efficiently and accurately verify the crucial skills a candidate should have for a role.
The topics in the Scala assessment include:
- Data Structures
- Control Flow
- Object Oriented Programming
- Functional Programming
- Data Types
- Pattern Matching
- Exception Handling
- File I/O
Question Format
Multiple Choice
Language
English
Table of Content
- 1 LinkedIn Scala Skill Assessment Answers
- 1.1 Scala bytecode can run on top of Java VM. What is the fundamental difference between Java object.clone() and Scala object.copy()?
- 1.2 What value does this code return?
- 1.3 What is one way to avoid low-level parallelization details?
- 1.4 What do you use in ScalaTest to see a detailed diagram of error messages when a test fails?
- 1.5 What data type would you use to store an immutable collection of objects that contain a fixed number of varying types?
- 1.6 After defining a function in the interpreter, Scala returns the following. What does the () indicate?
- 1.7 What type of number is 1234.e5?
- 1.8 When you convert a map to a list using the toList method of the map, the result will be of which type?
- 1.9 What type of object does this code create?
- 1.10 Which is a subclass of all classes?
- 1.11 For the for-yield construct, is the scope separate between for-body and yield-body?
- 1.12 What is one way to implement pattern matching on methods?
- 1.13 What is the value of z after executing this code?
- 1.14 What term is used to specify a precondition?
- 1.15 Which Scala type may throw an exception or a successfully computed value, and is commonly used to trap and propagate errors?
- 1.16 What is the data type of y after this code is executed?
- 1.17 When using pattern matching, which character matches on any object?
- 1.18 You have created an array using val. Can you change the value of any element of the array – and why or why not?
- 1.19 What is the output of this function?
- 1.20 What do you call objects with immutable state?
- 1.21 You have written a Scala script. How would you access command-line arguments in the script?
- 1.22 What does this code return?
- 1.23 Which statement returns a success or a failure indicator when you execute this code?
- 1.24 To denote a parameter that may be repeated, what should you place after type?
- 1.25 What is called when a superclass has more than one subclass in Scala?
- 1.26 One way to improve code reliability is to use _ , which will evaluate a condition and return an error if the condition is violated.
- 1.27 Which statement about if-else-if-else statements is true?
- 1.28 What do you call the process of changing the definition of an inherited method?
- 1.29 To denote a parameter that may be repeated, what should you place after the type?
- 1.30 What is the code below equivalent to?
- 1.31 What is an advantage of an immutable object?
- 1.32 You want to create an iteration loop that tests the condition at the end of the loop body. Which iteration would you use?
- 1.33 What can you use to make querying a database more efficient, by avoiding the need to parse the SQL string every time a query is executed from Scala?
- 1.34 Which is not a member of the collections hierarchy?
- 1.35 Which term makes the contents of packages available without prefixing?
- 1.36 If you wanted to find the remainder after division, what operator would you use?
- 1.37 What are defined inside a class definition?
- 1.38 What defines methods and fields that can then be reused by mixing into classes?
- 1.39 When do you need to explicitly state the return type in a function definition?
- 1.40 Why would you make a field private?
- 1.41 What’s the difference between .equals and ==?
- 1.42 What is denotes the intersection between two sets?
- 1.43 What’s the best way to execute code in the background in a separate thread?
- 1.44 What do you call a function defined in a block?
- 1.45 What do you call a Scala method that is parametrized by type as well as by value?
- 1.46 What type of exception is thrown when a precondition is violated?
- 1.47 In scala what is precondition?
- 1.48 What would you change in this code to make it execute in parallel?
- 1.49 What is a free variable?
- 1.50 What is the difference between .equals() and == ?
- 1.51 What’s the best way to execute code in the background in a separate thread?
- 1.52 What value does this code return?
LinkedIn Scala Skill Assessment Answers
Scala bytecode can run on top of Java VM. What is the fundamental difference between Java object.clone() and Scala object.copy()?
- One is a Java object, the other is a Scala object.
- clone() will copy class structures but not the data, while copy() will also copy data into new objects.
- There is no difference.
- copy() allows you to change values during the copying process; clone() does not.
What value does this code return?
val m1 = Map(“a”->1,”b”->2,”c”->3)
m1(“a”)
- a
- 2
- b
- 1
What is one way to avoid low-level parallelization details?
- monads
- literal functions
- partially applied functions
- parallel collections
What do you use in ScalaTest to see a detailed diagram of error messages when a test fails?
- ArgumentExceptions
- AssertionException
- DiagrammedAssertions
- JUnit
What data type would you use to store an immutable collection of objects that contain a fixed number of varying types?
- Array
- ImmutableCollection
- List
- Tuple
After defining a function in the interpreter, Scala returns the following. What does the () indicate?
myfnc: ()Unit
- The function has no side effects.
- The function takes no parameters.
- The function returns no value.
- Returning unit types to the function is a closures.
What type of number is 1234.e5?
- hexadecimal
- short
- floating point
- long
When you convert a map to a list using the toList method of the map, the result will be of which type?
- List[(String, String)]
- List[(Array, Array)]
- List[(Collection, Collection)]
- List
What type of object does this code create?
val x = (1234, “Active”)
- List
- Map
- Tuple
- Array
Which is a subclass of all classes?
- AnyVal
- AnyRef
- Method
- Null
For the for-yield construct, is the scope separate between for-body and yield-body?
- Yes and no. It is different depending on the for construct and what it does.
- Yes, because the for section does not expose its scope.
- No, because for-yield shares the same scope, even though they are within separate curly braces.
- Yes, because they are within different curly braces.
What is one way to implement pattern matching on methods?
- using regex
- using monads
- using string matching
- using case classes
What is the value of z after executing this code?
val y = List(‘a’,’b’)
val z = y::List(‘c’)
- List(a,b,c)
- List(List(a, b), c)
- List(c,a,b)
- List(c,List(a,b))
What term is used to specify a precondition?
- assert
- require
- precondition
- mustHave
Which Scala type may throw an exception or a successfully computed value, and is commonly used to trap and propagate errors?
- scala.util.ExceptionHandling
- scala.Catch.Throw
- scala.exception.TryFinally
- scala.util.Try
What is the data type of y after this code is executed?
val y = (math floor 3.1415 * 2)
- short
- double
- int
- bigInt
When using pattern matching, which character matches on any object?
- %
- _
- ^
- –
You have created an array using val. Can you change the value of any element of the array – and why or why not?
- Yes, the reference to the array is immutable, so the location that the array points to is immutable. The values in the array are mutable.
- The 0th element is immutable and cannot be modified. All other elements can be modified.
- Yes, val does not make arrays immutable.
- No, val makes the array and values of the array immutable.
What is the output of this function?
def main () {
var a = 0
for (a<-1 until 5){println(a)}
- 1,2,3,4,5
- 0,1,2,3,4
- 1,2,3,4
- 2,3,4,5
What do you call objects with immutable state?
- singletons
- stationary objects
- functional objects
- fixed objects
You have written a Scala script. How would you access command-line arguments in the script?
- use array named args
- use tuple named args
- use numbered variables with a _ prefix for example _ 1, _ 2, _ 3
- use numbered variables with a $ prefix – for example $1, $2, $3
What does this code return?
val x = 3; if (x > 2) x = 4 else x = x*2
- 4
- an error
- 6
- 3
Which statement returns a success or a failure indicator when you execute this code?
val MyFuture = Future {runBackgroundFunction() }
- myFuture.onComplete
- myFuture(status)
- myFuture.Finished
- complete(myFuture)
To denote a parameter that may be repeated, what should you place after type?
- %
- &
- _
- –
What is called when a superclass has more than one subclass in Scala?
- polyinheritance
- multilevel inheritance
- multimode inheritance
- hierarchical inheritance
One way to improve code reliability is to use _ , which will evaluate a condition and return an error if the condition is violated.
- packages
- polymorphisms
- assertions
- traits
Which statement about if-else-if-else statements is true?
- If the first else-if does not succeed, then no other else-ifs are tested.
- If an else-if does not succeed, then none of the remaining else-if statements or elses will be tested.
- All else-if statements are tested in all cases.
- If an else-if succeeds, then none of the remaining else-if statements or elses will tested.
What do you call the process of changing the definition of an inherited method?
- recursive methods
- currying methods
- redefining methods
- overriding methods
To denote a parameter that may be repeated, what should you place after the type?
- _
- *
- %
- &
What is the code below equivalent to?
myClass.foreach(println _)
- myClass.foreach(println ())
- myClass.foreach(print NIL)
- myClass.loop(println ())
- myClass.foreach(x => println(x))
What is an advantage of an immutable object?
- Immutable objects use less memory than their mutable counterparts.
- Immutable objects do not require error handling.
- Immutable objects can be used in classes, mutable objects cannot.
- Immutable objects are threadsafe.
You want to create an iteration loop that tests the condition at the end of the loop body. Which iteration would you use?
- do-while loop
- while loop
- for loop
- do-until loop
What can you use to make querying a database more efficient, by avoiding the need to parse the SQL string every time a query is executed from Scala?
- database driver
- connection
- prepared statement
- SQL view
Which is not a member of the collections hierarchy?
- Set
- Seq
- Hash
- Map
Which term makes the contents of packages available without prefixing?
- use
- include
- import
- assertion
If you wanted to find the remainder after division, what operator would you use?
- %
- DIV
- //
- /
What are defined inside a class definition?
- method
- fields and methods
- fields, methods, and packages
- fields
What defines methods and fields that can then be reused by mixing into classes?
- singleton
- assertion
- trait
- monad
When do you need to explicitly state the return type in a function definition?
- when the function has no side effects
- when the function returns a Unit type
- when the function is recursive
- when the function has side effects
Why would you make a field private?
- so only methods in the same file can access the field
- so only methods in the same package can access the field
- so only methods in the same class could access the field
- so only methods defined in a Java class can access the field
What’s the difference between .equals and ==?
- They do the exact same thing
- == won’t work on objects
- == cannot be applied to String
- == is a wrapper of .equals() and checks for nulls
What is denotes the intersection between two sets?
- ||
- &&
- &
- %
What’s the best way to execute code in the background in a separate thread?
- AltFuture
- Future
- AltProcess
- AltThread
What do you call a function defined in a block?
- private function
- block function
- local function
- method
What do you call a Scala method that is parametrized by type as well as by value?
- multimode method
- polymorphic method
- closure
- collection method
What type of exception is thrown when a precondition is violated?
- IllegalArgumentException
- NumberFormatException
- NullPointerExcepetion
- MalformedParameterException
In scala what is precondition?
- a constraint on where a method may be called from
- a constraint on values passed to a methode constructor
- a class of predifined error messages
- a class of Boolean operators
What would you change in this code to make it execute in parallel?
val myNums = (1 to 500).toList
list.map(_ + 1)
- **Change list.map to **list.par.map.
- Change toList to toListPar
- Change val to val.par
- Change toList to toParallelList
What is a free variable?
- a variable defined outside a function
- a variable referenced in a function that is not assigned a value by that function
- a variable that has a global scope
- a variable defined in a class and available to all methods in that class
What is the difference between .equals() and == ?
- == is wrapper of .equals() and checks for Nulls
- They do the exact same thing.
- == cannot be applied to String.
- == won’t work on objects
What’s the best way to execute code in the background in a separate thread?
- AltThread
- AltFuture
- AltProcess
- Future
What value does this code return?
x= List(1,2,4); x(1)?
- (1,2,4)
- 1
- Nil
- 2
All Linkedin Skill Assessment Answers
List of Technical Skill Assessment
- LinkedIn .NET Framework Skill Assessment Quiz Answers
- LinkedIn Agile Methodologies Skill Assessment Quiz Answers
- LinkedIn Amazon Web Services (AWS) Skill Quiz Answers
- LinkedIn Android Assessment Quiz Answers
- LinkedIn AngularJS Skill Assessment Quiz Answers
- LinkedIn AWS Lambda Skill Assessment Answers
- LinkedIn Bash Skill Assessment Quiz Answers
- LinkedIn C Skill Assessment Quiz Answers
- LinkedIn C# Skill Assessment Quiz Answers
- LinkedIn C++ Skill Assessment Quiz Answers
- LinkedIn CSS Skill Assessment Quiz Answers
- LinkedIn Cyber Security Skill Assessment Quiz Answers
- LinkedIn Django Skill Assessment Quiz Answers
- LinkedIn Eclipse Skill Assessment Quiz Answers
- LinkedIn Front End Development Skill Assessment Quiz Answers
- LinkedIn Git Skill Assessment Quiz Answers
- LinkedIn Google Analytics Skill Assessment Quiz Answers
- LinkedIn Google Cloud Platform (GCP) Skill Assessment Quiz Answers
- LinkedIn Hadoop Skill Assessment Quiz Answers
- LinkedIn HTML Skill Assessment Quiz Answers
- LinkedIn IT Operation Skill Assessment Quiz Answers
- LinkedIn Java Skill Assessment Quiz Answers
- LinkedIn JavaScript Skill Assessment Quiz Answers
- LinkedIn JQuery Skill Assessment Quiz Answers
- LinkedIn JSON Skill Assessment Quiz Answers
- LinkedIn Windows Server Skill Assessment Quiz Answers
- LinkedIn XML Skill Assessment Answers
- LinkedIn Kotlin Skill Assessment Quiz Answers
- LinkedIn Linux Skill Assessment Quiz Answers
- LinkedIn Machine Learning Skill Assessment Quiz Answers
- LinkedIn Maven Skill Assessment Quiz Answers
- LinkedIn Microsoft Azure Skill Assessment Quiz Answers
- LinkedIn MongoDB Skill Assessment Quiz Answers
- LinkedIn MySQL Skill Assessment Quiz Answers
- LinkedIn Node JS Skill Assessment Quiz Answers
- LinkedIn NoSQL Skill Assessment Quiz Answers
- LinkedIn Objective-C Skill Assessment Quiz Answers
- LinkedIn OOP (Object-Oriented Programming Skill Assessment Quiz Answers
- LinkedIn PHP Skill Assessment Quiz Answers
- LinkedIn Python Skill Assessment Quiz Answers
- LinkedIn React JS Skill Assessment Quiz Answers
- LinkedIn Rest APIs Skill Assessment Quiz Answers
- LinkedIn R (Programming Language) Skill Assessment Quiz Answers
- LinkedIn Ruby on Rails Skill Assessment Quiz Answers
- LinkedIn Scala Skill Assessment Quiz Answers
- LinkedIn Search Engine Optimization (SEO) Skill Assessment Quiz Answers
- LinkedIn Spring Framework Skill Assessment Quiz Answers
- LinkedIn Swift Skill Assessment Quiz Answers
- LinkedIn T-SQL Skill Assessment Quiz Answers
- LinkedIn Unity Skill Assessment Quiz Answers
- LinkedIn Visual Basic for Application (VBA) Skill Assessment Quiz Answers
- LinkedIn WordPress Skill Assessment Quiz Answers
List of Business Skill Assessment
- LinkedIn Accounting Skill Assessment Quiz Answers
- LinkedIn Adobe Acrobat Skill Assessment Quiz Answers
- LinkedIn Google Ads Skill Assessment Quiz Answers
- LinkedIn Microsoft Access Skill Assessment Quiz Answers
- LinkedIn Microsoft Excel Skill Assessment Quiz Answers
- LinkedIn Microsoft Outlook Skill Assessment Quiz Answers
- LinkedIn Microsoft Power BI Skill Assessment Quiz Answers
- LinkedIn Microsoft PowerPoint Skill Assessment Quiz Answers
- LinkedIn Microsoft Project Skill Assessment Quiz Answers
- LinkedIn Microsoft Word Skill Assessment Quiz Answers
- LinkedIn SharePoint Skill Assessment Quiz Answers
- LinkedIn Visio Skill Assessment Quiz Answers
List of Design Skill Assessment