Some must know Technical questions for you.
rnQuestion 1: What is the difference between an array and a list?
rnAnswer:
rnArray 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.
Question 2: What are the differences between structures and arrays?
rnAnswer:
rnArrays are a group of similar data types but Structures can be group of different data types.
rnQuestion 3: What is data structure?
rnAnswer:
rnA 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.
rnQuestion 4: Can you list out the areas in which data structures are applied extensively?
rnAnswer:
rnCompiler Design,
Operating System,
Database Management System,
Statistical analysis package,
Numerical Analysis,
Graphics,
Question 5: What are the advantages of inheritance?
rnAnswer:
rnIt 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.
rnQuestion 6: Advantages of a macro over a function?
rnAnswer:
rnMacro gets to see the Compilation environment, so it can expand #defines. It is expanded by the pre-processor.
rnQuestion 7: What is command line argument?
rnAnswer:
rnGetting 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
Question 8: What are the 4 basics of OOP?
rnAnswer:
rnAbstraction, Inheritance, Encapsulation, and Polymorphism.
rnQuestion 9: Tell how to check whether a linked list is circular.
rnAnswer:
rnCreate 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 (“circularn”);
}
}
Question 10: Write a program to swap two numbers without using a temporary variable.
Answer:
rnvoid swap(int &i, int &j)
{
i=i+j;
j=i-j;
i=i-j;
}