Span Idea Interview Questions

This is for C++ role.

The following questions are for the written test.

Following questions carried a weightage of  2 marks each.

Ques 1) 

     Diff between shallow and deep copy?

Ques 2)

     Different types of type casting mechanisms in C++?

Ques 3) 

     Smart Pointer? and its types?

Ques 4)

     Diamond problem in c++ and how to overcome it?

Ques 5)

    Diff b/w process and thread?

Ques 6)

    Types of IPC mechanism? and which is fastest and why?

Ques 7)

    Diff b/w sempahore and a mutex?

Following questions carried a weightage of 4 marks each.

Ques 8)

   Implement stack in c++.

Ques 9)

   Write a function to reverse a linked list using recursion.

Ques 10)

   Write your own function to implement strstr().


This was followed by Interview:






First Intevirew :

You will be rated on various factors out of 5 :

Few of them as far as I remember :

1) Logic
2) C++
3) Aptitute
4)  Attitude (May be how you approach even if you do not get the solution)

Questions in interview :


1) What is virtual function?

2) Pure virtual function and followed by abstract class?

3) Swap two strings without a third variable?

4) What a friend function can do? and what it can't?

5) Diff between class and structure?




Second Round :



Random HR questions.

Given a char *ptr  = "My name is Mia Khalifa ";

Get the output as "    MynameisMiaKhalifa"

Basically get all spaces to left and the test to right without use of third variable.

This is a wrong question as far as I know since char ptr is read only and its value cant be changed!





Third round:


1) Virtual Destructors.

2) Diamond Problem.

3) List in C++.

4) Why can we have multiple constructors but why not destructors in inherited classes?

5) Random HR questions and stuff.




Fourth  Round :

Given these input and output get the code ready for it without any predefined library that is there to do this.

Input : The input is in string.

"1234"
"0xabcd"
"abcd"
"abcd12"


Output : The output is in integer

1234
0xabcd
0xabcd
0xabcd12


Well that happened on a single day. Hope you found this helpful.

Please share with everyone.

Pata nahi Kisko help ho jaye. :)


Comments