Blog Archives
Page 3 of 10
1 2 3 4 5 10

03: Q13 – Q18 Scala FP combinators interview questions & answers

Q13. What are the different approaches in Scala to solve the following task?

Given numbers 1 to 6, and you need to extract out the odd numbers and double them, and finally print the result.

A13. There are 3 ways to solve the problem.

Read more ›



04: Coding Scala Way – Null checks with Option-Some-None

Example #10: Null checks with “Option-Some-None”

Nulls in Scala is a code smell, and a better way to handle null values is with an “Option“, which has 2 sub classes “Some” that has a value and a “None

Read more ›



04: Q19 – Q26 Scala Data Structures basics interview questions & answers

Q19. What is the use of Tuples in Scala? A19. A Tuple is an immutable collection that can hold objects of different types. In other words, it groups together logical collections of items without using a class. There are 22 Tuple class in Scala from Tuple1, … Read more ›...

Members Only Content
Log In Register Home


05: Coding Scala Way – FP concepts

Example #13: Explain the concepts

Can you explain the Scala concepts applied in the following code snippets?

1. Higher Order Functions: Line 10” is a higher order function as the function returns another function i.e. List[T] =>

Read more ›



05: Q27 – Q32 Scala idioms Q&As on Option-Some-None, Try-Success-Failure and Either-Left-Right

Java has idioms like Try-Catch-Finally, Scala has idioms like 1) “Option-Some-None”, 2) Either-Left-Right 3) Try-Success-Failure. Q27. How does Scala try to solve the problem of getting rid of null values & the “NullPointerException”? A27. Scala provides its own type for representing optional values with “Option[A]”, … Read more ›...

Members Only Content
Log In Register Home


Page 3 of 10
1 2 3 4 5 10

800+ Java Interview Q&As Menu

Top