Blog Archives
1 2 3 4

01: Scala Functional Programming basics – pure functions, referential transparency & side effects

Q1. What is a pure function?
A1. A pure function is a function where the following conditions are met:

1) The Input solely determines the output.

2) The function does not change its input.

3) The function does not do anything else except computing the output. This means NO I/O, which is no reading from database, file or input console & no writing to a database, file or output console.… Read more ...

Tags:

02: Scala FP basics: First-class function, higher order function, statements Vs expressions, immutability & recursion

This extends Scala Functional Programming basics – pure functions, referential transparency, side effects, etc.

Q1. What is a first-class function?
A1. A first-class function is a function that can be treated like a value.

1) Can be assigned to a variable as a value can be assigned to a variable.

Read more ...


02B: Scala FP basics: Explain the below Scala code

Q. Can you explain the concepts used in the below code?

Read more ...


03: Q1 – Q6 Scala interview Q&As on Functional Programming

100+ FAQ Scala interview questions answered with code. Learn more about FP – 6 tips to transforming your thinking from OOP/imperative programming to functional programming (i.e. FP). Scala is very popular in Apache Spark programming to process Big Data. 70+ FAQ Bigdata & Hadoop interview questions & answers with diagrams…

Read more ...
Tags:

04: Currying, partial application & functional composition in Scala

Let’s see how we can wire up functions with & without currying, and then touch on functional composition. Without currying Here are simple functions example that add, add10, multiply and multiplyBy10 without currying.

Read more ...


04: Q6 – Q12 Scala FP currying, closures & partial functions interview Q&As

This extends Q1 – Q5 Scala Functional Programming basics interview questions & answers Q6. What is a curried function in Scala? A6. Currying is the technique of transforming a function with multiple arguments into a function with just one argument, and the other arguments are curried. Currying is when you…

Read more ...


05: 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.

1) Loops (e.g. for, while, do-while)
2) Recursion
3) Combinators (e.g. map, foreach, filter, flatMap, foldLeft, etc)

Loop

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]”, which is a trait. So,…

Read more ...


06: Scala Class Vs. Object and Companion object interview Q&As

Q1. Given the below Person.scala file with Person.calss, what will be the output?

Read more ...


06C: Q33 – Q40 Scala Futures and Promises Interview Q&As

Q33. What is a “Future” object in Scala? Is it an immutable object? A33. A Future is a holder object that holds a value (i.e. success scenario) or an exception (i.e. failure) which may become available at some point. Future represents the result of an asynchronous computation. Yes. A “Future”…

Read more ...


1 2 3 4

Java Developer & Architect Interview Q&As

Java & Big Data Tutorials

Prepare to fast-track & go places

FAQs are marked with 🔥 as some questions are not only more popular with the interviewers, but also required to build robust systems. If you are an interviewer, cover well rounded topics to judge real experience.

Don't be overwhelmed by the number of questions as the technology stacks are so vast. The quality of the answers you provide to some of the key technical & open-ended questions along with your soft skills & attitude will go a long way in getting the job offers.

Note: Some Q&As belong to more than one category.
Top