Ans:
Ans: Point to remember: Before interview You should decide your Favorite programming language and be prepared based on that question.
Ans: DDL stands for Data Definition Language. DML stands for Data Manipulation Language. DDL commands are used to create,alter,truncate,drop,rename etc. Where DML are used to insert,update,delete,merge etc.,
Ans:
Ans:
Ans:
Functions are declared within header file. That is function prototypes exist in a header file,not function bodies. They are defined in library (lib).
Ans: This means if one member variable of union is updated then the rest will be updated as well. This also leads compilation error when initializing multiple members at a time as the memory locations are not different. So in case of union only one member should be initialized at a time.
Ans: There are four types of storage classes in C. They are extern, register, auto and static
Ans: Static is an access qualifier. If a variable is declared as static inside a function, the scope is limited to the function,but it will exists for the life time of the program. Values will be persisted between successive
calls to a function
Ans: Use %p in printf to print the address.
Ans: Pass by value just passes the value from caller to calling function so the called function cannot modify the values in caller function. But Pass by reference will pass the address to the caller function instead of value if called function requires to modify any value it can directly modify.
Ans: Class is a user-defined data type in C++. It can be created to solve a particular kind of problem. After creation the user need not know the specifics of the working of a class.
Ans: Encapsulation is binding of attributes and behaviors. Hiding the actual implementation and exposing the functionality of any object. Encapsulation is the first step towards OOPS, is the procedure of covering up of data and functions into a single unit (called class). Its main aim is to protect the data from out side world.
Ans: Object is a software bundle of variables and related methods. Objects have state and behavior
Ans: Structure: Initially (in C) a structure was used to bundle different type of data types together to perform a particular functionality. But C++ extended the structure to contain functions also.
The major difference is that all declarations inside a structure are by default public.
Class: Class is a successor of Structure. By default all the members inside the class are private.
Ans: A data structure is a way of organizing data that considers not only the items stored, but also their relationship to each other. Advance knowledge about the relationship between data items allows designing of efficient algorithms for the manipulation of data.
Ans: 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.
Ans: A Null pointer has the value 0. void pointer is a generic pointer introduced by ANSI. Generic pointer can hold the address of any data type.
Ans: Function overloading is a feature of C++ that allows us to create multiple functions with the same name, so long as they have different parameters.Consider the following function:
int Add(int nX, int nY)
{
return nX + nY;
}
Ans: Function overloading: C++ enables several functions of the same name to be defined, as long as these functions have different sets of parameters (at least as far as their types are concerned). This capability is called function overloading. When an overloaded function is called, the C++ compiler selects the proper function by examining the number, types and order of the arguments in the call. Function overloading is commonly used to create several functions of the same name that perform similar tasks but on different data types.
Operator overloading allows existing C++ operators to be redefined so that they work on objects of user-defined classes. Overloaded operators are syntactic sugar for equivalent function calls. They form a pleasant facade that doesn't add anything fundamental to the language (but they can improve understandability and reduce maintenance costs).
Ans: A friend function for a class is used in object-oriented programming to allow access to public, private, or protected data in the class from the outside. Normally, a function that is not a member of a class cannot access such information; neither can an external class. Occasionally, such access will be advantageous for the programmer. Under these circumstances, the function or external class can be declared as a friend of the class using the friend keyword.
Ans: The idea behind inline functions is to insert the code of a called function at the point where the function is called. If done carefully, this can improve the application's performance in exchange for increased compile time and possibly (but not always) an increase in the size of the generated binary executables.
Ans: 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.
Ans: The free subroutine frees a block of memory previously allocated by the malloc subroutine. Undefined results occur if the Pointer parameter is not a valid pointer. If the Pointer parameter is a null value, no action will occur. The realloc subroutine changes the size of the block of memory pointed to by the Pointer parameter to the number of bytes specified by the Size parameter and returns a new pointer to the block. The pointer specified by the Pointer parameter must have been created with the malloc, calloc, or realloc subroutines and not been deallocated with the free or realloc subroutines. Undefined results occur if the Pointer parameter is not a valid pointer.
Ans: Macros are processor directive which will be replaced at compile time.
The disadvantage with macros is that they just replace the code they are not function calls. similarly the advantage is they can reduce time for replacing the same values.
Ans: Array is collection of homogeneous elements. List is collection of heterogeneous elements.
For Array memory allocated is static and continuous. For List memory allocated is dynamic and Random.
Array: User need not have to keep in track of next memory allocation.
List: User has to keep in Track of next location where memory is allocated.
Array uses direct access of stored members, list uses sequential access for members.
Ans: Arrays is a group of similar data types but Structures can be group of different data types
Ans: Compiler Design,
Operating System,
Database Management System,
Statistical analysis package,
Numerical Analysis,
Graphics,
Artificial Intelligence,
Simulation
Ans: It permits code reusability. Reusability saves time in program development. It encourages the reuse of proven and debugged high-quality software, thus reducing problem after a system becomes functional.
Ans: The two types of integrity rules are referential integrity rules and entity integrity rules. Referential integrity rules dictate that a database does not contain orphan foreign key values. This means that
A primary key value cannot be modified if the value is used as a foreign key in a child table. Entity integrity dictates that the primary key value cannot be Null.
Ans: A doubly linked list is a linked data structure that consists of a set of sequentially linked records called nodes. Each node contains two fields, called links, that are references to the previous and to the next node in the sequence of nodes. The beginning and ending nodes' previous and next links, respectively, point to some kind of terminator, typically a sentinel node or null, to facilitate traversal of the list. If there is only one sentinel node, then the list is circularly linked via the sentinel node. It can be conceptualized as two singly linked lists formed from the same data items, but in opposite sequential orders.
Ans: Getting the arguments from command prompt in c is known as command line arguments. In c main function has three arguments.They are:
Argument counter
Argument vector
Environment vector
Ans: Cache Memory is used by the central processing unit of a computer to reduce the average time to access memory. The cache is a smaller, faster memory
which stores copies of the data from the most frequently used main memory locations. As long as most memory accesses are cached memory locations, the average
latency of memory accesses will be closer to the cache latency than to the latency of main memory.
Ans: A debugger or debugging tool is a computer program that is used to test and debug other programs
Ans:
Ans: A conversion constructor is a single-parameter constructor that is declared without the function specifier 'explicit'. The compiler uses conversion constructors to convert objects from the type of the first parameter to the type of the conversion constructor's class.To define implicit conversions, C++ uses conversion constructors, constructors that accept a single parameter and initialize an object to be a copy of that parameter.
Ans: A spanning tree is a tree associated with a network. All the nodes of the graph appear on the tree once. A minimum spanning tree is a spanning tree organized so that the total edge weight between nodes is minimized.
Ans: If you want to get information on all the techniques of designing, maintaining, building and retrieving data, Data warehousing is the ideal method. A data warehouse is premeditated and generated for supporting the decision making process within an organization.
Data mining is a powerful new technology to extract data for analysis.
Ans: An interpreter reads one instruction at a time and carries out the actions implied by that instruction. It does not perform any translation. But a compiler translates the entire instructions
Ans: Scope refers to the visibility of variables. It is very useful to be able to limit a variable's scope to a single function. In other words, the variable wil have a limited scope
Ans: Interrupt is an asynchronous signal informing a program that an event has occurred. When a program receives an interrupt signal, it takes a specified action.
Ans: The keywords used in java application are try, catch and finally are used in implementing used-defined exceptions. This Exception class inherits all the method from Throwable class.
Ans: Applet is java program that can be embedded into HTML pages. Java applets runs on the java enables web browsers such as mozila and internet explorer. Applet is designed to run remotely on the client browser, so there are some restrictions on it. Applet can't access system resources on the local computer. Applets are used to make the web site more dynamic and entertaining.
Ans: Garbage collection is the systematic recovery of pooled computer storage that is being used by a program when that program no longer needs the storage. This frees the storage for use by other programs (or processes within a program). It also ensures that a program using increasing amounts of pooled storage does not reach its quota (in which case it may no longer be able to function).
Garbage collection is an automatic memory management feature in many modern programming languages, such as Java and languages in the .NET framework. Languages that use garbage collection are often interpreted or run within a virtual machine like the JVM. In each case, the environment that runs the code is also responsible for garbage collection.
Ans: int binarySearch(int arr[],int size, int item)
{
int left, right, middle;
left = 0;
right = size-1;
while(left <= right)
{
middle = ((left + right)/2);
if(item == arr[middle])
{
return(middle);
}
if(item > arr[middle])
{
left = middle+1;
}
else
{
right = middle-1;
}
}
return(-1);
}