The Scala online test assesses candidates' knowledge of programming in the Scala language and their ability to leverage commonly used parts of the Scala and Java frameworks' class library.

It's an ideal test for pre-employment screening. A good Scala developer needs to be able not only to solve problems using Scala but also recognize when to leverage the functionality provided by the frameworks' class library to write robust and maintainable code.

This online test requires candidates to solve coding problems in Scala and find and fix bugs in a Scala program.

Recommended Job Roles
Back-End Developer
Scala Developer
Web Developer
Sample Candidate Report

Sample Free Questions

Merge Names

10min
  -  
Easy 
  -  
CODE

Scala Vector Public New

Implement the uniqueNames function. When passed two vectors of names, it will return a vector containing the names that appear in either or both input vectors. The returned vector should have no duplicates.

For example, calling MergeNames.uniqueNames(Vector("Ava", "Emma", "Olivia"), Vector("Olivia", "Sophia", "Emma")) should return a vector containing Ava, Emma, Olivia, and Sophia in any order.

Player Inventory

10min
  -  
Easy 
  -  
CODE

Scala Bug fixing Immutability Public New

The code for the PlayerInventory class is not working. When a user starts a new account, PlayerInventory is initialized with basic items. It should also be possible to add and drop items from the inventory, with duplicate items added and removed separately.

For example, if "lumber" was added to the inventory and "stone" was removed, getItems() should return a Vector containing "lumber", "magic potion", and "lumber", in any order.

Fix the bugs.

User Input

15min
  -  
Easy 
  -  
CODE

Scala OOP Public New

User interface contains two types of user input controls: TextInput, which accepts all characters and NumericInput, which accepts only digits.

Implement the class TextInput that contains:

  • Public method def add(c : Char) - concatenates the given character to the current value
  • Public method def getValue: String - returns the current value

Implement the class NumericInput that:

  • Inherits from TextInput
  • Overrides the add method so that each non-numeric character is ignored

For example, the following code should output "10":

val input: TextInput = new NumericInput()
input.add('1')
input.add('a')
input.add('0')
println(input.getValue())
Use Free Questions On a Trial Plan

Premium Questions

The premium question library contains our unique, hand-crafted questions. We offer a refund if you find any of them answered online.

Skills
Scala Collections Lazy Evaluation Bug fixing Exceptions OOP Strings
Pricing For Premium Questions