Blog Archives
1 2 3 4

06: Understanding TimeZones with Java 8 examples

What is UTC? which stands for Coordinated Universal Time. The diagram below shows the standard time offsets of different countries. Some places observe daylight saving time (DST) during their respective summer periods. For example,

Los Angeles (i.e LA) UTC –

Read more ›



07: Java 8 API examples using lambda expressions and functional programming

Java 8 API examples using lambda expressions and functional programming. Example 1: The java.lang.Runnable interface has been made a functional interface. Output: main thread: main worker thread: Thread-0 worker thread: Thread-1 Example 2: The java.util.function package has a number of functional interfaces. … Read more ›...

Members Only Content
Log In Register Home


08: Write code to add, subtract, multiply, and divide given numbers?

A trivial coding example (i.e. a Calculator) tackled using the following programming paradigms in Java not only to perform well in coding interviews, but also to learn these programming paradigms.

Approach 1: Procedural Programming
Approaches 2 – 4: Object Oriented Programming
Approach 5: Functional Programming (Java 8)

Approach 1: Procedural

Output: result=13

Approach 2: OOP

When you have more mathematical operations,

Read more ›



10: ExecutorService Vs Fork/Join & Future Vs CompletableFuture Interview Q&As

Q1. What is the difference between “ExecutorService” and “Fork/Join Framework“?
A1. The Fork/Join framework uses a special kind of thread pool known as the ForkJoinPool, which is a specialized implementation of ExecutorService implementing the 1) work-stealing algorithm,

Read more ›



5 FAQs on transforming your thinking from OOP to FP

Functional programming is prevalent in data engineering (i.e. Spark programming, etc) roles. A must know for Big Data Engineers and Analysts.

One needs to get used to the transformation from imperative programming to functional programming. You like it or not, you will be using functional programming in Java,

Read more ›



Fibonacci number with caching and Java 8 FP

Complimenting Fibonacci number coding – iterative and recursive approach, we can improve performance by caching. If you run this Output and you can see “fibonacci(3)” is repeated 2 times, “fibonacci(2)” is repeated 3 times, and so on. If you pick a larger number like 21, … Read more ›...

Members Only Content
Log In Register Home


Java 8 String streams and finding the first non repeated character with functional programming

Q1.Find the first non repeated character in a given string input using Java 8 or later? A1.Extends Find the first non repeated character in a given string input with Java 8 functional programming. Examples to understand string streams: Example 1 Output: Example 2 Output: Example 3 Output: Example 4 Output:...

Members Only Content
Log In Register Home


1 2 3 4

800+ Java Interview Q&As Menu

Learn by categories on the go...
Learn by categories such as FAQs – Core Java, Key Area – Low Latency, Core Java – Java 8, JEE – Microservices, Big Data – NoSQL, Architecture – Distributed, Big Data – Spark, etc. Some posts belong to multiple categories.
Top