Showing posts with label CPP. Show all posts
Showing posts with label CPP. Show all posts

Technical Aptitude Test Questions - ebook

An excellent resource to prepare for technical aptitude tests.

Table of Contents

Data Structures Aptitude..........................................................................
C Aptitude..............................................................................................
C++ Aptitude and OOPS.........................................................................
Quantitative Aptitude...........................................................................
UNIX Concepts.....................................................................................
RDBMS Concepts................................................................................
SQL......................................................................................................
Computer Networks.............................................................................
Operating Systems.............................................................................

Data Structure Interview Questions Collection

1. What is a data structure?
2. What does abstract data type means?
3. Evaluate the following prefix _expression " ++ 26 + - 1324" (Similar types can be asked)
4. Convert the following infix _expression to post fix notation ((a+2)*(b+4)) -1 (Similar types can be asked)
5. How is it possible to insert different type of elements in stack?
6. Stack can be described as a pointer. Explain.
7. Write a Binary Search program
8. Write programs for Bubble Sort, Quick sort
9. Explain about the types of linked lists
10. How would you sort a linked list?
11. Write the programs for Linked List (Insertion and Deletion) operations
12. What data structure would you mostly likely see in a non recursive implementation of a recursive algorithm?
13. What do you mean by Base case, Recursive case, Binding Time, Run-Time Stack and Tail Recursion?
14. Explain quick sort and merge sort algorithms and derive the time-constraint relation for these.
15. Explain binary searching, Fibinocci search.
16. What is the maximum total number of nodes in a tree that has N levels? Note that the root is level (zero)
17. How many different binary trees and binary search trees can be made from three nodes that contain the key values 1, 2 & 3?
18. A list is ordered from smaller to largest when a sort is called. Which sort would take the longest time to execute?
19. A list is ordered from smaller to largest when a sort is called. Which sort would take the shortest time to execute?
20. When will you sort an array of pointers to list elements, rather than sorting the elements themselves?
21. The element being searched for is not found in an array of 100 elements. What is the average number of comparisons needed in a sequential search to determine that the element is not there, if the elements are completely unordered?
22. What is the average number of comparisons needed in a sequential search to determine the position of an element in an array of 100 elements, if the elements are ordered from largest to smallest?
23. Which sort show the best average behavior?
24. What is the average number of comparisons in a sequential search?
25. Which data structure is needed to convert infix notations to post fix notations?
26. What do you mean by:
* Syntax Error
* Logical Error
* Runtime Error
How can you correct these errors?
27. In which data structure, elements can be added or removed at either end, but not in the middle?
28. How will inorder, preorder and postorder traversals print the elements of a tree?
29. Parenthesis are never needed in prefix or postfix expressions. Why?
30. Which one is faster? A binary search of an orderd set of elements in an array or a sequential search of the elements.

CPP (C++) Technical Interview Questions Collection

1. What is a class?
2. What is an object?
3. What is the difference between an object and a class?
4. What is the difference between class and structure?
5. What is public, protected, private?
6. What are virtual functions?
7. What is friend function?
8. What is a scope resolution operator?
9. What do you mean by inheritance?
10. What is abstraction?
11. What is polymorphism? Explain with an example.
12. What is encapsulation?
13. What do you mean by binding of data and functions?
14. What is function overloading and operator overloading?
15. What is virtual class and friend class?
16. What do you mean by inline function?
17. What do you mean by public, private, protected and friendly?
18. When is an object created and what is its lifetime?
19. What do you mean by multiple inheritance and multilevel inheritance? Differentiate between them.
20. Difference between realloc() and free?
21. What is a template?
22. What are the main differences between procedure oriented languages and object oriented languages?
23. What is R T T I ?
24. What are generic functions and generic classes?
25. What is namespace?
26. What is the difference between pass by reference and pass by value?
27. Why do we use virtual functions?
28. What do you mean by pure virtual functions?
29. What are virtual classes?
30. Does c++ support multilevel and multiple inheritance?
31. What are the advantages of inheritance?
32. When is a memory allocated to a class?
33. What is the difference between declaration and definition?
34. What is virtual constructors/destructors?
35. In c++ there is only virtual destructors, no constructors. Why?
36. What is late bound function call and early bound function call? Differentiate.
37. How is exception handling carried out in c++?
38. When will a constructor executed?
39. What is Dynamic Polymorphism?
40. Write a macro for swapping integers.

What is public, protected, private in c++?

public, protected, private are access specifiers that is used to implement encapsulation of data at various level.

Private:
  • Can be data or method members
  • Are private to the class where they are declared
  • Accessible ONLY by the member methods of the class where they are declared
  • Only exception to the above rule is Friend (explanation of friends is beyond the scope of this topic
  • In a C++ class, private is default for member declaration. That is, if you do not specify any access specifier (private, public, protected), the member is considered private

Public:
  • Can be data or method members
  • Are accessible by any function/method/application globally, so long as an instance of the class where the public members are declared is created.
  • These members are accessible only thru an instance of the class where they are declared
  • Generally used to define a C++ class behaviour and/or to access private data members (act as private data modifiers)

Protected
  • Can be data or method members
  • Act exactly as private members for all practical purposes, so long as they are referenced from within the class (and/or instances of the class)where they are declared
  • Specifically used to define how certain data/method members of a class would behave in a child class (used to define their behaviour in inheritance)
  • The protected members become private of a child class in case of private inheritance, public in case of public inheritance, and stay protected in case of protected inheritance.

Related Posts Plugin for WordPress, Blogger...