#Scala Job Interview Questions
This file contains a number of Scala interview questions that can be used when vetting potential candidates. It is by no means recommended to use every single question here on the same candidate (that would take hours). Choosing a few items from this list should help you vet the intended skills you require.
Note: Keep in mind that many of these questions are open-ended and could lead to interesting discussions that tell you more about the person's capabilities than a straight answer would.
- General Questions
- Language Questions
- Functional Programming Questions
- Reactive Programming Questions
- Coding Questions
- Fun Questions
- What did you learn yesterday/this week?
- Why and how did you start learning Scala?
- What excites or interests you about coding in Scala?
- What is a recent technical challenge you experienced and how did you solve it?
- Talk about your preferred development environment. (OS, Editor or IDE, Tools, etc.)
- What are your thoughts about the other JVM languages compared to Scala?
- Do you think that the Scala language and community is mature enough?
- What is the difference between a
var
, aval
anddef
? - What is the difference between a
trait
and anabstract class
? - What is the difference between an
object
and aclass
? - What is a
case class
? - What is the difference between a Java future and a Scala future?
- What is the difference between
unapply
andapply
, when would you use them? - What is a companion object?
- What is the difference between the following terms and types in Scala:
Nil
,Null
,None
,Nothing
? - What is
Unit
? - What is the difference between a
call-by-value
andcall-by-name
parameter?- How does Scala's
Stream
trait levaragescall-by-name
?
- How does Scala's
- Define uses for the
Option
monad and good practices it provides. - How does
yield
work? - Explain the implicit parameter precedence.
- What operations is a
for comprehension
syntactic sugar for? - Streams:
- What consideration you need to have when you use Scala's
Streams
? - What technique does the Scala's
Streams
use internally?
- What consideration you need to have when you use Scala's
- What is a
functor
? - What is a
applicative
? - What is a
monad
?- What are the
monad
axioms? - What Scala data types are, or behave like, monads?
- What are the basic and optional requirement/s to conform a Monad?
- What are the
- Explain higher order functions.
- What is gained from using immutable objects?
- What is tail recursion?
- How does it differentiate from common recursion?
- What issues are there with tail recursive functions in the JVM?
- How does the Scala compiler optimize a tail recursive function?
- How do you ensure that the compiler optimizes the tail recursive function?
- What is function currying?
- What are implicit parameters?
- What are typeclasses?
- What are lenses?
- What is and which are the uses of: Enumerators, Enumeratees and Iteratee
- Explain the actor model.
- What are benefits of non-blocking (asynchronous I/O) over blocking (synchronous I/O).
- Do you think that Scala has the same async spirit as Node.js?
- Explain the difference between
concurrency
andparallelism
, and name some constructs you can use in Scala to leverage both. - What is the global ExecutionContext?
- What does the global ExecutionContext underlay?
- Akka:
- Which are the 3 main components in a Stream?
- How can you make a
List[String]
from aList[List[String]]
? - What is the difference (if any) between these 2 statements?
var x = immutable.Set[Int]()
val y = mutable.Set[Int]()
- What's a cool project that you've recently worked on?
- What testing framework for Scala do you use?
- What do you know about property based testing frameworks, such as Scalacheck?
- Do you like ‘scalaz‘?