Which is the parameter that is added to every non-static member function when it is called?
Answer: ‘this’ pointer
What is a binary semaphore? What is its use?
A binary semaphore is one, which takes only 0 and 1 as values. They are used to implement mutual exclusion and synchronize concurrent processes.
What is thrashing?
It is a phenomenon in virtual memory schemes when the processor spends most of its time swapping pages, rather than executing instructions. This is due to an inordinate number of page faults.
What are turnaround time and response time?
Turnaround time is the interval between the submission of a job and its completion. Response time is the interval between submission of a request, and the first response to that request.
What is data structure?
Answer: 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.
List out the areas in which data structures are applied extensively?
Answer: The name of areas are:
Database Management System,
Statistical analysis package,
What are the major data structures used in the following areas : RDBMS, Network data model & Hierarchical data model.
Answer: The major data structures used are as follows:
RDBMS – Array (i.e. Array of structures)
Network data model – Graph
Hierarchical data model – Trees
What is the data structures used to perform recursion?
Answer: Stack. Because of its LIFO (Last In First Out) property it remembers its ‘caller’ so knows whom to return when the function has to return. Recursion makes use of system stack for storing the return addresses of the function calls.
Every recursive function has its equivalent iterative (non-recursive) function. Even when such equivalent iterative procedures are written, explicit stack is to be used.
Predict the output or error(s) for the following:
int const * p=5;
Compiler error: Cannot modify a constant value.
Explanation: p is a pointer to a “constant integer”. But we tried to change the value of the “constant integer”.
char s[ ]=”man”;
for(i=0;s[ i ];i++)
printf(“\n%c%c%c%c”,s[ i ],*(s+i),*(i+s),i[s]);
Explanation:s[i], *(i+s), *(s+i), i[s] are all different ways of expressing the same idea. Generally array name is the base address for that array. Here s is the base address. i is the index number/displacement from the base address. So, indirecting it with * is same as s[i]. i[s] may be surprising. But in the case of C it is same as s[i].
float me = 1.1;
double you = 1.1;
printf(“I love U”);
printf(“I hate U”);
I hate U
Explanation: For floating point numbers (float, double, long double) the values cannot be predicted exactly. Depending on the number of bytes, the precession with of the value represented varies. Float takes 4 bytes and long double takes 10 bytes. So float stores 0.9 with less precision than long double.
Rule of Thumb:
Never compare or at-least be cautious when using floating point numbers with relational operators (== , >, <, <=, >=,!= ).
List out few of the Application of tree data-structure?
Answer: The list is as follows:
The manipulation of Arithmetic expression,
Symbol Table construction,
List out few of the applications that make use of Multi linked Structures?
Answer: The applications are listed below:
In tree construction which is the suitable efficient data structure?
Answer: Linked list is the efficient data structure.
What is the type of the algorithm used in solving the 8 Queens problem?
In RDBMS, what is the efficient data structure used in the internal storage representation?
Answer: B+ tree. Because in B+ tree, all the data is stored only in leaf nodes, that makes searching easier. This corresponds to the records that shall be stored in leaf nodes.
Whether Linked List is linear or Non-linear data structure?
Answer: According to Access strategies Linked list is a linear one.
According to Storage Linked List is a Non-linear one.
Previous Year Questions
What is dangling pointer in c?
In C++, what is the difference between method overloading and method overriding?
What methods can be overridden in Java?
What are the defining traits of an object-oriented language?
Write a program that ask for user input from 5 to 9 then calculate the average?
What is the diffrence between a “assignment operator” and a “copy constructor”?
Explain the popular multiprocessor thread-scheduling strategies.?
What is a trap and trapdoor?
What is time-stamping?
How are the wait/signal operations for monitor different from those for semaphores?