Scala blends object-oriented and functional programming, and candidates who only know one paradigm struggle. These questions check for real understanding of both.
Hiring a Scala developer is easy. Telling a real one from a convincing résumé is the hard part — and it’s most of what we do. These are grouped by level, because the same question that stretches a junior is a warm-up for a senior.
Junior Scala interview questions
0–2 years
Fundamentals.
What is the difference between val, var and def?
val is an immutable binding evaluated once, var is mutable, def defines a method evaluated on each call.
Uses var everywhere and ignores immutability.
What is a case class?
An immutable class with auto-generated equality, hashCode, toString, a copy method and pattern-matching support.
Writes boilerplate classes by hand.
What is pattern matching?
A powerful match construct that deconstructs values by shape and type, often exhaustively checked over sealed types.
Uses long if-else chains and isInstanceOf.
What is the difference between List and Array?
List is an immutable linked list with cheap head operations; Array is a mutable, fixed-size, indexable structure.
Uses mutable arrays by default in functional code.
What is an Option?
A container modelling presence (Some) or absence (None), replacing null to make absence explicit.
Uses null and hits null pointer exceptions.
What is the difference between a trait and an abstract class?
Traits are mixin interfaces a class can combine several of; abstract classes allow one inheritance and constructor parameters.
Cannot say when to use a trait.
What is a companion object?
A singleton object sharing a name with a class, holding factory methods and static-like members.
Doesn’t know where apply factory methods live.
What are higher-order functions?
Functions that take or return functions, central to Scala’s functional style (map, filter, fold).
Writes imperative loops instead.
Mid-level Scala interview questions
2–5 years
Functional programming.
What is immutability and why does Scala favour it?
Values that never change, which makes reasoning and concurrency safer; Scala’s collections and case classes are immutable by default.
Mutates shared state freely.
What are map, flatMap and for-comprehensions?
Transform and chain operations over containers; a for-comprehension is sugar over map/flatMap/filter.
Cannot desugar a for-comprehension.
What are implicits / given-using and their risks?
Compiler-supplied parameters and conversions enabling type-class patterns and context passing; overuse hurts readability and debuggability.
Overuses implicits until code is unreadable.
What is a type class?
A pattern providing behaviour for types without modifying them, implemented via implicits/givens (e.g. an Ordering).
Only knows inheritance-based polymorphism.
What is the difference between foldLeft and reduce?
foldLeft takes an initial accumulator and works on empty collections; reduce has no seed and fails on empty.
Calls reduce on a possibly-empty collection.
What are Futures?
Represent asynchronous computations composed with map/flatMap, needing an execution context.
Blocks on futures with Await everywhere.
What is a partial function?
A function defined only for some inputs, with isDefinedAt, useful in pattern-matching contexts like collect.
Never encountered them.
What is call-by-name vs call-by-value?
Call-by-value evaluates arguments before the call; call-by-name (=> T) defers evaluation until used.
Cannot explain lazy parameter evaluation.
Senior Scala interview questions
5+ years
Concurrency and design.
How do you handle concurrency idiomatically?
Immutable data plus futures, actors (Akka/Pekko) or effect systems, avoiding shared mutable state and manual locks.
Shares mutable state across threads with locks.
What are effect systems (Cats Effect / ZIO) for?
Modelling side effects as values (IO) for referential transparency, resource safety and principled concurrency.
Runs side effects eagerly and loses composability.
What is the difference between eager and lazy evaluation?
lazy val and by-name parameters defer computation until needed; useful for expensive or circular initialisation.
Forces expensive computation up front unnecessarily.
How do you design with algebraic data types?
Sealed traits plus case classes model a closed set of variants, enabling exhaustive, type-safe handling.
Models variants with nullable fields and casts.
How do you avoid stack overflows in recursion?
Tail recursion with @tailrec, or trampolining for non-tail recursion.
Writes deep non-tail recursion that overflows.
What are the tradeoffs of Scala’s expressiveness?
Powerful abstractions versus a steep learning curve, compile times and the risk of overly-clever code; team discipline matters.
Writes maximally abstract code no one can maintain.
How do you structure a large Scala codebase?
Clear module boundaries, minimal and localised implicits, consistent effect handling, and readable over clever.
Scatters implicits and mixes paradigms inconsistently.
How does the type system help you?
Encoding invariants so illegal states don’t compile, using ADTs, generics and type classes for safety and reuse.
Leans on runtime checks the compiler could enforce.
Build and score a full interview with our free interview scorecard tool, browse the full question hub, or see how we interview engineers.