Total Pageviews

Showing posts with label Interview Questions. Show all posts
Showing posts with label Interview Questions. Show all posts

Tuesday, 19 August 2014

Questions on Java

Friends , here is my first attempt , the SCJP book by Kathy has given me few questions ,  I would like to enrich it further , but time for a first cut

OOPS, Java

·         Is Java compiled or interpreted?
·         How can we declare two public classes in a Java source file?
·         Is there a restriction on naming the source file?
·         Give an example of code statement, where do while and while will give different output?
·         What is the default access, if we do not specify any access modifiers?
·         How method overloading and method overriding is different?
·         Give example of a non access modifier?
·         Why should some classes or methods be marked as final? 
·         How the abstract class is different from an interface as far as abstract methods are concerned?
·         How garbage collection works in C# and Java ?
·         What is boxing and Unboxing ?
·         How can we implement threads ?
·         What are the different states of a thread ?
·         What is a web service?  How this is related with SOAP, UDDI and WSDL?
·         What are the different ways to maintain state in a web application , relative advantage and disadvantages ? ( Hint : Session Variable, Cookies , Hidden Fields , Query String ) . For .Net view state is important.
·         What is MVC Architecture ?
·         Explain 3- tier Architecture ?
·         Explain Service oriented architecture
·         What is the difference between default and package access modifier
·         Let’s say Class A has a private method called fun() , class B extends Class A and defined fun() , what this phenomenon is called ?
·         What is the use of Final Keyword ?  Can we declare a variable as final ?
·         Is it possible to define a abstract class , with non abstract member s?
·         When should we use an arraylist in place of an array?
·         What is the method that can be used to traverse an arraylist?
·         What is checked and unchecked exception ?  Give example of both type of exceptions.
·         How to use your own exception , so let’s say you are taking age as an input and you want to throw an exception when it is less than zero, how will you achieve it ?
·         Give some example of statements that should be put in finally ?
·         Does Java allow multiple inheritance  ?  What is ‘Deadly Diamond of Death”
·         Class A
{
    public void fun()
 { 

}
}

Class B extend A
{
   Protected void fun()
}

Is there a problem in the above code ?

·         Give an example how polymorphism can be achieved using method overriding?
public int foo()
{
char c = ‘c’;
return c
}
Is this code legal ?
·         What is default constructor supplied by the compiler ? Is there any caution , that you need to follow when you create your own constructor,  will the default constructor be supplied in the following case

class Horse()
{
    void Horse ()
}

·         Which variables are in stack , which are stored in heap ?
·         What do we mean by saying strings are immutable objects ?   what is role of ‘String Constant Pool” . Which classed do we use to overcome the limitations of string ?





Wednesday, 4 September 2013

DBMS : few questions for freshers

Hello , once you are ready with the 'HR' type of questions , (you can take a look at some of the questions and answers at HR questions)  it is obviously important for getting ready for the technical and one of the subjects ,  and DBMS is one of the leading ones from both the parties. So I pen down few DBMS questions, this are all indicative ones , just to give you an idea on the depth and breadth. Normalization, Transactions , SQL and Indexing ,  I have seen to be all time favorites.

Feel free to give your comments , post answers , more questions , any other feedback.

Imagining you guyz are reading this because of your impending campus , read smartly , fine balancing with enjoying life , work on a plan and you will be partying in time :)

DBMS :
General


  1.    What is OLAP and OLTP?
  2.    What are the advantages of DBMS over file system? ( Do not forget key ones like transaction , normalization,  indexing , locking , logging etc. )
  3.     Why RDBMS called RDBMS ? Stress on the relational part.
  4.     Draw an ER Diagram for the project you did ? 
  5.    .What is the degree of a relationship? Does relationships always needs a table ?
  6.      How do you achieve generalization and specialization in an ER?

Normalization

  1.      Why do we normalize?
  2.      What are the different anomalies?
  3.      Why do we denormalize ?
  4.      Give an example of a table , which is not in 3 NF , explain diffrent anomalies in that context ,  tell how you will make it normalized



Transaction

  1. What is a transaction?
  2. What is ACID property? Explain each one with example.
  3. How the durability property is implemented ?
  4. How do you implement a transaction from a programming language like C# or java?
  5.  Can a transaction be partially committed ?
  6. What is locking , what is two phase locking ?
  7. What is seralizability ? 

Integrity 


  1. What are different type of constraints ?
  2. What is primary key , foreign key , candidate key ?
  3. What is unique , Check constrains 
  4. Difference between a primary key and unique constraint ?
  5. Is it possible to create a table with out a primary key ?
1

Indexing:

  1.  Why do we use index?
  2. What are the overheads of index?
  3. What is the difference between clustered index and a non-clustered index ?
  4.  What is the difference between B Tree and B+ Tree
  5.  Another way of asking the same question , what are the diffrent data structures that are used 

SQL:
  1.  What is difference between a function and stored procedure ?
  2.  What is cursor ?  What are the different types of cursor in oracle ?
  3. What are the different indices that oracle support?’ ( Special focus on bitmap indices)
  4. What is the difference on where and having clause ? 
  5. Questions on NULL
  6. What is the difference between char data type and varchar data type?
  7. What is a view?  What is materialised view?  Why they are used?What are different types of joins , what is difference between a Cartesian product and a full outer join ( Practise this with few examples )
  8. What is the function of UNION ?  Is it different from UNION ALL? 
  9.  What is DDL and DML,  how truncate is different from Delete
  10. Where will you use trigger , what are the different types of trigger ?
  11. Why do we create packages ?
  12. How do we handle exceptions?
  13. What is the role of dual ?
  14. If two tables have PK - FK relationship and you want when the PK gets deleted , the FK entries also gets deleted , how do you do that ?
  15. Why and how do you create sequences?
  16. How can you delete dupicate data from a table ?
3