Quick revision
The short answer
I would allow a second JVM language only under conditions: it covers whole services rather than modules mixed into Java code, shared libraries stay in Java, the team can staff reviews and on-call for it, and we review the decision after a year with data on productivity and incidents. The benefits are real: expressiveness, developer satisfaction and features Java lacked. But so are the costs in hiring, onboarding, library compatibility, build tooling and the number of people who can review the code, and Java's recent records, pattern matching and virtual threads have narrowed the gap.
What to remember
In this answer, we saw that a second JVM language brings real benefits in expressiveness and satisfaction but costs the organisation in hiring, onboarding, reviews, on-call, shared libraries and tooling, and that modern Java has narrowed the gap. The policy we would choose allows one extra language for whole services under clear conditions, keeps shared code in Java, and reviews the decision with data.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
I would allow a second JVM language only under conditions: it covers whole services rather than modules mixed into Java code, shared libraries stay in Java, the team can staff reviews and on-call for it, and we review the decision after a year with data on productivity and incidents. The benefits are real: expressiveness, developer satisfaction and features Java lacked. But so are the costs in hiring, onboarding, library compatibility, build tooling and the number of people who can review the code, and Java's recent records, pattern matching and virtual threads have narrowed the gap.
Why this question is asked
Language choices look like a developer preference, but in a large organisation they are a long-term operating cost. A language that one enthusiastic team adopts becomes code that other teams must review, debug at 3 a.m., and maintain after the original authors leave. Interviewers ask this leadership question to see whether we can weigh developer happiness against organisational cost, decide with conditions rather than a flat yes or no, and keep the decision honest over time. In this answer, we will look at what other languages offer, what they cost, how modern Java changes the balance, and then the conditions and review we would set.
1What the Teams Are Asking For
Kotlin and Scala both run on the JVM and use Java libraries, so the question is not about leaving the platform. Teams usually ask for them for good reasons. Kotlin offers concise syntax, null safety in its type system, data classes and coroutines. Scala offers a powerful type system and functional programming, and is the natural language for tools such as Apache Spark. Developers often say they are more productive and happier, and that matters for retention: a team that feels heard about its tools is a team that stays.
For years, these languages also had features Java simply lacked, such as concise data carriers, pattern matching and lightweight concurrency. That was a strong argument in 2015 and a weaker one now, as we will see.
2What a Second Language Costs
The costs are paid by the whole organisation, often long after the decision. Hiring gets harder, because each role needs a narrower skill set, and onboarding takes longer when engineers move between teams. Fewer people can review the code properly, which matters for security reviews and for incidents: if the one Scala service fails at night, the on-call engineer from another team may not be able to read it.
There are technical costs too. Shared libraries must work for both languages, and libraries written in Kotlin or Scala drag their standard libraries into Java services. Scala 2 releases such as 2.12 and 2.13 were not binary compatible with each other, which forces coordinated upgrades. Build tooling, static analysis, coverage, formatting and security scanning all need a second set of configurations, and platform teams must support both. None of this is a reason to forbid, but it is the price list.
| Area | Benefit | Cost |
|---|---|---|
| Developers | expressiveness, satisfaction | narrower hiring pool, longer onboarding |
| Code quality | null safety (Kotlin), strong types | fewer people able to review |
| Operations | same JVM, same tools at run time | on-call engineers who cannot read the code |
| Libraries | full use of Java libraries | shared code must serve both languages |
| Platform | none extra at run time | second set of build, lint and scan tooling |
3How Modern Java Has Narrowed the Gap
Since Java moved to a six-month release cadence in 2018, it has steadily added the features people moved to other languages for. Records (Java 16) give concise immutable data classes. Sealed classes (17), pattern matching for switch and record patterns (21) give much of the expressiveness of Kotlin's when and Scala's match. Virtual threads (21) give cheap concurrency with plain blocking code, without a new programming model. Text blocks, var and enhanced instanceof remove much of the old boilerplate.
So the argument has shifted. The strongest remaining technical case is Kotlin's null safety in the type system, which Java does not have, though JSpecify annotations with tools such as NullAway get part of the way. For Scala, the case is strongest in data engineering, where the ecosystem itself is Scala-first. For general business services, Java 25 is a competitive language, and that should weigh on the decision.
4The Conditions We Would Set
If we allow a second language, we make the boundary clear. The unit is a whole service, owned by one team, not a module mixed into a Java codebase, so the cost stays contained and any team can tell at once which language a service uses. Shared libraries, platform code and anything many teams depend on stay in Java, so every service can use them without extra dependencies.
We limit the list to one additional language, typically Kotlin, with a supported, standard build template including the compiler plugins Spring needs, linting and security scanning, owned by the platform team. The team asking for it must show it can staff the service: at least two or three people who can review, and an on-call plan that does not depend on one person. And we write down the decision with its reasoning and a review date.
- Is it a whole, separately owned service?YesContinueNoKeep it in Java
- Is it a shared library or platform code?YesKeep it in JavaNoContinue
- Is it the one approved extra language?YesContinueNoNeeds an architecture review
- Can the team staff reviews and on-call?YesAllow with the standard templateNoKeep it in Java for now
- Review after a yearproductivity, incidents, hiring
5 steps in order. Play them, or step through them one at a time.
5Reviewing the Decision With Data
A language policy should not be a matter of opinion forever. After a year, we look at evidence: lead time for changes and deployment frequency of the Kotlin services compared with similar Java ones, incident counts and time to restore, defect rates, how long new engineers took to become productive, and whether hiring or internal moves got harder. We also ask the engineers, through a short survey, because satisfaction is one of the benefits we claimed.
If the numbers are neutral or positive and the costs are contained, we keep the policy and maybe document it as an official option. If incidents are harder to handle or the services become orphaned when people leave, we tighten the conditions or plan migration back to Java for the services that suffer. Either way, the organisation learns from its own data instead of debating preferences.
6Follow-up questions
What would you say to a team that is unhappy with a no?
I would explain the costs that fall on other teams, show which recent Java features cover their needs, and offer a path: if they can meet the conditions, such as a whole service, staffing for reviews and on-call, and the standard template, they can apply again. Being clear about the reasoning matters more than the answer itself.
Would you allow Scala for a Spark data pipeline even if Kotlin is the approved extra language?
Possibly, because there the ecosystem itself is Scala-first and the pipeline team is a natural, contained owner. I would treat it as a separate, justified exception with the same conditions, rather than a general opening for Scala in services.
What if Kotlin services already exist without any policy?
Then we start by mapping them: who owns them, how many people can maintain them, and whether any shared code was written in Kotlin. We bring them under the standard template, move any widely shared Kotlin code to Java over time, and apply the same review instead of forcing a rewrite.
7Conclusion
In this answer, we saw that a second JVM language brings real benefits in expressiveness and satisfaction but costs the organisation in hiring, onboarding, reviews, on-call, shared libraries and tooling, and that modern Java has narrowed the gap. The policy we would choose allows one extra language for whole services under clear conditions, keeps shared code in Java, and reviews the decision with data.
Open with
I would allow it, but under conditions, because the costs land on the whole organisation. The benefits are real: Kotlin gives null safety in the type system and concise code, Scala is strong for data work, and developers who like their tools stay longer.
Then, if they want more
The costs are in hiring and onboarding, fewer people who can review the code or debug it on call, shared libraries that must serve both languages, and a second set of build, lint and security tooling.
I would also point out that Java has narrowed the gap since the six-month releases started: records, sealed classes, pattern matching and virtual threads cover most of what people used to switch for, and the biggest remaining difference is Kotlin's null safety.
So my conditions would be: only one extra language, typically Kotlin; only for whole services owned by one team, not mixed into Java modules; shared libraries and platform code stay in Java; the team must show it can staff reviews and on-call with more than one person; and the platform team provides a standard build template with the Spring compiler plugins and scanning.
I would write the decision down and review it after a year with data, comparing delivery speed, incidents and onboarding time against similar Java services, plus a developer survey, and tighten or widen the policy based on that.
About this answer
- Last updated
- 12 November 2026
- Versions it names
- Java 16, Java 25
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "Some teams want to use Kotlin or Scala alongside Java. As the architecture lead, would...": https://scrivio-interview-library.netlify.app/java/jvm-architecture/914f6ffade/