Interview Questions and Answers for 'Hcl' | Search Interview Question - javasearch.buggybread.com
Javasearch.buggybread.com

Search Interview Questions


 More than 3000 questions in repository.
 There are more than 900 unanswered questions.
Click here and help us by providing the answer.
 Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company      Label / Company / Text

   



Interview Questions and Answers - Order By Rating

   next 30
 Q31. What is the difference between TreeSet and TreeMap ?Core Java
Ans. TreeSet contains only values as elements whereas TreeMap contains Key value pairs.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     reeMap  TreeSet  Collections  sorted collection     Asked in 1 Companies        rare


 Q32. What is setter injection ?Spring
Ans. Setter Injection in Spring is a type of dependency injection in which the framework injects the dependent objects into the client using a setter method.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     setter injection   dependency injection     Asked in 2 Companies


 Q33. Sort a List of Objects using comparable and comparatorCore Java
 This question was recently asked at 'HCL Technologies'.This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q34. What methodology and technology stack do you use ?General
Ans. [Open Ended Answer]

Possible Answer - We are using Agile. We have daily standups, Bi weekly Backlog Grooming , Planning and Retrospective, We have a 2 week sprint and We use Jira for Scrum Management. We are using Java 8, Spring Boot, JSF , Apache Kafka , Soap as well as Rest Services.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 9 Companies


 Q35. What is garbage collection ?Core Java
Ans. The garbage collection is a facility wherein a program runs on the Java Virtual Machine which gets rid of objects, which are not being used by a Java application anymore. It is a form of automatic memory management and recollection.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 4 Companies


 Q36. Do you like your work in current project ?
 This question was recently asked at 'HCL Technologies'.This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q37. Why do you want to leave your current job ?General
Ans. The most effective and acceptable reasons for leaving your current job should be positive e.g. moving forward in your life or career

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 21 Companies


 Q38. What is your role in current project ?General
Ans. Possible Answer - Java Developer

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 5 Companies


  Q39. What is collection framework in Java ?Core Java
Ans. The Java collections framework (JCF) is a set of classes and interfaces that implement commonly reusable collection data structures. Although referred to as a framework, it works in a manner of a library. The JCF provides both interfaces that define various collections and classes that implement them.

  Sample Code for Map

  Sample Code for HashMap

  Sample Code for Treemap

  Sample Code for set

  Sample Code for hashset

  Sample Code for treeset

  Sample Code for list

  Sample Code for arraylist

  Sample Code for linkedlist

  Sample Code for queue

  Sample Code for priorityqueue

  Sample Code for concurrenthashmap

  Sample Code for vector

  Sample Code for stack

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     collections     Asked in 9 Companies      basic        frequent


 Q40. what is fail fast and Fail Safe in collections?Core Java
Ans. Iterators in java are used to iterate over the Collection objects.

Fail-Fast iterators immediately throw ConcurrentModificationException if there is any addition, removal or updation of any element.

Fail-Safe iterators don't throw any exception if a collection is structurally modified while iterating over it. This is because, they operate on the clone of the collection and not on the original collection.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     ail fast   fail saf     Asked in 9 Companies      intermediate


Frequently asked in Genpact.
 Q41. What is object cloning ?Core Java
Ans. Its is the process of creating exact copy of an object being cloned. In Object class one native method called clone() is there which is meant for Shallow Cloning of Object. Shallow cloning means bitwise copy of an object.In case of primitive data type it will create an exact copy of primitive values as well as variables but if the object contains any reference of an object then it will not copy the referenced object rather it will create the copy of reference variable and assigned it to the old object.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     cloning     Asked in 3 Companies      basic        frequent


  Q42. Explain OOps concepts.Core Java
Ans. There are four main OOP concepts in Java. These are:

Abstraction. Abstraction means using simple things to represent complexity. We all know how to turn the TV on, but we don?t need to know how it works in order to enjoy it. In Java, abstraction means simple things like objects, classes, and variables represent more complex underlying code and data. This is important because it lets avoid repeating the same work multiple times.

Encapsulation. This is the practice of keeping fields within a class private, then providing access to them via public methods. It?s a protective barrier that keeps the data and code safe within the class itself. This way, we can re-use objects like code components or variables without allowing open access to the data system-wide.

Inheritance. This is a special feature of Object Oriented Programming in Java. It lets programmers create new classes that share some of the attributes of existing classes. This lets us build on previous work without reinventing the wheel.

