Java - Interview Questions and Answers for AT&T - Software Developer

Q1.  What bean scopes does Spring support? Explain them.

Ans. The Spring Framework supports following five scopes -

Singleton
prototype 
request
session 
global-session

Q2.  What is bean auto wiring?

Ans. The Spring container is able to autowire relationships between collaborating beans. This means that it is possible to automatically let Spring resolve collaborators (other beans) for your bean by inspecting the contents of the BeanFactory without using <constructor-arg> and <property> elements.

Q3.  What are the pre-requisite for the collection to perform Binary Search ?

Ans. 1. Collection should have an index for random access.
2. Collection should have ordered elements.

Q4.  What are RESTful Web Services ?

Ans. REST or Representational State Transfer is a flexible architecture style for creating web services that recommends the following guidelines - 

1. http for client server communication, 
2. XML / JSON as formatiing language , 
3. Simple URI as address for the services and, 
4. stateless communication. 


Q5.  What is the difference between namenode and datanode in Hadoop? 

Ans. NameNode stores MetaData (No of Blocks, On Which Rack which DataNode is stored etc) whereas the DataNode stores the actual Data.

Q6.  Write a program to see if the number is prefect number or not ?


Q7.  Difference between a Pointer and a Reference ?

Ans. We can't get the address of a reference like a pointer. Moreover we cannot perform pointer arithmetic with references.

Q8.  Difference between TCP and UDP ?


Q9.  What things you would care about to improve the performance of Application if its identified that its DB communication that needs to be improved ?

Ans. 

1. Query Optimization ( Query Rewriting , Prepared Statements )
2. Restructuring Indexes.
3. DB Caching Tuning ( if using ORM )
4. Identifying the problems ( if any ) with the ORM Strategy ( If using ORM )


Q10.  Explain Singleton Design Pattern ?


Q11. Explain and Write Program for Selection and Bubble Sort ?


Q12. Explain and Write Program for Binary search ?