Software Engineer Interview Questions for entry and Mid Level – Part3


Introduction


This post will have most important interview questions which used to ask in most of the reputed companies like Google, Amazon, NetApp, Wells Fargo, Wipro, Infosys, TCS, SAP etc.
We are just adding Questions to this post and the technical reader will post the answers using comments sections.
We will provide all questions with a proper explanation later in the separate post and will link to this post.

Hope reader will enjoy the post and helps us to get the proper answers.

Please follow below section for the list of questions –


  • How to implement distributed transaction.

  • How to implement transaction using JDBC.

  • What are the isolation levels in for database locking.

  • What are the types of database locking

  • Concept of index

  • How many types of index(clustered , non clustered)

  • What is ORM tool.

  • Implicit objects in JSP

  • Difference between jsp and servlet

  • Implicit modifiers for member variables of Interface and abstract class

  • What to use abstract class or interface.

  • Design a class model for an Ineventory management system of vehicles like car,bike,scooter,truck etc.

  • Which return will get invoked when exception occurs in try block and when exception does not occur.

try{

return 1;

}catch(Exception e){

Return 2;

}finally{

Return 3;

}


  • How to implement immutable objects and why ?

  • What is finalize method and when invoked?

  • Can finalize method be overloaded? If so will it get invoked by JVM?

  • Can final methods be overloaded?

  • Thread synchronization concept details.

  • What is thread group?

  • About the project previously worked upon.

  • Design pattern used in the project. Explanation of the same.

  • Difference between XSD & DTD

  • Scenario:

Class A{           |          classB{

M1();   |                      M3();

M2();   |                      M4();

}                       |          }

Now Design a new class C which has got behavior of both A & B without changing the classes A & B. Write code for ClassC


  • Scenario:

Given some elements, need to have all elements present uniquely in some data structure. As well, need to have a method exposed which returns data structure in sorted format based on the input string parameter value sent to the method.

Code snippet for the same.


  • Scenario:

There is some XML which external system sends to our system. It has got a tag whose values can vary between any of 50 different values we know. Out of these 50 values, if we get first 10 values then we need to send the XML to Formatter A, for next 20 , we need to send XML to Formatter B, & the remaining 20 values to Formatter C. This can be achieved by reading value from the tag & having an If condition which checks the value present in the tag with 50 String constants we have, however having an if condition this way is a crude approach. What is the better approach to suffice this?


  • Many Questions related to utility class “Collections”

  • Scenario:

There is some similar functionality which is provided by some classes, however they differ with the approach, based on few conditions, I knew which class to invoke, how do I suffice this need.

Ans: This can be sufficed by either interface pattern or thru Reflection API.

Code snippet for above.


  • There are two tables T1(Eid,Ename,………), T2(Eid,university……). Both these tables have only Eid in common. There are no referential integrity constraints available. I need all columns to be viewed in T1 table whose Eid has studied in university (IIIT Allahabad & JNTU)? What are different ways to write the query & which query gives better in performance?

  • How does a hashmap work?

  • How do u override equals and hashcode methods?

  • What is the difference between overload and override?

  • What is string and stringbuffer?difference between them?

  • How do u implement threads?

  • What is singleton pattern?how do u implement it?

  • What is factory pattern?

  • Difference between PATH and CLASSPATH. How do u set them?

  • Unix commands. What is ls command? What is “ls –la”?

  • Employee table

Name  deptid  salary                                      deptid              name

——————————                                               ———————————–

Xxx       tech     100                                          tech                 technology

Xxx       tech     200                                          hr                     human resource

Xxx       hr         300

Xxx                   400

  • Write a query to get unique rows. Display the name of the employee and the sum of the salay department wise
  • Write a query to get employee name and department name
  • Same as question 1 , but also get the row with deptid as null

  • What are threads?how do u implement them?explain with example

  • What are the advantages and disadvantages of the two ways of creating threads?

  • Where are wait(),notify() and yield() present?

  • Explain wait() and notify() with example

  • Explain synchronized keyword with example

  • Explain inheritance with example

  • Can u modify the access modifiers while overriding a method in a subclass?

  • What are the rules for handling exceptions while overriding a method in a subclass?

  • Explain static keyword

  • Explain all joins with example

  • Unix commands(ps,cat,grep,crontab)

  • How do u make a deamon process in linux?

  • How do u create singleton class?example

  • Explain ACID

  • Significance of foreign key

  • How do u achieve performance tuning on database?

  • What are indexes?its advantages and disadvantages?types?

  • What is hibernate?how does it work?advantages?

  • How do u create joins on tables in hibernate?

  • What are checked and unchecked exceptions?

  • What is JMS?

  • What is Scheduling Tools

  • Concurrency package in Java

  • Shell Scripting

  • EJB

  • XML and XSD

  • Discussion about the previous project and my role in that.

  • What all data structures you know? Given a Linked List write an algorithm to reverse the list.

  • There is one thread which prints even numbers other prints odd. Synchronize both to print numbers in sequence.

  • What are Equals () and hashcode () methods.

  • Given a string by the user, tell which character occurs max no of times and how many times.

  • What are Class loaders, what is there hierarchy and why would someone write his own class loader.

  • Singleton pattern

  • What are Indexes? How they help in improving the performance.

  • Types of indexes?

  • Difference between Equals method and ==.

  • Can we find out how may tables and there columns type in the database using JDBC.

  • Types of drivers.

  • Write a page about the “What you have been doing since the last one year and how it helped you in growing technically”.

  • Write an E-mail to the head (in New York) about the status of the project.

  • There is an array of length 1000 which has 1000 integers. All integers are in the sequence like 1,2,3, … about 999 integers and one more which is duplicate of any one existing. Write the algorithm to find that duplicate entry. The array is not in the sorted order.

  • There is a table which has employee name and department name. Find the department which has employees more than 20

  • Explain about your previous project

  • What is application server

  • How do you manage sessions

  • How does application server manage session time out

  • Father

Son1     Son2

Son3      Son4

DB Design for data like above

Class design for data like above


  • Date class à Pass a string as 01-01-2009 IST & 0ther as 01-01-2009 EST. how do u compare these two dates. Many questions on Date API.

  • I have a string “abbbscaaas”, Need to find out the first non repeating character.

  • About previous projects

  • Design a class to retrieve employees starting with Manager followed by his subordinates

  • What is ORM

  • Design a mechanism to cache the Employee objects. However the cached employee objects should’nt have any mechnism to change the state. However the state of the employee objects can be changed only by the mechanism which is caching the objects. As well I should prevent client classes which is using my cached employee objects from doing new employee()

  • I have two lists, I need to merge them. However I want to ensure that there are no duplicates in that post merging.

  • What are Db indexes?

  • Explain Different types of indexes.

  • I have a table containg data of employee assignments like

EMPID        Department    Date

1                                  D1                    01/01/2008

1                                  D2                    01/02/2008

1                                  D2                    01/05/2008

1                                  D2                    01/09/2008

1                                  D3                    01/01/2009

1                                  D4                    01/07/2009

1                                  D1                    01/09/2009

1                                  D2                    01/11/2009

Need to find out only those records where in employee had changed his department from his previous department. Write an sql query for this.


  • Tell me about your previous project.

  • Define B-Tree Data Structure in Java

 

Leave a Reply

Your email address will not be published. Required fields are marked *