Screen 1 of 5

🎭 Top Trick Questions Interviewers Love

These are designed to trip you up. Click "Reveal Answer" to study each one.

1. "Is a val truly immutable in Scala?"
Tricky! The reference is immutable — you can't reassign it. But the object it points to can be mutable. E.g., val list = mutable.ArrayBuffer(1,2,3) — you can't reassign list, but you CAN do list += 4.
2. "What's the difference between == and eq in Scala?"
== checks value equality (like Java's .equals). eq checks reference equality (same object in memory, like Java's ==). In Scala, you almost always want ==.
3. "What happens if you have two implicit values of the same type in scope?"
Compile error! "Ambiguous implicit values." The compiler can't decide which one to use. You must either remove one or make one more specific (e.g., put it in a closer scope).
4. "Can a case class extend another case class?"
No! Case class inheritance is prohibited in Scala. It causes problems with auto-generated equals/hashCode. Use a sealed trait with multiple case classes instead: sealed trait Shape; case class Circle(r: Double) extends Shape; case class Square(s: Double) extends Shape
5. "What is Nothing in Scala?"
Nothing is the bottom type — a subtype of EVERY other type. It has no instances. It's the return type of expressions that never return normally: throw new Exception has type Nothing. This is why Nil (empty list) is List[Nothing] — it can be assigned to any List[T].
Screen 2 of 5

🛡️ Your Interview Strategy

It's not just about knowing answers — it's about how you deliver them.

1

Start with the Metaphor

"A Future is like ordering takeout..." — shows you truly understand the concept, not just memorized the definition.

2

Give the Technical Answer

Then follow with the precise definition. "A Future represents an async computation that will eventually complete with a value or failure."

3

Show Trade-offs

"Immutability is great for safety, but creates more garbage collection pressure. For hot paths, mutable may be justified." This shows senior-level thinking.

4

Mention Real-World Usage

"In our system, we used Akka actors for order processing because..." Even hypothetical scenarios show applied knowledge.

5

Know What You Don't Know

"I haven't used ZIO in production, but I understand it provides..." Honesty with awareness beats faking it every time.

Screen 3 of 5

⚠️ Common Pitfalls to Avoid

🚨 Overusing var

If your Scala code is full of var, you're writing Java in Scala. Use val by default, use functional transformations instead of mutation.

🚨 Ignoring Option

Using .get on an Option defeats the purpose. Always pattern match or use .getOrElse, .map, .fold.

🚨 Blocking in Futures

Using Await.result in production code blocks threads. Use .map/.flatMap or for-comprehensions instead.

🚨 Implicit Abuse

Too many implicits make code unreadable. Use them for well-known patterns (ExecutionContext, Codec) not for business logic.

🚨 Mutable in Concurrent Code

Using mutable collections in multi-threaded code without synchronization = race conditions. Use immutable collections or actors.

🚨 Collecting Spark Data

Calling .collect() on a 100GB DataFrame brings ALL data to the driver — instant OutOfMemoryError. Use aggregations first.

Screen 4 of 5

⚡ Rapid-Fire: 10 Questions in 10 Minutes

Real interview speed. How many can you get right?

1. What does the REPL stand for in Scala?
Read-Eval-Print Loop
Run-Execute-Process Loop
Recursive Expression Processing Language
2. sealed trait Animal. What does "sealed" mean?
The trait can't have methods
All subtypes must be defined in the same file — enables exhaustive pattern matching
The trait can't be extended at all
3. What's the output? List(1,2,3).map(_ * 2).filter(_ > 3)
List(2, 4, 6)
List(4, 6)
List(6)
4. In Spark, what triggers actual computation?
Transformations like map and filter
Actions like count, show, collect
Creating a SparkSession
5. What type does None have?
Null
Option[Nothing]
Unit
6. What does @tailrec ensure?
The function runs in a separate thread
The function is tail-recursive and can be optimized to a loop by the compiler
The function caches its results
7. You see List[+A]. What does the + mean?
Covariant: List[Dog] is a subtype of List[Animal] if Dog extends Animal
The list can grow in size
The list only contains positive values
8. Why use foldLeft over reduce?
foldLeft is faster
foldLeft works on empty collections (has a starting value); reduce crashes on empty
foldLeft preserves order, reduce doesn't
Screen 5 of 5

🏆 Your Score

-
out of 8 rapid-fire questions
🌟 You've Completed the Course!
You've covered Scala fundamentals, functional programming, collections, type system, concurrency, Spark, and interview strategy. Go crush that interview!

🔁 Review weak areas

Go back to any module you scored low on. Each module is independent — jump directly to what you need.

📝 Practice coding

Use the Scala REPL to try the code examples. Muscle memory is real — type the code, don't just read it.

🎯 Mock interviews

Explain each concept out loud. If you can teach it, you know it. Practice the metaphor-first approach from Screen 2.