Home » List of Companies » Siemens Technical Questions
Siemens C & C++ Interview Questions
Question 1: Topic - Algorithms
	In C++, assume that youare working with lists. You have tow containers C1 & C2 which contains the sorted elements as per the sorting criteria op(). Which of these operations will you use to move all elements of C2 into C1 such that all elements
	are merged and still sorted according to op() ? 
	A. C2.merge(C1, op)
	B. C2.unique(C1, op)
	C. C1.merge(C2, op)
	D. C1.unique(C2, op)
	
Question 2: Topic - Alogrithms
	Which of the header file is used to implement algorithms provided by C++ STL ? 
	A. <algorithm>
	B. <header>
	C. <algos>
	D. <Algorithms>
	
Question 3: Topic - STL
	What is the use of random_shuffle() function in STL algorithm?
	A. To generate the random sequences in a range
	B. To generate the sequence in a given range and arrange them in random order
	C. To rearrange given sequence randomly
	D. To select any random number from the given sequence
	
Question 4: Topic - Operator
	In C++, which of the following operators is used to define a member of a class outside it? 
	A. ::
	B. ->
	C. .
	D. :
	
Question 5: Topic - C++ concepts
    In C++, which of the following has a separate declaration to accept and return const parameters? 
    A. strchar
    B. string
    C. memory
    D. None of these
	
Question 6: Topic - Virtual Inheritance
	What is the virtual inheritnance?
	A. C++ technique to avoid multiple copies of the baes class into children/derived classes
	B. C++ technique to avoid multiple inheritance of classes
	C. C++ technique to enhance multiple inheritance
	D. C++ technique to ensure that a private member of the base class can be accessed
	
Question 7: Topic - Circular Queue
	     
	
Question 8: Topic - Data type
	    
	     
	
Question 9: Topic - Ostream
	     
	
Question 10: Topic - Integer Constant
	   In C++, which of the following is an integer constant expression defined in the header file cstdlib? 
	   A. RAND_MAX
	   B. rand
	   C. srand
	   D. None of these
	
Question 11: Topic - Hybrid Inheritance
	    In C++, which of the following statements about the hybrid inheritance is true?
	    A. It is multiple inheritance
	    B. It is multilevel inheritance
	    C. It is multipath inheritance
	    D. It is a combination of multiple and multilevel inheritance
	
Question 12: Topic - Hybrid Inheritance
	    In C++, when is a desctructor called? 
	    A. It is called when an object created automatically goes out of scope
	    B. It is called when the delete operator is called
	    C. Both of these
	    D. None fo these
	
Question 13: Topic - Destructor
	    In C++, which of the following is a function of the getche() library function()? 
	    A.  Returns a character read from the keyboard
	    B. Returns a character read from the keyboard, when ENTER is pressed
	    C. Displays a chracter on the screen when any key is pressed
	    D. Does not display a character on the screen
	
Question 14: Topic - Exception Handling
	     
	
Question 15: Topic - Pointer
	In C or C++, which of the following statements about pointers are correct
	1. It is used to store the value of another variable
	2. It is used to allocate memory dynamically to parameters
	3. It can point to only integer variables
	4. The value a null pointer to 0
	A. 2 and 4 
	B. 1, 2 and 3
	C. 1, 3 and 4
	D. 1 and 3
	
