Interview Questions and Answers for 'Fidelity' | 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 for 'Fidelity' - 23 question(s) found - Order By Newest

Advanced level question. Frequently asked in High end product companies. Frequently asked in Google , Cognizant and Deloitte ( Based on 2 feedback )
  Q1. Why is String immutable in Java ?Core Java
Ans. 1. String Pool - When a string is created and if it exists in the pool, the reference of the existing string will be returned instead of creating a new object. If string is not immutable, changing the string with one reference will lead to the wrong value for the other references.

Example -

String str1 = "String1";
String str2 = "String1"; // It doesn't create a new String and rather reuses the string literal from pool

// Now both str1 and str2 pointing to same string object in pool, changing str1 will change it for str2 too

2. To Cache its Hashcode - If string is not immutable, One can change its hashcode and hence it's not fit to be cached.

3. Security - String is widely used as parameter for many java classes, e.g. network connection, opening files, etc. Making it mutable might possess threats due to interception by the other code segment.

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

   Like         Discuss         Correct / Improve     java   oops   string   string class   immutable  immutability   advanced     Asked in 39 Companies      expert        frequent

Try 4 Question(s) Test


Very frequently asked in different variations. Frequently asked in Deloitte ( 2 feedback ) , HCL Tech ( 3 feedback ), TCS and Coginizant (CTS)
  Q2. Explain the scenerios to choose between String , StringBuilder and StringBuffer ?

or

What is the difference between String , StringBuilder and StringBuffer ?
Core Java
Ans. If the Object value will not change, use String Class because a String object is immutable.

If the Object value can change and will only be modified from a single thread, use StringBuilder because StringBuilder is unsynchronized(means faster).

If the Object value may change, and can be modified by multiple threads, use a StringBuffer because StringBuffer is thread safe(synchronized).

  Sample Code for String

  Sample Code for StringBuffer

  Sample Code for StringBuilder

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

   Like         Discuss         Correct / Improve     java   string class   string   stringbuilder   stringbuffer   String vs StringBuffer   String vs StringBuilder   String vs StringBuilder vs StringBuffer   StringBuffer vs stringBuilder     Asked in 29 Companies      basic        frequent

Try 3 Question(s) Test


  Q3. 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


Recently asked in TCS , Tech Mahindra, HCL , Accenture and Fidelity.
  Q4. Explain Flow of Spring MVC ?Spring
Ans. The DispatcherServlet configured in web.xml file receives the request.

The DispatcherServlet finds the appropriate Controller with the help of HandlerMapping and then invokes associated Controller.

Then the Controller executes the logic business logic and then returns ModeAndView object to the DispatcherServlet.

The DispatcherServlet determines the view from the ModelAndView object.

Then the DispatcherServlet passes the model object to the View.

The View is rendered and the Dispatcher Servlet sends the output to the Servlet container.

Finally Servlet Container sends the result back to the user.

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

   Like         Discuss         Correct / Improve     j2ee   spring   mvc   frameworks   web applications   architecture     Asked in 11 Companies      Basic        frequent


Frequently asked in Infosys India
  Q5. What is a String Pool ?Core Java
Ans. String pool (String intern pool) is a special storage area in Java heap. When a string is created and if the string already exists in the pool, the reference of the existing string will be returned, instead of creating a new object and returning its reference.

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

   Like         Discuss         Correct / Improve     java   oops   string   string class   string pool   heap memory     Asked in 31 Companies      intermediate        frequent

Try 2 Question(s) Test


Very Frequently asked to fresh graduates and less experienced. Favorite question in Walk in drives. Frequently asked in Indian Services companies.
  Q6. Difference between Overloading and Overriding ?Core Java
Ans. Overloading - Similar Signature but different definition , like function overloading.

Overriding - Overriding the Definition of base class in the derived class.

  Sample Code for overloading

  Sample Code for overriding

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

   Like         Discuss         Correct / Improve     java   oops   overloading   overriding   oops concepts   basic interview question   overloading vs overriding     Asked in 86 Companies      basic        frequent

Try 1 Question(s) Test


Very frequently asked.Usually among first few questions.
  Q7. What is MVC ? Design
Ans. MVC is a Design Pattern that facilititates loose coupling by segregating responsibilities in a Web application

1. Controller receives the requests and handles overall control of the request
2. Model holds majority of the Business logic, and
3. View comprise of the view objects and GUI component

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

   Like         Discuss         Correct / Improve     j2ee   mvc   mvc design pattern   design pattern   struts   spring   web application   web frameworks   ebay     Asked in 60 Companies      basic        frequent

Try 1 Question(s) Test


 Q8. What is HTTP ?Java EE
Ans. HTTP or Hypertext Transfer Protocol is internet protocol for tranmission of hypertext ( text with meta data ) over internet.

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

   Like         Discuss         Correct / Improve     j2ee   http   internet  fidelity     Asked in 2 Companies      basic        frequent


 Q9. What bean scopes does Spring support? Explain them.Spring
Ans. The Spring Framework supports following five scopes -

Singleton
prototype
request
session
global-session

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

   Like         Discuss         Correct / Improve     j2ee   spring   mvc   frameworks   web applications   beans   beans scope   at&t  fidelity


