You are on page 1of 3

Explain Memory leakage and Dangling Reference .How they differ from each other ?

Where are static variables stored in memory.


What is Cache ? What is Cache Coherence ? Explain Thrashing (In context to page
faults) .
What is Virtual Memory ?
What is Heapify operation ,Percolate Up and Percolate Down ? Implement Heapify
operation . Implement Insert operation for Max-Heap .
You are given n elements find the upper bound for inserting the n elements in the
heap.
Difference between procedural and Object Oriented programming .Advantages of OOP
over structural programming.
Use of stacks and queues
Time complexity and implementation of vector functions such as erase, pushback,
clear etc.
Void pointer and its advantages. How can you create generic functions using void
pointer.
Memory allocation of vector and array. Advantages of vector over array with
example.
Do Function overloading expects the same return type or not ?
Basics of graphs and its relation with greedy algorithm.
How can you design a hash which can have million entries with minimising collision?
What is the size of an empty class and why so?
how to dynamically allocate a 2D array in C++.
what is a constant function?
Implement singleton class. Is it thread safe? Make it thread safe.
A derived B, write copy constructor of B.
Write comparator function syntax in map.
Given n files with sorted k entries each. Sort them completely.
Can we modify ‘constant pointer to a variable’
Write code to find out given number is power of 2 or not?
Write code to find Kth largest element in an array.
What all things are being called when an object creates in C++.( like constructor,
copy constructor, assignment operator)
All types of access specifiers with difference between them.
Describe Operator overloading.
Write syntax for copy constructor and assignment operator.
How to make an object non-copyable.
Design an Array class using features of C++.
Copy constructor and assignment operator.
Asked me to write + operator overloading code for a class that has only one integer
member variable. The class has a parameterized constructor. I proposed two
approaches
I added copy constructor for future enhancement of the class. He removed it and
asked whether the code will work or not. Then detail discussion on copy
constructor.
Detail discussion about the stack management while function call.
What is virtual destructor?
can we use static keyword with const qualifier?

Given a circuit diagram to me with resistors, inductors and capacitors. Now I need
to design a C++ classes to derive the power of whole circuit using C++ features and
describe how I use them. It was a long discussion of around 45 minutes

Can we change value of a const variable in C++?


What is constant reference?
Diamond problem and how to overcome it.
How to reuse thread
Conditional variable for threads
Virtual memory concept, Cache concept
Difference between C style array and Vector.
Describe whole virtual keyword implementation in C++ using concept of virtual
pointer and virtual table.Questions with changes in virtual keyword positions in
code.
Function overloading vs function overriding
Deep copy vs shallow copy
What are references in C++?
Stack frame how does it look it.
RTTI, typeinfo, dynamic cast, why is dynamic cast expensive
How does printf work?
Friend function
Single class deletion operation.
Operator overloading for multiplication.
Function pointer and how function pointer for class member function.
Funcion overloading and name mangling concept.
Detailed discussion on polymorphism (virtual functions, why use, abstract class use
, working of virtual table , operator overloading) with example
Difference between ‘==’ and ‘.equals()’ in c#

Detail discussion on Virtual function working principle. What will happen if a


virtual function has any default value parameter?
class A{
A(){}
virtual void foo(int var = 10) { std::cout<< var; }
};

class B: public A{
B(){}
void foo(int var = 7) { std::cout<< var; }
};

int main(){
A *ptr = new B();
ptr->foo();
delete ptr;
return 0;

1000 coins/ 10 bags, distribute the coins so that each number can be made between 1
to 1000.
In how many different ways can the letters of the word ‘CORPORATION’ be arranged so
that the vowels always come together?
Poisened wine bottle puzzle.
Fill numbers from 1 to 8 puzzle.
Egg dropping puzzle.
50 over match calculate the maximum score of batsman. (49 * 31 + 36) can be
improved if run in last ball of every over are odd and > 1.
Divide a number by 8 without using division operator
Divide square in 7 parts. Divide horizontally.
20 heads and 80 tail you are blind divide equal heads between two people, you can
flip coin.
https://www.geeksforgeeks.org/puzzle-23-days-of-month-using-2-dice/
https://www.cut-the-knot.org/SimpleGames/EightDigitPuzzle.shtml
https://www.geeksforgeeks.org/puzzle-set-35-2-eggs-and-100-floors/
Given a value N, if we want to make change for N cents with the minimum number of
coins, and we have infinite supply of each of S = { S1, S2, .. , Sm} valued coins,
what will be the minimum value ?
What is an expression tree. How to store an expression in expression tree. Write a
code to evaluate an expression tree.
Design a 5 bit counter.
Function of clk in D-flip flop and some flipflop related question
What is the maximum score a Batsman can score in a cricket match.
The famous prisoner Hat puzzle . (I told him that i had solved this earlie

Discussion on memory manager. How does memory manager help to allocate memory?
Code analysis of a code that allocates memory using malloc until malloc returns
NULL.
Discussion on memory allocation using malloc
Process stack uninitialized data segment heap and stack
strcat function implementation
Program crashing before main() is called, what can be probable causes?
when does segmentation fault occurs..
which type of error can be cause by overwriting any allocated memory.
Design a compiler which can detect the circular inclusion of header files.
How to represent a large number[100 digits], convert a large number into binary,
provide bits in a particular ranges[eg but 45 to 78] for a 200 digit number
Explain types of Interrupts
What is pooling ?
If Cache is so fast why not eliminate Main memory and have a Cache memory by itself
What are the stages of compilation , explain how every step works.
She asked me about static and shared library and the differences between them and
told to write one library of my own and how static libraries are set up
How many processors and cores and sub processes running how to find out using
application (in windows) , using command (in linux).Here I answered Ill use Windows
task manager to find out 😛 but she said they show us the main processes and she
wants to see all the sub processes too
What are the main environment variables we use and what is ldpath ?
What debugging tools I have used till now and how debugging works internally? and
asked me few question on gdb
What does loader and linker do and in which part of memory everything is stored
Asked me to write a code of checking string is palindrome or not.
Dynamically allocate 2D array , array of strings , array of pointers (all using
malloc and new both)
Told me to write push and pop of stack using linked list.
Started with difference between

int *p[10];
int (*p)[10];

You might also like