Blog Archives
1 2 3 4 5

15: Coding Scala Way – Scala concurrency & closure vs function definition

This post not only covers “onSuccess” method on a “Future”, but also clarifies the difference between executing a closure and a function definition. Is anything wrong with the following Scala concurrency code?

Output:

“ … Read more ›...

This content is for 30-Day-Full-Access, 100-Day-Full-Access, 200-Day-Full-Access, and 365-Day-Full-Access members only. Register 80+ Free Java FAQs 80+ Free Big Data FAQs
Already a member? Log in here


15: Q88 – Q92 Scala Functors Interview Q&As

This extends Category Theory With Scala Interview Q&As. Q88. What do you understand by the terms functors, monads, and applicatives ? A88. Functors, Monads, and Applicatives are concepts or patterns that abstract complexities in computations, and are NOT traits or classes. … Read more ›...

This content is for 30-Day-Full-Access, 100-Day-Full-Access, 200-Day-Full-Access, and 365-Day-Full-Access members only. Register 80+ Free Java FAQs 80+ Free Big Data FAQs
Already a member? Log in here


15B: Scala Functors Interview Q&As by example

Prerequisite: Scala values, proper types, first order types & higher kinded types. Q. Is it possible to further abstract the below code?

Output:

A. Why have different timesByTwoXXX functions for each container type like List, … Read more ›...

This content is for 30-Day-Full-Access, 100-Day-Full-Access, 200-Day-Full-Access, and 365-Day-Full-Access members only. Register 80+ Free Java FAQs 80+ Free Big Data FAQs
Already a member? Log in here


16: Coding Scala Way – Scala concurrency styles

This extends Scala concurrency & closure vs function definition. This post looks at Scala concurrency styles – blocking & non-blocking. onComplete – non-blocking

Output:

onSuccess – non-blocking The above “onComplete” call is highly nested. “ … Read more ›...

This content is for 30-Day-Full-Access, 100-Day-Full-Access, 200-Day-Full-Access, and 365-Day-Full-Access members only. Register 80+ Free Java FAQs 80+ Free Big Data FAQs
Already a member? Log in here


16: Q93 – Q98 Scala monads interview Q&As

This extends Scala Functors Interview Q&As. You need to remember the following.

Where T & R are raw types like String, Int, Employee, etc, and C is a container or wrapper type like List, Option, Future, List, etc. So, T =R could be a type abstraction for Int =Int,...

This content is for 30-Day-Full-Access, 100-Day-Full-Access, 200-Day-Full-Access, and 365-Day-Full-Access members only. Register 80+ Free Java FAQs 80+ Free Big Data FAQs
Already a member? Log in here


16B: Scala Monoids, Functors & Monads interview Q&As

Scala Monoids, Functors & Monads interview questions are very popular & form the basis for the functional programming. Q01. Given the below code, is it possible to implement the map(..) method with flatMap(…) within the Monad trait?

A01. Yes. … Read more ›...

This content is for 30-Day-Full-Access, 100-Day-Full-Access, 200-Day-Full-Access, and 365-Day-Full-Access members only. Register 80+ Free Java FAQs 80+ Free Big Data FAQs
Already a member? Log in here


17: Coding Scala Way – What is wrong with this code?

Q. What is wrong with the below code? How will you fix it?

A. The above code will always return “false”. Why? Because map.get(id) returns Some(2016), which is not == to the String value of “2016”. The “==”

…

Read more ›



17: Q99 – Q103 Scala applicative functors interview Q&As

This extends Scala Functors Interview Q&As & Scala monads interview Q&As. You need to remember the following.

Q99. Why do you need an applicative functor? A99. The “map” method in the functor works with a single input argument as explained in the Scala functors interview Q&As. … Read...

This content is for 30-Day-Full-Access, 100-Day-Full-Access, 200-Day-Full-Access, and 365-Day-Full-Access members only. Register 80+ Free Java FAQs 80+ Free Big Data FAQs
Already a member? Log in here


18: Q104 – Q108 Scala typeclass pattern for decoupling with polymorphism

Q104. What is the importance of “typeclass” pattern in Scala? A104. Typeclass pattern is to achieve decoupling via adhoc polymorphism. Polymorphism separates interfaces from implementations, to decouple what from how. Polymorphism improves code readability with better code organization. … Read more ›...

This content is for 30-Day-Full-Access, 100-Day-Full-Access, 200-Day-Full-Access, and 365-Day-Full-Access members only. Register 80+ Free Java FAQs 80+ Free Big Data FAQs
Already a member? Log in here


19: Q109 – Q113 Scala ADT (Algebraic Data Types) Interview Q&As

Q109 How do you model data in functional programming (i.e. FP)? A109 Using ADT (i.e. Algebraic Data Types), you can model data with logical ORs and logical ANDs. “OR” is also known as the “Sum” … Read more ›...

This content is for 30-Day-Full-Access, 100-Day-Full-Access, 200-Day-Full-Access, and 365-Day-Full-Access members only. Register 80+ Free Java FAQs 80+ Free Big Data FAQs
Already a member? Log in here


20: Q114 – Q120 Scala fold vs reduce Q&As

fold, map, and flatMap are key functional programming functions. These functions are used in three contexts: collections (E.g. List, Sequence, Array, Map, etc), Options, and Futures. Let’s look at the function “fold” here. Q114 What does fold & … Read more ›...

This content is for 30-Day-Full-Access, 100-Day-Full-Access, 200-Day-Full-Access, and 365-Day-Full-Access members only. Register 80+ Free Java FAQs 80+ Free Big Data FAQs
Already a member? Log in here


21: Q121 – Q124 Scala Extractor Interview Q&As

Q121 What is an extractor object in Scala? A121 An extractor object is an object with an unapply method. The apply method is like a constructor which takes arguments and creates an object, the unapply takes an object and tries to give back the arguments. … Read more ›...

This content is for 30-Day-Full-Access, 100-Day-Full-Access, 200-Day-Full-Access, and 365-Day-Full-Access members only. Register 80+ Free Java FAQs 80+ Free Big Data FAQs
Already a member? Log in here


22: What are the uses of underscore i.e _ in Scala?

The underscore (_) is one of the symbols used very widely in Scala. It is used as a Wild card, Place holder, Except, Ignore etc. Module Import Used as a wild card, … Read more ›...

This content is for 30-Day-Full-Access, 100-Day-Full-Access, 200-Day-Full-Access, and 365-Day-Full-Access members only. Register 80+ Free Java FAQs 80+ Free Big Data FAQs
Already a member? Log in here


1 2 3 4 5

300+ Java Interview Questions - FAQs

Tutorials on Java & Big Data