What is Scala and what are its key features?
Answer
Scala (Scalable Language) is a modern, multi-paradigm programming language that runs on the JVM. Created by Martin Odersky, it combines object-oriented programming and functional programming in a statically typed language. Key features: Type inference: the compiler deduces types without explicit annotations in most cases. Immutability: encourages immutable data with val (immutable) vs var (mutable). Higher-order functions: functions are first-class citizens. Pattern matching: powerful switch-like construct. Case classes: concise immutable data classes with built-in equality and pattern matching. Traits: similar to interfaces but with default implementations. Scala is heavily used in data engineering (Apache Spark is written in Scala), distributed systems (Akka), and functional programming communities.