Blog Archives

02: 5 Java multithreading scenarios interview

Java interview questions & answers on multithreading scenarios to judge your experience in building applications with concurrency in mind. Q1. Can you give some scenarios where you built concurrent systems?...



03: 7 Things you must know about Java locks and synchronized key word

7 Things you must know about Java locks and synchronized key word summarizes the key basics. #1. Each Java class and object (i.e. … Read more ›...



04: 6 popular Java multithreading interview Q&As for the experienced

Q1. Why do threads need to communicate with each other? A1. Inter thread communication is very similar to inter process communication where 2 or more processes communicate with other, …...



05: 9 Java multithreading Q&As on concepts like blocking, sequencing, preempting, time slicing & daemon threads

Java multithreading Q&As on concepts like blocking, and debugging blocked threads. How do you sequence threads? what do you understand by the term preemptive scheduling? Q1. What are the different...



06: 10+ Atomicity, Visibility, and Ordering interview Q&A in Java multi-threading

Q1. Why is it important to understand the difference between the “JVM memory model” and the computer “hardware memory model”? A1. 3 reasons why it is important to understand the...



07: Java FP – CompletableFuture monadic chaining with examples – part 1

This extends Future Vs. CompletableFuture interview Q&As with Java 8 functional programming (i.e. FP). Q1. Why was CompletableFuture introduced in Java 8 when you already had the Future interface? …...



07: Java ThreadLocal Interview questions & answers

Java ThreadLocal Interview questions & answers in detail with code focusing more on when to use it and how to not abuse it. Q1. What is a ThreadLocal class? …...



08: 7 basic Java Executor framework Interview Q&As with Future & CompletableFuture

Basic level Java Executor framework Interview Q&As with Future & CompletableFuture (introduced in Java 8), which you would be using very often in Java apps. Q01. … Read more ›...



08: CompletableFuture monadic chaining with examples – part 2

This extends Java FP – CompletableFuture monadic chaining with examples – part 1. f and g are processed asynchronously, and then combined A “Supplier” returns a result by taking nothing...



09: Java FutureTask example

Java 5 introduced the concurrent package for more efficient multi-threading.

Q. What is the difference between Future and FutureTask in asynchronous processing?
A.

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,

Read more ›



14: Java Thread stop, resume, suspend & interrupt interview Q&As

Q1. Why are Thread.stop, Thread.suspend and Thread.resume deprecated? A1. We already learnt that “In Java programming, each object has a lock. … Read more ›...



15+ Java beginner multithreading interview FAQs

Q1. What is a thread? A1. It is a thread of execution in a program. The JVM (i.e. process) allows an application to have multiple threads of execution running concurrently....



Java ExecutorService with strategy design pattern to execute concurrently & sequentially

Java executor framework for running multi-threaded applications concurrently, sequentially, and with a strategy design pattern to switch between sequential and concurrent execution. 1. Running concurrently The output will be You...



Producer and Consumer Java Multi-threading code

The following code is used for demonstrating thread-safety issues on eclipse.

Step 1: ProducerConsumerTest

Step 2: Producer thread.

Step 3: Consumer thread.

Read more ›



800+ Java Interview Q&As

Top