Blog Archives

09: What is wrong with this code? ConcurrentHashMap & Atomic operations

Q. What output is expected from the following code? What does it actually output?

A. It is expected to output counts from 100,001 to 100,010, but actually the output will be as shown below missing counts. Output with missing counts

Why does the output miss counts? This is…...

Members Only Content

This content is for the members with any one of the following paid subscriptions:

30-Day-Java-JEE-Career-Training, 90-Day-Java-JEE-Career-Training, 180-Day-Java-JEE-Career-Training, 365-Day-Java-JEE-Career-Training, 60-Day-Java-JEE-Career-Training and 2-Year-Java-JEE-Career-Training

Want to evaluate the quality of the contents to see if they will add value to you?

Click Here and check the contents with Try.

Log In | Register
Posted in member-paid, What is wrong with this code?

02: ♥♦ What is wrong with this code? Heap Vs Stack, Thread safety & Synchronized

This post covers must know Java Multithreading basics – Heap Vs Stack, Thread-safety & Synchronization. When you have a multithreaded Java application, you need to code in a thread-safe manner. Java interviewers may ask you to detect thread-safety issues as discussed in “What is wrong with this code?“. 1.What is

Read more ›

Posted in Multithreading, What is wrong with this code?
Tags: ,

07: What is wrong with this code? Multithreading & locks

Q. What is wrong with the following Java code? Explain what does the following code do? Explain if there is anything wrong with the following code? If there is something wrong, how will you go about fixing it?

A. 1. Explanation a. The main thread gets implicitly created by…...

Members Only Content

This content is for the members with any one of the following paid subscriptions:

30-Day-Java-JEE-Career-Training, 90-Day-Java-JEE-Career-Training, 180-Day-Java-JEE-Career-Training, 365-Day-Java-JEE-Career-Training, 60-Day-Java-JEE-Career-Training and 2-Year-Java-JEE-Career-Training

Want to evaluate the quality of the contents to see if they will add value to you?

Click Here and check the contents with Try.

Log In | Register
Posted in member-paid, What is wrong with this code?

Q16-Q24 written test questions and answers on core Java

Q16. If there is a source array list with 15MB of data, and the you create a new target empty array list and copy the source to target with target.addAll(source). How much memory will be consumed after invoking the addAll(…) method? A16. The memory will still be 15MB because Java…...

Members Only Content

This content is for the members with any one of the following paid subscriptions:

30-Day-Java-JEE-Career-Training, 90-Day-Java-JEE-Career-Training, 180-Day-Java-JEE-Career-Training, 365-Day-Java-JEE-Career-Training, 60-Day-Java-JEE-Career-Training and 2-Year-Java-JEE-Career-Training

Want to evaluate the quality of the contents to see if they will add value to you?

Click Here and check the contents with Try.

Log In | Register
Posted in member-paid, Written Test Core Java

03: Scenarios based Java OO concepts & GoF design patterns – Strategy Pattern

The following post improves on the design flaws listed in the previous post entitled 02: Scenarios based Java OO design & GoF design patterns – naive Template Method pattern. Scenario: A company named XYZ Retail is in the business of selling Books, CDs and Cosmetics. Books are sales tax exempt…...

Members Only Content

This content is for the members with any one of the following paid subscriptions:

30-Day-Java-JEE-Career-Training, 90-Day-Java-JEE-Career-Training, 180-Day-Java-JEE-Career-Training, 365-Day-Java-JEE-Career-Training, 60-Day-Java-JEE-Career-Training and 2-Year-Java-JEE-Career-Training

Want to evaluate the quality of the contents to see if they will add value to you?

Click Here and check the contents with Try.

Log In | Register
Posted in Designing your classes & interfaces, member-paid

02: Scenarios based Java OO concepts & GoF design patterns – naive Template Method pattern

Extends Can you design classes & interfaces using OO?. Only experience, and asking the right questions can teach you what design pattern to use, in which scenario. Scenario: A company named XYZ Retail is in the business of selling Books, CDs and Cosmetics. Books are sales tax exempt and CDs

Read more ›

Posted in Designing your classes & interfaces

13: Atomicity, Visibility, & synchronization in Java

Q. Given the following code, Client

Service interface & implementation

the line “XXX expensive call to a legacy system” in the “ServiceImpl” is an external call to a legacy system, which breaks when more than 5 concurrent calls are made. In other words, the “SLA (i.e. Service…...

Members Only Content

This content is for the members with any one of the following paid subscriptions:

30-Day-Java-JEE-Career-Training, 90-Day-Java-JEE-Career-Training, 180-Day-Java-JEE-Career-Training, 365-Day-Java-JEE-Career-Training, 60-Day-Java-JEE-Career-Training and 2-Year-Java-JEE-Career-Training

Want to evaluate the quality of the contents to see if they will add value to you?

Click Here and check the contents with Try.

Log In | Register
Posted in ♦ Complete the given code, member-paid

12: Complete the trades matching logic

Q. Given the following code

Fill in required code in the “//********** TO BE COMPLETED *************” section within the “match(Trade trade)” method and in the variables declaration section at the top. Assume that this object is only accessed by a single thread. The requirements are 1) Two trades can…...

Members Only Content

This content is for the members with any one of the following paid subscriptions:

30-Day-Java-JEE-Career-Training, 90-Day-Java-JEE-Career-Training, 180-Day-Java-JEE-Career-Training, 365-Day-Java-JEE-Career-Training, 60-Day-Java-JEE-Career-Training and 2-Year-Java-JEE-Career-Training

Want to evaluate the quality of the contents to see if they will add value to you?

Click Here and check the contents with Try.

Log In | Register
Posted in ♦ Complete the given code, member-paid
Page 1 of 1312345678910...Last »

800+ Interview Q&As ♥Free|♦FAQ (Mouse Hover for Full Text)

open all | close all

200+ Java FAQs – Memory Joggers

open all | close all

16 Java Key Areas to be a top-notch

open all | close all

80+ Java Tutorials – Step by step

open all | close all

100+ Java Coding Exercises

open all | close all

How good are your "Career Skills"?

open all | close all