Monday 26 August 2013

IBM Technical Interview Questions for Freshers Recruitment.

IBM Technical Interview Questions for Freshers Recruitment.

1.What is the difference between C and Java?

     Answer :1.JAVA is Object-Oriented while C is procedural.
          2.Java is an Interpreted language while C is a compiled language.
          3.C is a low-level language while JAVA is a high-level language.
          4.C uses the top-down approach while JAVA uses the bottom-up approach.
          5.Pointer go backstage in JAVA while C requires explicit handling of pointers.
                        
2.What is the difference between array and pointer?
Answer : Pointer is a variable in a program is something with a name, the value of which can vary. The way the compiler and linker handles this is that it assigns
a specific block of memory within the computer to hold the value of that variable.
An array is a conceptual data representation consisting of a list of more than one item of a particular scalar type (int, float, char, structure, etc.) where each element is accessed by its index.

3.What is the difference between Strings and Arrays?
Answer : - String can hold only char data. Where as an array can hold any data type.
- An array size can not be changed. Where as a string size can be changed if it is a char pointer
- The last element of an array is an element of the specific type. The last character of a string is a null – ‘\0’ character.
- The length of an array is to specified in [] at the time of declaration (except char[]). The length of the string is the number of characters + one (null character).
4.What is Recursion Function?
Answer : a) A recursive function is a function which calls itself.
b) The speed of a recursive program is slower because of stack overheads. (This attribute is evident if you run above C program.)
c) A recursive function must have recursive conditions, terminating conditions, and recursive expressions.
5.What are abstract class?
Answer : An abstract class is a class which does not fully represent an object. Instead, it represents a broad range of different classes of objects. However, this representation extends only to the features that those classes of objects have in common. Thus, an abstract class provides only a partial description of its objects
6.Define Deadlock?
Answer : In an operating system, a deadlock is a situation which occurs when a process enters a waiting state because a resource requested by it is being held by another waiting process, which in turn is waiting for another resource. If a process is unable to change its state indefinitely because the resources requested by it are being used by other waiting process, then the system is said to be in a deadlock.
7.What is linked list?
Answer : Linked list is one of the fundamental data structures, and can be used to implement other data structures. In a linked list there are different numbers of nodes. Each node is consists of two fields. The first field holds the value or data and the second field holds the reference to the next node or null if the linked list is empty.
8.What is the difference between do loop & do while loop?
Answer : The difference between a "do ...while" loop and a "while {} " loop is that the while loop tests its condition before execution of the contents of the loop begins; the "do" loop tests its condition after it's been executed at least once. As noted above, if the test condition is false as the while loop is entered the block of code is never executed. Since the condition is tested at the bottom of a do loop, its block of code is always executed at least once.10.What is polymorphism & inheritance property?
Polymorphism is the ability to use an operator or function in different ways. Polymorphism gives different meanings or functions to the operators or functions. Poly, referring to many, signifies the many uses of these operators and functions. A single function usage or an operator functioning in many ways can be called polymorphism. Polymorphism refers to codes, operations or objects that behave differently in different contexts.
9.What is OOPS concept?
Answer : Object-oriented programming (OOP) is a programming paradigm using "objects" – data structures consisting of data fields and methods together with their interactions – to design applications and computer programs. Programming techniques may include features such as data abstraction, encapsulation, messaging, modularity, polymorphism, and inheritance. Many modern programming languages now support OOP, at least as an option.
10.What are dynamic and static memory location?
Answer : The allocation of memory for the specific fixed purposes of a program in a predetermined fashion controlled by the compiler is said to be static memory allocation.
The allocation of memory (and possibly its later deallocation) during the running of a program and under the control of the program is said to be dynamic memory allocation.

 11.What are the advantages of SQL?
Answer : These are the advantages of PL/SQL.
Block Structures: PL SQL consists of blocks of code, which can be nested within each other. Each block forms a unit of a task or a logical module. PL/SQL Blocks can be stored in the database and reused.
Procedural Language Capability: PL SQL consists of procedural language constructs such as conditional statements (if else statements) and loops like (FOR loops).
Better Performance: PL SQL engine processes multiple SQL statements simultaneously as a single block, thereby reducing network traffic.
Error Handling: PL/SQL handles errors or exceptions effectively during the execution of a PL/SQL program. Once an exception is caught, specific actions can be taken depending upon the type of the exception or it can be displayed to the user with a message.
Hide data complexity
12.What is the basic difference between a Join and a Union?
Answer : Union:
It combines the results of two or more queries into a single result set consisting of all the rows belonging to all queries in the union.
Basic Rules:
The number and the order of the columns must be the same in all queries.
The data types must be compatible.
Join:
To retrieve data from two tables or more than two tables then use joins.
Types: Inner Join, Outer Join(Right outer join, left outer join), cross join, Equi join, Self join.
The number and the order of the columns need not be the same in all queries.
13.What is a root?
Answer : "root" refers to the top-level directory of a file system. The word is derived from a tree root, since it represents the starting point of a hierarchical tree structure. The folders within the tree represent the branches, while the actual files are considered the leaves. However, unlike a real life tree, a data tree can be visualized upside down, with the root at the top and directories and sub-directories spanning downward.
The root node of a file system is also called the root directory. On a Windows-based PC, "C:\" represents the root directory of the C drive.
If you ever use a terminal program to view files and folders on a computer, you can use the command "cd /" (change directory to root) to navigate to the root directory.
"Root" is also the name of the user who has administrative privileges on a Unix or Linux server.


14. Can you tell any two advantages of stored procedures ?
Answer : Stored procedures can replace complex program segments requiring extensive SQL statements being executed from the code, hence they can make the application more manageable. Another advantage is that the usage of stored procedures can significantly reduce the network and bandwidth usage. This is because of the reduction in the number of requests and responses between business layer and database layer.
15. Can you tell advantages of RDBMS over simple custom DBMS ?
Answer : Any data storage in any manageable structure can be called a DBMS. But, it is the responsibility of the programmer to maintain the data integrity and to take care of constraints. But on RDBMS, the system takes care of almost all of the data integrity requirements. Hence, the programmer could focus more on business logic rather than worrying about data integrity much.