Very frequently asked in HCL Tech ( Based of 4 inputs )
  Q10. Write a program to reverse a string iteratively and recursively ?Core Java
Ans. Using String method -

new StringBuffer(str).reverse().toString();

Iterative -

public static String getReverseString(String str){
StringBuffer strBuffer = new StringBuffer(str.length);
for(int counter=str.length -1 ; counter>=0;counter--){
strBuffer.append(str.charAt(counter));
}
return strBuffer;
}

Recursive -

public static String getReverseString(String str){
if(str.length <= 1){
return str;
}
return (getReverseString(str.subString(1)) + str.charAt(0);
}

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

   Like         Discuss         Correct / Improve     java   string   reverse   stringbuffer   string class   code     Asked in 6 Companies        frequent


Very frequently asked Hibernate interview question. Frequently asked in TCS ( based on 2 feedback )
  Q11. What are different types of associations in Hibernate ?Hibernate
Ans. There are 4 types of associations in Hibernate

One to One
One to Many
Many to One
Many to Many

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

   Like         Discuss         Correct / Improve     hibernate   associations     Asked in 11 Companies        frequent


 Q12. What are design situations to use Singleton and Prototype Design Pattern ?Design
Ans. Both are creational design patterns.

Singleton is used when we would like to reuse an object if object is not supposed to hold request or thread specific information. Inversely Prototype is used in situations where we would like to reuse the object information but the request / thread may require it own data to be persisted.

In short, Singleton is used in situations where we can live with single object being shared across multiple requests or threads whereas Prototype is used when we need duplicate copies of objects.

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

   Like         Discuss         Correct / Improve     design pattern  singleton  prototype  creational design pattrn     Asked in 7 Companies      expert

Try 1 Question(s) Test


Very Frequently asked to Senior Software Engineers or Developers.
  Q13. Describe some of the Design Patterns you have used ?Design
Ans. [Open Ended Answer]

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

   Like         Discuss         Correct / Improve     design patterns     Asked in 17 Companies      intermediate        frequent


 Q14. 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


 Q15. What is concurrent interface ?Core Java
Ans. ConcurrentMap is an interface and it is a member of the Java Collections Framework. It represents a Map that is capable of handling concurrent access to it without affecting the consistency of entries in a map. ConcurrentMap interface present in java.util.concurrent package.

HashMap operations are not synchronized, while Hashtable provides synchronization. Though Hashtable is thread-safe, it is not very efficient. To solve this issue, the Java Collections Framework introduced ConcurrentMap in Java 1.5.

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

   Like         Discuss         Correct / Improve     Concurrent Interface   java.util.concurrent   Java 8 Concurrency   java concurrency   java 8     Asked in 1 Companies


 Q16. What are the different types of inheritance in Hibernate ?Hibernate
Ans. Table Per Class , Table per Sub Class , Table per Concrete Class

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

   Like         Discuss         Correct / Improve     hibernate   orm   inheritance hibernate     Asked in 1 Companies      Basic        frequent


Very frequently asked. Usually followed by questions related to private constructor and synchronized access. Frequently asked in JPMorgan and TCS (Based on 2 feedback)
  Q17. Explain Singleton Design Pattern ?Design
Ans. http://www.buggybread.com/2014/03/java-design-pattern-singleton-interview.html

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

   Like         Discuss         Correct / Improve     java   design pattern   singleton   at&t   ebay  fidelity india  united healthcare india     Asked in 46 Companies      intermediate        frequent


 Q18. What is the difference between ServletConfig and ServletContext ?Java EE
Ans. http://www.java4s.com/java-servlet-tutorials/difference-between-servletconfig-and-servletcontext-in-java/

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

   Like         Discuss         Correct / Improve     ServletConfig  ServletContext     Asked in 1 Companies


 Q19. What is Spring Security ?Spring
Ans. Spring Security is a powerful and highly customizable authentication and access control framework. It is the de facto standard for securing Spring-based applications.

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

   Like         Discuss         Correct / Improve          Asked in 3 Companies


 Q20. Is there any relationship between Web.xml and Spring.xml ?Spring
Ans. No, there is no relationship between web.xml and spring.xml but you have to configure spring.xml in web.xml in order initialize beans when application starts up

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

   Like         Discuss         Correct / Improve     spring  web.xml  spring.xml  deployment descriptor     Asked in 1 Companies


 Q21. Can you write the code for implementing the one to many (student -> courses) relationship in hibernate?Hibernate
Ans. @OneToMany(cascade = CascadeType.ALL)
@JoinColumn(name = "student_id")
private Set countries;

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

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q22. Can you explain software design principles cohesion and coupling with an example?Design
 This question was recently asked at 'Fidelity Information Services (FIS)'.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     cohesion  coupling     Asked in 1 Companies        frequent


 Q23. Give an example of a time when you recommended code changes in a code review that simplified the code ?Code Review
Ans. If there is a situation to remove duplicates values from an arrayList. Developer implemented using legacy for-loop where I suggested to use Linked hash set to remove duplicates from the list.

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

   Like         Discuss         Correct / Improve     Clean code     Asked in 3 Companies



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: