Tuesday, 15 March 2016


Infosys Technical Interview Questions and Answers

What are the 4 basics of OOP?  
 Abstraction, Inheritance, Encapsulation, and Polymorphism.

What you mean by Object Relational DBMS?
An object-relational database (ORD), or object-relational database management system (ORDBMS), is a database management system (DBMS) similar to a relational database, but with an object-oriented database model: objects, classes and inheritance are directly supported in database schemas and in the query language. In addition, just as with proper relational systems, it supports extension of the data model with custom data-types and methods.

Structural difference between bitmap and b-tree index ? 
It is made of branch nodes and leaf nodes. Branch nodes holds prefix key value along with the link to the leaf node. The leaf node in turn contains the indexed value and rowed.
It simply consists of bits for every single distinct value. It uses a string of bits to quickly locate rows in a table. Used to index low cardinality columns. 

what is database Schema?
The formal definition of database schema is a set of formulas (sentences) called integrity constraints imposed on a database.

what are the different levels of database schema?
Conceptual schema- a map of concepts and their relationships.
Logical schema- a map of entities and their attributes and relations
Physical schema- a particular implementation of a logical schema
Schema object- Oracle database object

 what is difference between foreign key and reference key ?  
Reference Key is the primary key that is referenced in the other table (linked via the other tables Foreign Key). Foreign Key is how you link the second table to the primary tables Primary Key (or Reference Key).

 Tell me about DSN?
A Data Source Name (DSN) is the logical name that is used by Open Database Connectivity (ODBC) to refer to the drive and other information that is required to access data. The name is used by Internet Information Services (IIS) for a connection to an ODBC data source, such as a Microsoft SQL Server database. 

Difference between Clustered index and non clustered index ?   
Clustered Index
Only one per table
Faster to read than non clustered as data is physically stored in index order
Non Clustered Index
Can be used many times per table
Quicker for insert and update operations than a clustered index

What is WPF and WCF?
WPF/WCF application, need in .NET 3.0 Framework. This application will cover the following concepts:
WCF(Windows Communication Foundation)
The new service orientated attributes
The use of interfaces
The use of callbacks
Asynchronous delegates
Creating the proxy
WPF( Windows Presentation Foundation )
Multithreading a WPF application

What is the difference between an EXE and a DLL?   
The term EXE is a shortened version of the word executable as it identifies the file as a program. On the other hand, DLL stands for Dynamic Link Library, which commonly contains functions and procedures that can be used by other programs.
10.Scenarios in which web application should be used and desktop application should be used?

Tell how to check whether a linked list is circular.
Create two pointers, each set to the start of the list. Update each as follows:
while (pointer1) {
pointer1 = pointer1->next;
pointer2 = pointer2->next; if (pointer2) pointer2=pointer2->next;
if (pointer1 == pointer2) {
print ("circular\n");

How can u increase the heap size in the memory?
If heap size set too low then you will get "out of memory" errors. If you set it too high then your system will hang or you will suffer poor performance because parts of the jvm will be swapped in and out of memory. A rule of thumb is that you should not set this parameter larger than about 80% of your free physical memory. On Windows XP machines you can determine your free physical memory from the Performance tab of the Task Manager application. 

Boosting the heap size parameter will allow you to read in larger file-based projects. It will also improve the performance of the database back-end since more memory is available for caching.In Java Set the maximum heap size, using the -Xmx command-line option, to a value that allows the application to run with 70% occupancy of the Java heap.The Java heap occupancy often varies over time as the load applied to the application varies. For applications where occupancy varies, set the maximum Java heap size so that there is 70% occupancy at the highest point, and set the minimum heap size, using the -Xms command line option, so that the Java heap is 40% occupied at its lowest memory usage. If these values are set, the Java memory management algortihms can modify the heap size over time according to the application load, while maintaining usage in the optimal area of between 40% and 70% occupancy.

Why is it difficult to store linked list in an array?
Both Arrays and Linked List can be used to store linear data of similar types.
Linked list provide dynamic size while the size of array is fixed, So we must know the upper limit on the number of elements in advance.
Linked lists have following drawbacks:
1) Random access is not allowed. We have to access elements sequentially starting from the first node. So we cannot do binary search with linked lists.
2) Extra memory space for a pointer is required with each element of the list.
3) Arrays have better cache locality that can make a pretty big difference in performance.

 Different types of keys in SQL?
