Search Interview Questions | ![]() ![]() Click here and help us by providing the answer. ![]() Click Correct / Improve and please let us know. |
|
| ||||
Interview Questions and Answers for 'Infosy' - 97 question(s) found - Order By Rating | ||||
![]() | ||||
| ||||
Ans. https://dzone.com/articles/10-tips-how-to-improve-the-readability-of-your-sof | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
| ||||
Ans. Base Class is a relative term. For example - Class Vehicle is a Base class of Class Car. Even though Base class is derived in this case , there is no restriction on instantiation of Vehicle class. Abstract Class is a class that is meant only to be a Base Class and not allowed to be instantiated. Abstract Class is a Base Class that isn't allowed to be instantiated and is only meant for carrying definition to derived class and help participate in runtime polymorphism. | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
| ||||
Ans. | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
| ||||
Ans. Every fresh session having its own cache memory, Caching is a mechanism for storing the loaded objects into cache memory. The advantage of cache mechanism is, whenever again we want to load the same object from the database then instead of hitting the database once again, it loads from the local cache memory only, so that the no. of round trips between an application and a database server got decreased. It means caching mechanism increases the performance of the application. In hibernate we have two levels of caching First Level Cache [ or ] Session Cache Second Level Cache [ or ] Session Factory Cache [ or ] JVM Level Cache | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
| ||||
Ans. Platform independent language means once compiled you can execute the program on any platform (OS). Java is platform independent. Because the Java compiler converts the source code to bytecode, which is Intermediate Language. Bytecode can be executed on any platform (OS) using JVM( Java Virtual Machine). | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
| ||||
Ans. Assigning a value of one type to a variable of another type is known as Type Casting. Example : int x = 10; byte y = (byte)x; In Java, type casting is classified into two types, Widening Casting(Implicit) widening-type-conversion and Narrowing Casting (Explicitly done) narrowing-type-conversion. Widening or Automatic type converion - Automatic Type casting take place when,the two types are compatible and the target type is larger than the source type Example : public class Test { public static void main(String[] args) { int i = 100; long l = i; //no explicit type casting required float f = l;//no explicit type casting required System.out.println("Int value " i); System.out.println("Long value " l); System.out.println("Float value " f); } } Narrowing or Explicit type conversion - When you are assigning a larger type value to a variable of smaller type, then you need to perform explicit type casting. Example : public class Test{ public static void main(String[] args) { double d = 100.04; long l = (long)d; //explicit type casting required int i = (int)l;//explicit type casting required System.out.println("Double value " d); System.out.println("Long value " l); System.out.println("Int value " i); } } | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
| ||||
Ans. Both Arrays and ArrayLists are used to store elements. Elements can be either primitives or objects in case of Arrays, but only objects can be stored in Arraylist. Array is a fixed length data structure while arraylist is variable length collection class. Once created, you cannot change the size of the arrays, but arraylists can dynamically resize itself when needed.Another notable difference between Arrays and Arrayslist is that arary is part of core java programming and array list is part of collection classes | ||||
![]() | ||||
![]() | ||||
![]() ![]() ![]() ![]() ![]() ![]() | ||||
| ||||
Ans. WEB APP |WEB-INF - META-INF | | | META-INF.MF | lib - WEB.xml - Classes | ||||
![]() | ||||
![]() ![]() ![]() ![]() ![]() ![]() | ||||
| ||||
Ans. No | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
| ||||
Ans. https://www.geeksforgeeks.org/arrays-sort-in-java-with-examples/ | ||||
![]() | ||||
![]() ![]() ![]() ![]() ![]() ![]() | ||||
| ||||
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. | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
| ||||
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. | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
| ||||
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. | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
| ||||
Ans. The most effective and acceptable reasons for leaving your current job should be positive e.g. moving forward in your life or career | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
| ||||
Ans. Possible Answer - Java Developer | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
| ||||
Ans. No, if required we should only have final variables. Bean scoped singleton means that only one instance of the bean will be created and will be shared among different requests and hence instance variables will get shared too. | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
| ||||
Ans. It is an architectural pattern that separates an application into three main logical components: the model, the view, and the controller. Each of these components are built to handle specific development aspects of an application | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
| ||||
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. | ||||
![]() | ||||
![]() ![]() ![]() ![]() ![]() ![]() | ||||
| ||||
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. | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
| ||||
Ans. Abstraction is a process of hiding the implementation details and describing only the functionality to the user. | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
| ||||
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 | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
| ||||
Ans. Prototype scope - A new object is created each time it is injected/looked up. It will use new SomeClass() each time. Singleton scope - It is the default scope. The same object is returned each time it is injected/looked up. Here it will instantiate one instance of SomeClass and then return it each time. | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
| ||||
Ans. ORM is the mapping technique, which maps object with relational data model. As we know that in java we need objects we can not user data in relational(in table form). So ORM is set of guideline which allows us to map relational data model in object form. | ||||
![]() | ||||
![]() ![]() ![]() ![]() ![]() | ||||
| ||||
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. | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
| ||||
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 | ||||
![]() | ||||
![]() ![]() ![]() ![]() ![]() ![]() | ||||
| ||||
Ans. Such a class still can have member elements which can be inherited and hence facilitate code reuse. Moreover Abstract class can have non final static elements whereas interfaces are only allowed to have static final elements. | ||||
![]() | ||||
![]() ![]() ![]() ![]() ![]() | ||||
| ||||
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. | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
![]() | ||||
| ||||
Ans. Core: [Core, Bean, Context, Expression Language] Web: [Web, Portlet, Servlet, etc] Data Access [JMS, JDBC, etc] AOP, Aspect | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
| ||||
Ans. Selenium WebDriver is a tool for automating web application testing.It helps in replicating the manual tester behavior like keyboard entry, mouse events etc and then matching the output against the expected. | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
| ||||
Ans. public class BuggyBread { public static void main(String args[]) { System.out.println(factorial(5)); } private static int factorial(int number){ if(number == 1){ return 1; } else { return number * factorial(number - 1); } } } | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
![]() | ||||