Polymorphism. This Java OOP concept lets programmers use the same word to mean different things in different contexts. One form of polymorphism in Java is method overloading. That?s when different meanings are implied by the code itself. The other form is method overriding. That?s when the different meanings are implied by the values of the supplied variables. See more on this below.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     oops  oops concepts     Asked in 16 Companies      basic        frequent


 Q43. Difference between JVM, JRE and JDK ?Core Java
Ans. JDK(Java Development kit) = Development Kit comprising of JVM , library and development tools for developers

JRE (Java Run time Environment) - Comprise of JVM and set of libraries

JVM(Java Virtual Machine) = Interpreter which reads the .class file line by line.

When we install JDK, JRE also get installed so we can write,compile and excute our code. Used by developer. Without JDK we can only execute the program using JRE.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     jvm  jre  jdk  jvm vs jre vs jdk     Asked in 4 Companies


 Q44. What is abstraction ?Design
Ans. Abstraction is a process of hiding the implementation details and describing only the functionality to the user.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     bstraction  oops concepts  oops principle     Asked in 22 Companies


 Q45. What is the difference between SDLC and Agile ?Process
Ans. Here are the differences between Agile and Waterfall Methodology:

The software development process is divided into different phases in the Waterfall model while Agile methodology segregates the project development lifecycle into sprints

Waterfall is a structured software development methodology, and often times can be quite rigid, whereas the Agile methodology is known for its flexibility

According to the Waterfall model, software development is to be completed as one single project, which is then divided into different phases, with each phase appearing only once during the SDLC. However, the Agile methodology can be considered as a collection of many different projects, which are nothing but the iterations of the different phases focusing on improving the overall software quality with feedback from users or the QA team

If you want to use the Waterfall model for software development, then you have to be clear with all the development requirements beforehand as there is no scope of changing the requirements once the project development starts. The Agile methodology, on the other hand, is quite flexible, and allows for changes to be made in the project development requirements even after the initial planning has been completed

All the project development phases such as designing, development, testing, etc. are completed once in the Waterfall model while as part of the Agile methodology, they follow an iterative development approach.

As a result, planning, development, prototyping and other software development phases can appear more than once during the entire SDLC One of the major differences between Agile and Waterfall development methodology is their individual approach towards quality and testing.

In the Waterfall model, the Testing phase comes after the Build phase, but, in the Agile methodology, testing is typically performed concurrently with programming or at least in the same iteration as programming

While Waterfall methodology is an internal process and does not require the participation of customers, the Agile software development approach focuses on customer satisfaction and thus, involves the participation of customers throughout the development phase

The Waterfall model can be regarded as a stringently sequential process, however, the Agile methodology is a highly collaborative software development process, thereby leading to better team input and faster problem solving

The Waterfall model is best suited for projects which have clearly defined requirements and in which change is not expected at all, while Agile development supports a process in which the requirements are expected to change and evolve. Thus, if you are planning to develop a software that would require frequent overhauls and has to keep up with the technology landscape and customer requirements, Agile is the best approach to follow

The Waterfall model exhibits a project mindset and lays its focus strictly on the completion of project development, while Agile introduces a product mindset that focuses on ensuring that the developed product satisfies its end customers, and changes itself as the requisites of customers change

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     sdlc  agile  adlc vs agile     Asked in 3 Companies


 Q46. Which immutable classes have you worked with ? Can you name some immutable Collections ? How to make an immutable collection ?Core Java
Ans. string and wrapper class objects

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     immutability  immutable  immutability classes   immutable  immutability collections     Asked in 3 Companies


 Q47. Explain Generics in Java ?Core Java
Ans. Generics are a facility of generic programming that were added to the Java programming language in 2004 within J2SE5.0. They allow "a type or method to operate on objects of various types while providing compile-time type safety.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     generics     Asked in 7 Companies


 Q48. Write code to find second largest number in an array of integers.Core Java
Ans. int arr[]={1,3,5,6,4,8,9,2,10};
Arrays.sort();
System.out.println(arr[arr.length-1]);

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     code  coding  find in array     Asked in 1 Companies


 Q49. How to calculate lcm of two numbers ?Core Java
 This question was recently asked at 'HCL Tech'.This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     coding  code     Asked in 1 Companies


 Q50. Difference between constructor and setter injection ?Spring
Ans. 1. In Setter Injection, partial injection of dependencies can possible, means if we have 3 dependencies like int, string, long, then its not necessary to inject all values if we use setter injection. If you are not inject it will takes default values for those primitives1. In constructor injection, partial injection of dependencies cannot possible, because for calling constructor we must pass all the arguments right, if not so we may get error

