CPP Questions
CPP Questions
, you can race 5 hors es at a time). There is no stop clock !! Assume that there are no ties. 1: What is the minimum number of races needed to determine the 3 fastest horses in order from fastest to slowest ? 2) You are given 8 identical-looking balls, one of which is different from the o ther 7 (all of which weigh the same). You have provided a weighting machine, how to identify that different ball in minimum number of weight? C++ question 1) what is deep and shallow copy? 2) what are the default functions provided by compiler? 3) what is copy constructor? how it is different from the assignment operator? 4) at run time memory allocation which memory section comes into the picture(i.e register or stack or heap?) 5) what is diamond inheritance? how to solve this problem when we have diamond s tructure in inheritance? 6) what is virtual function? give me an example where you use this function? 7) diff between override and overload? 8) what is STL? give brief explaination about its element(i.e vector etc)? 9) expalin the mechanism of Vtable? 10) some question based on design pattern (like factory pattern, singlton patter ns). Data Structures 1) there is a link list given to you without head pointer. An address of the per ticular nodes given to you, which you have to remove from the list. how to do that? (write up algorithm code) 2) there is two link list which has common element(means list has an intersectio n point). how to get the common node? (explain the logic) 3) there is an array of size n+1 with given element start from 1 to n. how to fi nd out which element is occurring more than one time?, write up the time complexity of your algorithm. 4) you have a huge data file but less memory and you have to do sorting operatio n in that data file. how do you approach the problem? which sorting algorithm will you use? Sent at 11:01 AM on Friday vasanthihmc: Unix Question 1) what is "top" command? 2) what operator do you use when you wish to run multi command at one single lin e?
3) explain about any one searching command. 4) what is fork() in unix? which UNIX command does use this function? 5) what is Zoombie process? 2nd Set of Questions: 1. What is the data structures used to perform recursion? 2. How to initialize the const member variable of a class 3. How to delete the 3rd last element from a single linked list? 4. Difference between encapsulation and abstraction? 5. How to delete the duplicate vales in a single liked list...write program? 6. What is singelton class, use of it and how to implement ....several questions ? 7. How can u create the final class in C++, final class is that class that can't be inherited? 8. How virtual function works.....questions on VTABLE? 9. What is the reason that we can't create a object of Abstract class? 10. Question on Multiple Inheritance Diamond problem? 11. What is paging thrashing, why its occur? 12. What is deadlock, when it occurs? 13. Some simple question on UNIX command like grep, find etc? 14. What is core file and how to debug that? 15. What is the size of empty class with reason? 3rd Set of Questions: Puzzles: 1. using two stacks, implement the queue. (FIFO to LIFO) 2. Four accused crimes were given a punishment to burry in a ground in the follo wing way A-> | <- B , <-C, <-D A B C D cant see anyone. Cant see anyone can see B can see C and B
now they gave them 4 caps randomly. (2 black n 2 white). If anyof them can tell the colour of their cap, all 4 can be released. 3. relative distance and distance travelling problem A travels at a spead of 35 B Travels at a speed of 60 total distance is 270 wats the distance covered by each when they meet? C++ What is copy constructor/why is it required? What is virtual destructor? Why is it required? What is "is" vs. "has" relation ship? Object Slicing? when n how? why it is needed? Type casting unary operator overloading (prefix and postpix, differences) which is fater : pre-increment or post-increment n how? templates? how the RTTI is happening n templates n when ? virtual inheritence Operator new Smart pointer Auto pointer Exception handling on constructures
virtual destructors and pure virtual destructors and their need How will you implement different type of casting with example Difference between composition and aggregation C: function pointers const pointers int to a const pointer const into to a non-const pointer static function / static variables Write a programme to implement the Grep command in C with design strategies Write a programme to implement the Tail command in C with design strategies. Quick sort algorithm Linklist: Reverse a link-list. swap alternative nodes in a linklist? Best way to sort an array of 10000 elements containing values from 1-250. SQl: Inner join and outter join HAVING Class Design pattern: ~~~~~~~~~~~~~~ singleton, Abserver class, Factory method abstract factory method with examples. General: ~~~~~~~ How to how to how to thread find the memory leak in a program find the call trace find the deadlock join