Multithreading Interview Question-1

Question 1. What is Thread in java? Answer. Threads consumes CPU in best possible manner, hence enables multi processing. Multi threading reduces idle time of CPU which improves performance of application. Thread are light weight process. A thread class belongs to java.lang package. We can create multiple threads in java,…

Continue reading

Bean lifecycle and CallBack Methods in Spring

Following is sequence of a bean lifecycle in Spring: Instantiate– First the spring container finds the bean’s definition from the XML file and instantiates the bean.. Populate properties– Using the dependency injection, spring populates all of the properties as specified in the bean definition.. Set Bean Name– If the bean…

Continue reading

Java Memory and Performance Interview Questions

This post is a compilation of many useful articles available on Internet.Their references can be found at the end of the post. Java Memory and Performance Improvement tips: How would you improve performance of a Java application? Pool valuable system resources like threads, database connections, socket connections etc. Emphasize on…

Continue reading

Race condition in Java multi-threading

Race condition occurs in a multi-threaded environment when more than one thread try to access a shared resource (modify, write) at the same time. Note that it is safe if multiple threads are trying to read a shared resource as long as they are not trying to change it. Since…

Continue reading

Spring-Interview-Preparation

Spring: (WHAT/WHEN/HOW/WHY) What is Spring? It is a lightweight, loosely coupled and integrated framework for developing enterprise applications in java. Spring Framework is built on top of two design concepts – Dependency Injection and Aspect Oriented Programming.  Why use Spring.(Features/Advantages) Whyto use spring is something more of a combination of…

Continue reading

FAQ-Linux Commands -2

The 15 Most Important UNIX commands man – show manual for a command, example: man ls hit q to exit the man page. cd – change directory, example: cd /etc/ ls – list directory, similar to dir on windows. example: ls /etc, use ls -l /etc to see more detail…

Continue reading

FAQ-Linux Commands -1

1. tar command examples Create a new tar archive. $ tar cvf archive_name.tar dirname/ Extract from an existing tar archive. $ tar xvf archive_name.tar View an existing tar archive. $ tar tvf archive_name.tar 2. grep command examples Search for a given string in a file (case in-sensitive search). $ grep…

Continue reading

Interview Question and Answer on Threading-2

1. What do we understand by the term concurrency? Concurrency is the ability of a program to execute several computations simultaneously. This can be achieved by distributing the computations over the available CPU cores of a machine or even over different machines within the same network. 2. What is the…

Continue reading

Sql server important queries

Query to find the second highest salary from employe table SELECT TOP 1 salary FROM ( SELECT DISTINCT TOP 2 salary FROM employe ORDER BY salary DESC) a ORDER BY salary ;   OR SELECT max(salary) FROM Employe WHERE salary NOT IN ( SELECT max(salary) FROM Employe); Query to find…

Continue reading

Differences between

Difference between SQL Truncate & SQL Delete 1. TRUNCATE is a DDL (Data Definition Language) command and DELETE is a DML (Data Manipulation Language) command. 2. You can use WHERE clause with DELETE but not with TRUNCATE . 3. You cannot rollback data in TRUNCATE but in DELETE it is…

Continue reading