Blog Archives
1 2 3 4 5

11: Coding Scala Way – Actors with Akka – part 1

We already saw in Java: Producer and Consumer Java Multi-threading code. This extends the tutorial “Simple Akka tutorial in Scala step by step” for setting up the environment with right plugins and libraries with Eclipse & Maven.

The Akka Actors sending &…

Read more ›



11A: Scala values, proper types, first order types & higher kinded types

Q1. What is a proper type in Scala? A1. String, List[Int], List[String], Person, etc are proper types in Scala. The below diagram will become clearer at the end.

Proper types are a higher level concept than values (E.g. … 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


11B: Q71 – Q72 – Scala type parameterization & variance interview Q&As

Q71. Does Scala have type erasure as in Java?
A71. Yes. Scala parametrized types loose the type information after compilation in the same way as Java does.

Q72a. What are different type parameter modifiers in Scala?
A72a.

Cage[T]
T is of any type
Invariance

Cage[T <: Animal]
T is sub type of an Animal
upper bound,

…

Read more ›



11C: Q73 – Q77 – Scala type parameterization & variance interview Q&As

This extends the type parameters basics at 11B: Q71 – Q72 – Scala type parameterization & variance interview Q&As. Cage[T] T is of any type Invariance Cage[T <: Animal] T is sub type of an Animal upper bound, … 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


11D: Scala existential type interview Q&As

Q01. What are existential types? A01. Existential types are a way of abstracting over types. They let you assert that some type “exists” without specifying exactly what it is as you don’t care what it is in the current context. For example, counting the number of elements in a list....

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


12: Coding Scala Way – Actors with Akka “Ask Pattern” – Part 2

Actors with Akka “Ask Pattern” is for getting a reply or a response to a message that was sent by a sender. Use ? or ask method. We saw earlier how to send or tell a message to an actor. The Akka Actor Asking for a reply or response The...

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


12: Q78 – Q80 Recursion in Scala Q&As explained with diagrams

Q. Do functional languages handle recursion better than non-functional ones?

A. Yes because they have to. A pure function is a function with no side effects and no state. Not having side effects means you can’t have loop counters as they mutate state,

…

Read more ›



13: Coding Scala Way – 2 Actors with Akka – part 3

This extends Actors with Akka – part 1. This “Akka with actors” shows how messages passed among actors in the system. This is known as the reactor pattern based on the event-driven architecture. Orderplacement.scala with Actors

Output:

The system keeps running until you stop the JVM process. …...

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


13A: Scala Semigroup interview Q&As

Semigroups, Monoids, Functors, Monads, Applicatives, etc are concepts or patterns that abstract complexities in computations, and NOT traits or classes. You can think of them as type classes like List[T], Option[T], Futures[T], MyContainer[T], etc that fulfil requirements of functors, monads, etc. Let’s start with monoids first. … 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


13B: Q81 – Q83 Scala monoids interview Q&As

Monoids, Functors, Monads, Applicatives, etc are concepts or patterns that abstract complexities in computations, and NOT traits or classes. You can think of them as container type classes like List[T], Option[T], Futures[T], MyContainer[T], etc that fulfil requirements of functors, monads, etc. Let’s start with monoids first. … 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


13B: Scala foldLeft, foldRight, scanLeft, scanRight, reduceLeft, reduceRight, etc are Monoids

This extends 13: Q81 – Q83 Scala monoids interview Q&As. Given the below code

Q01. How will you combine the two lists xs & xy? A01. The foldLeft(.)(..) to the rescue as shown below:

:+ is a method name alias for the append:

Output:

Q02....

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


14: Coding Scala Way – Scala concurrency with Future

Scala concurrency with Future explains step by step blocking vs unblocking calls and how implicit and apply concepts work under the covers. Scala extends the Java programming language and runtime in many ways, including concurrency where Scala version of Future<T> is more flexible than the Java version as you can create futures directly from blocks of code,

…

Read more ›



14: Q84 – Q87 Category Theory With Scala Interview Q&As

Q84. What is a category theory from a functional programming language perspective? A84. The category theory is all about abstractions. Composition “f” and “g” are functions, and “A” and “B” are types. f: A => … 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