The different types of Keys in sql server are,
 A candidate key acts as a unique key. A unique key can be a Primary key. A candidate key can be a single column or combination of columns. Multiple candidate keys are allowed in a table.

Primary Key
To uniquely identify a row, Primary key is used.
A table allows only one Primary key
A Primary key can be a single column or combination of columns.

Foreign Key
A foreign key in a table is a key which refer another table’s primary key . A primary key can be referred by multiple foreign keys from other tables. It is not required for a primary key to be the reference of any foreign keys. The interesting part is that a foreign key can refer back to the same table but to a different column. This kind of foreign key is known as “self-referencing foreign key”.

What is a default gateway?
In organizational systems a gateway is a node that routes the traffic from a workstation to another network segment. The default gateway commonly connects the internal networks and the outside network (Internet). In such a situation, the gateway node could also act as a proxy server and a firewall. The gateway is also associated with both a router, which uses headers and forwarding tables to determine where packets are sent, and a switch, which provides the actual path for the packet in and out of the gateway.

Given an array of 1s and 0s arrange the 1s together and 0s together in a single scan of the array. Optimize the boundary conditions.

void main()
int A[10]={'0','1','0','1','0','0','0','1','0','1','0','0'};
int x=0,y=A.length-1;
while(x if(!A[x])
else if(A[y])
if(A[x] && !A[y])//here we are checking that stating index is having 1 and last index having 0 than swap values


Define Data Abstraction. What is its importance?
Abstraction is the process of recognizing and focusing on important characteristics of a situation or object and leaving/filtering out the un-wanted characteristics of that situation or object.
Abstraction is the basis for software development. Its through abstraction we define the essential aspects of a system. The process of identifying the abstractions for a given system is called as Modeling (or object modeling).
Three levels of data abstraction are:
1. Physical level : how the data is stored physically and where it is stored in database.
2. Logical level : what information or data is stored in the database. eg: Database administrator
3.View level : end users work on view level. if any amendment is made it can be saved by other name.

Write a program to swap two numbers without using a temporary variable.

void swap(int &i, int &j)

Memory Allocation in C/C++
calloc() allocates a memory area, the length will be the product of its parameters(it has two parameters). calloc fills the memory with ZERO's and returns a pointer to first byte. If it fails to locate enough space it returns a NULL pointer.
malloc() allocates a memory area, length will be value entered as parameter.(it has one parameter). It does not initializes memory area
free() used to free the allocated memory(allocated through calloc and malloc), in other words, this used release the allocated memory
new also used to allocate memory on heap and initialize the memory using constructor
delete also used release memory allocated by new operator

 Write output of the program?
int i=10; 
Answer = 10 12 12

what is virtual function and pure virtual function?
Virtual function:-To achieve polymorphism, function in base class is declared as virtual , By declare virtual we make base class pointer to execute function of any derived class depends on content of pointer (any derived class address).
Pure Virtual Function :-This is function used in base class, and its defination has to be provide in derived class, In other pure virtual function has not defination in base it defined as :
virtual void fun()=0;
This means that this function not going to do anything, In case of pure virtual funtion derived function has to 
implement pure virtual function or redeclare it as pure virtual function


About SSR -

Author Description here.. Nulla sagittis convallis. Curabitur consequat. Quisque metus enim, venenatis fermentum, mollis in, porta et, nibh. Duis vulputate elit in elit. Mauris dictum libero id justo.

Subscribe to this Blog via Email :