2. Setter Injection will overrides the constructor injection value, provided if we write setter and constructor injection for the same property [i already told regarding this, hope you remember ] But, constructor injection cannot overrides the setter injected values

3. If we have more dependencies for example 15 to 20 are there in our bean class then, in this case setter injection is not recommended as we need to write almost 20 setters right, bean length will increase. In this case, Constructor injection is highly recommended, as we can inject all the dependencies with in 3 to 4 lines [i mean, by calling one constructor]

4. Setter injection makes bean class object as mutable [We can change ] .Constructor injection makes bean class object as immutable [We cannot change ]

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     spring  dependency injection   inversion of control     Asked in 3 Companies


  Q51. Explain OOPs

or

Explain OOPs Principles

or

Explain OOPs Concepts

or

Explain OOPs features

or

Tell me something about OOPs
Core Java
Ans. OOPs or Object Oriented Programming is a Programming model which is organized around Objects instead of processes. Instead of a process calling series of processes, this model stresses on communication between objects. Objects that all self sustained, provide security by encapsulating it's members and providing abstracted interfaces over the functions it performs. OOP's facilitate the following features

1. Inheritance for Code Reuse
2. Abstraction for modularity, maintenance and agility
3. Encapsulation for security and protection
4. Polymorphism for flexibility and interfacing

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     oops  oops features     Asked in 260 Companies      basic        frequent


 Q52. What is Amazon EC2 ?Amazon Web Services (AWS)
Ans. Amazon Elastic Compute Cloud or EC2 provides scalable computing capacity in the AWS cloud. It can be used to create Virtual Environments , storage and configure. EC2 enables to upgrade or downgrade infrastructure according to the rules defined ( with fluctuation in latency, traffic etc )

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     aws  aws ec2  aws computing  amazon cloud computing  amazon ec2  Elastic Compute Cloud  Amazon Elastic Compute Cloud     Asked in 2 Companies


 Q53. Is synchronized a keyword , modifier, identifier? what is it ?Core Java
Ans. synchronized is a keyword and a modifier. The synchronized keyword is used to indicate that a method can be accessed exclusively by one thread at a time.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     synchronization  synchronized  modifier  identifier     Asked in 2 Companies


 Q54. What is Amazon S3 ?Amazon Web Services (AWS)
Ans. Amazon Simple Storage Service or S3 is object storage with a simple web service interface to store and retrieve any amount of data from anywhere on the web.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     aws  amazon s3  aws s3  aws storage  amazon cloud storage  amazon s3     Asked in 12 Companies


Frequently asked Spring interview question.
 Q55. What are the components of Spring framework ?Spring
Ans. Core: [Core, Bean, Context, Expression Language]

Web: [Web, Portlet, Servlet, etc]

Data Access [JMS, JDBC, etc]

AOP, Aspect

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     spring  spring framework components     Asked in 12 Companies


 Q56. Write a Program to print duplicate words in a StringCore Java
Ans. public class BuggyBread {
public static void main(String args[]) {
String str = "we are what we repeatedly Do excellence, then, is not an act but a haBit";
Set<String> words = new HashSet();
for(String word:str.split(" ")){
if(words.contains(word)){
System.out.println(word);
} else {
words.add(word);
}
}
}
}

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q57. What are the different primitive data types in Java ?Core Java
Ans. boolean
byte
char
double
float
int
long
short
void

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     data types  primitive data types     Asked in 1 Companies      Basic


 Q58. How and Why Strings are interned in Java ?Core Java
Ans. String class has a public method intern() that returns a canonical representation for the string object. String class privately maintains a pool of strings, where String literals are automatically interned.

these are automatically interned so as to have efficient String comparison using == operator instead of equals which is usually slower.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     string  string pool  string intern     Asked in 1 Companies


  Q59. What is the difference between authentication and authorization ?Authentication
Ans. Authentication is the process of verifying the identity and credentials of the user to authenticate him into the system.

whereas

Authorization is the process by which access to a segment , method or resource is determined.

Authorization is usually a step next to authentication.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     authentication  authorization  authentication vs authorization     Asked in 9 Companies      basic        frequent


 Q60. Who invokes a thread's run method ?Core Java
Ans. After a thread is started using a call to start method, JVM invokes the thread’s run method when the thread is initially executed.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     threads  thread run method     Asked in 1 Companies


previous 30   next 30

Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked: