# Interview Questions

## Adobe Interview Questions , Noida -Flash Team:

Q Program to find amount of water in a given glass

There are some glasses with equal capacity as 1 litre. The glasses are kept as follows:

```             1
2   3
4    5    6
7    8    9   10```

You can put water to only top glass. If you put more than 1 litre water to 1st glass, water overflows and fills equally in both 2nd and 3rd glasses. Glass 5 will get water from both 2nd glass and 3rd glass and so on.
If you have X litre of water and you put that water in top glass, how much water will be contained by jth glass in ith row?

Example. If you will put 2 litre on top.
1st – 1 litre
2nd – 1/2 litre
3rd – 1/2 litre

Q WAP for managing Stack of large Size, Design data -structure in a way so that All Stack Operations are supported . Also implement a way to get element given any index ?

Q. Design a restaurant booking system.

Q Explain External merge Sort.

Q. Write code for implementing a normal Stack.

Q Debug an application if it takes more time to launch ? — Too many static variables ?

Q When is  Angle between minute and hour hand as 180 degree between 7 & 8 PM ?

Q Puzzle like : a camel and he has to carry 3000 banans 1000km away ? Maximum number of bananas he can take to other end if 1 banana is eaten for every 1km ?

Q Another Puzzle like Toffee Wrapper – For every wrapper u get a toffee , how many toffee’s u eat if initially u had 25 toffees ? Solve it both iteratively and recursively ?

Q Sum of two numbers ? Detect condition of overflow and underflow and throw exceptions.

Q Check if two line segments intersect ?

Q  Minimize number of new calls in allocation of m x n size array ? where m & n are large values ?

Q Find median in a running stream ?

Q Implement your own strstr function ? In what scenarios it may fail ?

Q. Move from one word to another , changing each char at a time such that intermediate words belongs to a dictionary containing words ? Implement the least number of char change to reach the final string .You only are allowed 3 operations : Add , Delete & swap a char ?

Q Design singleton class in multi threaded environment . How destroy it ? How to print number of references of the SIngleton object

Just use a shared pointer instead.

Q From a start point say 0 , you can jump in either directions. In first step jump by 1 , in second step jump by 2 and in third step jump by 3 and son on.

Number of minimum steps to reach point n ?

int func(int start, int level ,int n){
if(start==n)
return level-1;
return min( func(start-level,level 1,n) , func(start level,level 1,n));
}

int main(){
func(0,1,-15);
}

Check if Big Endian or Small Endian ?

Design parking lot, lift, digital advertising board, bookmyshow.

## Pitney Bowes Interview Questions:

Q Explain K-d Tree

Q Return all subsets of a String

Q  Return all prime numbers smaller than a given number.

Q.Find square root of a number.

Q. Implement tower of Hanoi problem.

Q. Calculate runtime average of data .

Q Implement factory pattern.

Q. Solve say 1+304 -3*(7-9) expression .

Answer : Solve it using Postfix Expression

Q. SNS vs SQS

Q. How SSL works securely ?

Q. MVC architecture ? How Model & View are connected ?

Q Multiple controllers for a view ?

Q. where is mapping of action to view is stored ?

## MagicPin Gurgaon Software Developer  ,Payments team

Q. Design MagicPin feature of sending push notification to every user whenever a user visits a merchant registered on MagicPin. Discuss data points.You have history data.

Q. Design url shortener application. {Use min-heap + hashmap}

Q. Scaling Transactional database like SqlServer.

Q. What are Zookeepers.

Q. If suppose 10 vouchers are available and millions of takers at the same time , how to handle such scenerio ?

## Vizexperts  Interview Questions , Gurgaon:

Q. Write a GUI application that acts as an image viewer for large images in .tiff format. Note that the size of the input image will typically be around 4-8 GB. The user should be able to pan and zoom to any part of the image.

Expected command line usage for your program:

viewimage large_map.tiff

1. i) Image sizes will be large enough so as to not fit in RAM. Make allowance for this. (Hint: use an appropriate tiling/caching mechanism).
2. ii) Your code will judged for its readability and design. Pay attention to variable naming and code modularization.

iii) Send code along with executable binaries. Do not expect us to compile the program.

1. iv) Attach proper readme on how to run. Attach sample data that was used for testing.
2. v) Program should be in C++/Java as desktop application only.

Q Explain Page Table , Segmentation

## Amazon , Gurgaon Interview Questions  :

Q Print tree in Spiral & ZigZag Order

Q Return starting , ending index of Subarray with Maximum sum

Q An array of string , sort it.
void quicksort_strs(char const *args[], unsigned int len)
{
unsigned int i, pvt=0;

if (len <= 1)
return;

// swap a randomly selected value to the last node
swap_str_ptrs(args+((unsigned int)rand() % len), args+len-1);

// reset the pivot index to zero, then scan
for (i=0;i<len-1;++i)
{
if (strcmp(args[i], args[len-1]) < 0)
swap_str_ptrs(args+i, args+pvt++);
}

// move the pivot value into its place
swap_str_ptrs(args+pvt, args+len-1);

// and invoke on the subsequences. does NOT include the pivot-slot
quicksort_strs(args, pvt++);
quicksort_strs(args+pvt, len – pvt);
}

Q Find an element in an rotated array ?

Q Design an amazon wide timer system ? Where all services can register themselves and get a notification for all events that they register for a particular time?

Q Find sum of all paths of a tree if nodes contain integer value . path is like 123, 124 etc. then sum of these values.

Q given a string and index rotate the string after that index, Example string : “abcdef” , index: 4 then output : efabcd

Q Design a media player

class mediaPlayer {
public:
mediaPlayer();
~mediaPlayer();
bool play(int index)
bool pause()
bool stop()
int getCurrentPosition()
bool SetPosition()
bool SetSuffle();
private:
vector<Song> vSongs;
string PREFERENCE_SHUFFLe
string preference)repeat
bool playSuffle()
}
class Songs
{
private:
string Name;
float duration;
}
class Playlist
{
clear()
private:
vector<Song> vSongs;
int size;
string name;
}
// in-place using divide and conquer
void mediaPlayer::playShuffle(int start,int end,vector<int s , int e> v)
{
int size = vSongs.size();
int index = Math.random(start, end);
play(index);
int i=Math.random(0, v,size());
//delete that value from vector
if(i==0)
{
playShuffle(start,index-1);
v.push_back(index+1,end-1);
}
else
{
playShuffle(index+1,size-1);
v.push_back(index+1,end-1);
}
)
//for(int i=0 ; i < size ; i++)
}
Q Design cost-effective Parking Lot System ?
Q Design Snake & Ladder game.
Q Design Amazon product dispatch to various customers ? Basically item distribution from warehouse to customers .
Q Implement topological sort ?
Q Replace array element with  greatest number in right  in an array ?
Q Replace array element with  just higher number in right  in an array ?
Q Infix to Postfix ?
Q Evaluate a postfix expression ?

## BlackRock Gurgaon

k operations on an array , in each operation chose randomly and number and divide it by 2 and enter its ceil back to array . chose numbers in a way that finally array sum is minimum.
~ 10 bags each bag containing 100 balls . each ball weigh 1 gm , one of the bag has light balls each having .9 grams , find it in minimum weighing ?
—— Find square root of a number.
lily rose max dp
https://www.geeksforgeeks.org/flipkart-internship-interview-on-campus/
camel puzzle

use object as a class key : overload < operator
call virtual function from constructor — in java & c++
median of a stream
sum of two numbers equal to a numer in a array
lru
return vector from a function – smart pointer
numbers in two different files — return the intersection
when to use c++ and when to use c#

## LiveCareer Noida .NET Technical Architect Interview

Web hooks
MVC Model in detail
SOLID principle
IOC & Dependency injection
routing
divide a cake in 8 pieces in 3 cuts
level order print of tree
Is model class a static class ?

## Tata Elxsi , Bangalore – Johannesburg Webkit Interview

storage classes in  c

when is stack used ?
when is heap used ?
why virtual destructor ?
Is virtual constructor available in C++ ?
how dynamic memory allocation is done in c++ ?
heap fragmentation in c ?
why do we not have virtual constructor in c++ ?
C++ 11  : move constructor and move assignment
why lambda expression in c++ ?
what is major and minor number ?
different webkit port ?
drm , eme in webkit ?
how data is stored in webkit ?
different component of webkit ?
Webkit features ?
heap fragmentation ?

## Akamai Interview Questions, Bangalore:

Q. Probability of two person with birthday lying in same month ?

Q. If 4 person in a group , Probability of at-least two person having birthday in same month ?

Q. If there are 16 teams in a tennis tournament , and its already mentioned which teams win against which team . Conduct matched to get the winner in minimum time.

## KeySight Technologies Interview Questions , Manesar Gurgaon:

Q From Collections of Balls objects Of red , green, blue color given in an array , Arrange them such that Red balls are followed by green balls followed by blue balls.

Q. Explain how LD_Library_Path is useful ?

Q Explain header guards ? Do they improve runtime or compile time performance ?

Q Issues when portng a code on 64 bits from 32 bits and while porting to a  different platforms ?

vector<int> c;

for (int i =0 ; i < c.size();i++)

{

}

How above code will be affected ?

Q. How would you solve/debug an error if you get references not found while compiling a code ?

## Pine Labs Interview Questions , Noida :

Q Implement a thread-safe Singleton class.

Q. If many integer pairs are mentioned in a file. Algorithm to search , update in less than O(n) time. You can pre-process the data ?

Q Where to initialize constant static ?

Q. Size of an empty class?

Q Program to check if brackets in an expression are balanced ?

## WSP I Parsons Brinckerhoff, Noida India Questions:

What are your thoughts on C++ ?

What are your thoughts on C# ? Compare with C++.

Difficulties faced in coding in C++ on Windows and Linux ? What are the difference ?

Which features you like best in C++11 ?

## CVENT, Gurgaon Questions:

Q Codility round: Return  minimum distance between two entries of an array such that  A[j]  > A[i] > A[j] & (i-j) is minimum i.e Minimum distance between two consecutive numbers in array.

E.g. 2 1 5 3 6

for 2 , d(1)=1 & d(3)=3 i,e minimize distance of next higher & smaller.

for 1 ,d(2)=1

for 5 , d(6)=2 & d(3)=1

for 3 , d(2)=3 & d(5)=1

for 6 , d(5)=2

So minimum distance returned is 1.

Solve this in O(nlogn) Complexity and Space complexity of O(N)

Note: Array can have duplicate numbers.In tha case also find strictly increasing or decreasing next number.

Hint: Sort the numbers.

Q Why factory pattern is introduced ? Whats its significance ?

Q What are anonymous functions in JavaScript ? Why are they required ?

Q. Explain load balancer in detail and how it is implemented ?

Q Solve dfs for a graph. Show how to find shortest path usinf Djiksta’s algorithm ?

Q. Difference in Abstraction & Inheritance.

Q. Generics , IEnumerable in C#

Q Join Queries in SQL Server

Q. For a given number find count of all numbers that are multiple of 3 &5 and smaller then that number

Q. How deadlock is handled in production if it has already occurred ?

Q. How can you prevent deadlock ?

Hint: By assigning resources to every thread in a predefined order only.

Q. What is SOA Architecture ? Why is it required ?

Q Why Web method is required when Web Applications ar already there?

Q. REDIS , memcache , Cache Management

Q Database normalization techniques

Q Check if a binary tree is BST or not ?

Q Print matrix in a radial order ?

Q Security concerns in Web Applications & Services ?

Q Cross Site Scripting , Many requests at a time  (Blot) handlings

## Truly Madly , Saket,Delhi Interview Questions:

Q In an sorted array containing duplicate integer values find , starting index and ending index of a searched value ?

Eg, Array Containing values 2,2,2,2,3,4,5,6,6,6,6,6,6 , if 6 is searched anser is starting index is 7 and ending index is 12.

Q. Find all triplets in a sorted array such that a2 +b2 = c2 .Here find it in Complexity O(n)

Hint : For every value of c in error , start two pointers from start and end to satisfy the equation(O(n)) .This will b repeated for all n elements.

Q In an array containing strings , find pairs such that  concatenating two results in a palindrome.

Hint:Store reverse of each string in trie structure. Try finding if any string matched with any trie string , wherever mismatch occur check if left characters are palindrome , if so then string formed by combining two in that order will be a palindrome,

Q Print right & top view of a tree.

Q. For following f(x) & x , find f(x) as a function of x

f(1)=3,f(2)=4,f(3)=5,f(4)=6,f(5)=7,f(6)=8,f(7)=1

Hint : Subtract 1 from right hand for all sets and see if u can identify the pattern now in x & f(x)

## Expedia Interview Questions , Gurgaon , Lodging team :

throw vs throws
write a sample stateless function that can be called from service or web application
server push data — reverse ajax
finalise
yield vs sleep
lru
given a set [3,1,6] , find any number that can be creted with it which is more than this number(say more than 898)
if a tree is bst
should database connection be singleton: as it may read write at the same time

Hint: http://stackoverflow.com/questions/6507687/should-a-db-connection-be-a-singleton
extends vs implements
abstract vs interface
mutable vs immutable
write a program involving mutex
composite design pattern
syntax of a function getting two inputs from two text boxes
can a class be garbage collected if in use ? under what scenario ?
applet parent class ?
jdbc frameworks ?
factory design pattern
Logging – asynchronously
events argument in function
generics
container vs vector ///collection
vector
reverse indexing
caching server side client side
sessions
issues with singleton ?

web server pipeline ?

soa vs soap ?

Implement web service for cab booking ?

producer-consumer problem ?

What should be kept in mind while designing web service ? Scalablity, Extendiblity

convert int to string without typecasting ?

Mvvp design pattern

unit/functional/integration testing

print tree in a spiral order ,

find common nodes in two  lists

, nsp – nurse scheduling problem ,

n-p hard ,

djikstra algorithm ,

command ,strategy , builder ,mvc  design patterns

write xunit test cases ,

git create branch ,

why multiple inheritance is avoided in java

nut-bolt puzzle – can be solved in nlogn with quicksort,

delegates vs callbacks , when to use delegates only ?

list vs ienumerables vs containers – when to use what ?,

write an ajax call ?

, any feature u have used from .net 4.5  ?

,  what kind of authentications ?

, global.asax

, why aws ?

, how session works , different ways ?

why linq is required ? when is it absolutey necessary to use it ?

Why mvc ?? ,

can we have multipile same ids on same page ?

how is class different from id ?

httpruntime vs httpmodule ?

## 1e , Noida Interview Questions

How Agile development helps ?

delete this ?
func(int i){
char a[10];
// assign this i to a
return a;
}
Solution:
void func(int i){
char a[10];
// assign this i to a
sprintf(a,”%d”, i);
cout << a;
//return a;
return;
}int main()
{
//cout <<
func(2222);
}
Any 2 interface to COM ?
virtual function ?
given 3 sides find if  its a triangle ? which triangle ?
Copy Constructor ?
tools for unit test
struct vs class ?
what is required from client side in case of a crash
Solution:
On Windows you may configure Dr.Watson at client machine, so that if your application crashes it’ll create the so-called “minidump file”, which may then be opened by the debugger with the appropriate PDB.

You may also add an unhandled exception filter to your application and produce the minidump yourself in case of an irrecoverable error.

Edit:

In case you want to produce the dump file upon an (unhandled) exception – don’t do this inside the C++ `catch (...)` block, because it’s invoked after the unwind took place, and the original call stack is unavailable.

In order to capture & dump the call stack you should dump it before the stack unwinding. Like this:

int HandleMyException(EXCEPTION_POINTERS* pExc)
{
// dump it
MiniDumpWrite(…);
// Unless you decide to terminate your process, return EXCEPTION_EXECUTE_HANDLER, so that the execution
// continues normally after the __except block.
return EXCEPTION_EXECUTE_HANDLER;
}__try
{
// Do something…
}
__except
(/* stack still not unwound */ HandleMyException(GetExceptionInformation()))
{
// unwind already took place here, nothing to dump
}
count n urls ,there could be  billion url’s design a data structure for storing their frequency
—Solution could be to represent each url as a distinct bit , which would reduce memory utilized
Test an hashmap implemented by you for performance and correctness ?
Iteration is faster in vector or list ?
difference in ip & mac address ? why each  is necessary if other is there ?
what all stuffs you do in debugging ?
puzzle : If you have 20 Blue balls and 10 Red balls in a bag. You put your hand in the bag and take off two at a time. If they’re of the same color, you add a Blue ball to the bag. If they’re of different colors, you add a Red ball to the bag. What will be the color of the last ball left in the bag?

## RateGain , Noida Interview Questions

Puzzle for 25 Horse running in a race , A paper whose one quarter edge is removed , divide it into 4 equal parts
Replicate a data into cache such that no data is lost even if service doing it crashes ?
Lock vs Semaphore
Producer Consumer problem ?
Handle deadlocks at database level ?
How to deal with two taks each involvinf several stored procedure to commit in an atomic manner ?
Kind of locking for Producer Consumer in a queue?

## Aspiring Minds, Gurgaon , Online Amcat Test :

Q Amcat Trapezium pattern Solution — http://impulse-labs.blogspot.in/2015/04/amcat-programming-solution-1.html

Q Check if two passed char are grayCode meaning they differ by a single bit int isGrayCode(char text1 , char text2)—

Solution is to XOR both values and check if its a power of two

## Macquarie , Gurgaon , Telephonic C++ Discussion :

Private Inheritance over Composition ?

why =0 in pure virtual function , why not say -1 or +1 ?

How to make sure from function syntax that function a. Won’t throw any exception ? b. throws Int exception ?

When is dynamic_Cast used ? What does it return in case of casting pointer and casting Reference.

It returns NULL for pointers and bad+cast for Reference.

Choclate wrapper puzzle :http://malini-math.blogspot.in/2010/11/chocolate-puzzle.html

v_ptr ? v_table ? order of storage in v_table ?

Initialization list ? when its used ?

Diamond problem ? http://www.geeksforgeeks.org/multiple-inheritance-in-c/

If a function expects array as an argument how to pass  Vector ?

Implement your own vector class , own auto_ptr class including all functions  , string assignment operator overloading function

Whats the use of Constant function ? How its declared ?

What are smart pointers ?

Can auto_ptr be used with Containers like vectors ?

Exception in Constructor , Destructor ?

Anonymous namespace vs static ? Which one is better ?

Print a tree in spiral order ?

linux command to output find output as an input to grep ?

## Tower Research online test hackerrank, Gurgaon :

Q https://leetcode.com/problems/trapping-rain-water/

Q https://krzychusan.wordpress.com/2014/03/29/hackerrank-stock-maximize/

Q. http://stackoverflow.com/questions/28403614/number-of-submatrix-with-sum-k

Q baloon burst problem with a modification that cost is max (middle , middle+1) and you have to minimimze the cost ?

Q. Get min cost in an array such that you call remove(i) for all index of the array , and it replaces a[i] with max(a[i],a[i+1]) and delete the other value  which is not max and cost of this operation is max(a[i],a[i+1]).

Solution:

#include <iostream>
using namespace std;
int check(int *arr,int index, int size)
{
int cost=0;
if(index>0 && arr[index]>arr[index-1])
cost+=arr[index];
if(index<size-1 && arr[index]>=arr[index+1])
cost+=arr[index];
return cost;
}
int getValue(int *arr, int size)
{
if(size==1)
return 0;
int counter =0,cost=0;
for(counter=0;counter<size;counter++)
cost+=check(arr,counter,size);
return cost;
}
int main() {
int size;
int *arr;
cin >> size;
arr=(int*)malloc(size * sizeof(int));
for(int i=0 ; i < size;i++)
{
cin >> arr[i];
}
cout << getValue(arr,size)<<endl;
return 0;
}
Q number of all submatrices  whose sum is k ?

## Aspiring Minds Interview Questions , Gurgaon

Implement auto-complete feature while code writing ?
Suggest architecture for AMCAT product ?
Explain Singleton class ?
Exchanging k toffee’s for single wrapper , how may chocolates can you eat if n toffee’s are given . Write a program given n & k as parameter.

## LexInnova , Gurgaon Interview Questions

Puzzle – 100 guys walking at speed 1km/hr from Delhi to Agra , you have a bike and you can carry one guy at a time , minimum time required to reach Agra ? Fuel is unlimited.

Technical – In dijkstra’s algorithm , if weight is multiplied instead of addition , Will there be any issues in calculating shortest path ? If an issue is there , how to resolve it ?

## Nav BackOffice , Jaipur Telephonic Interview Questions

How do you use boot-strap ? Does it come with .NET framework or you have to install it seperately ?

What is bundling in asp.net ? //Introduced in .NET frameowrk 4.5
Explain view-state in asp.net
Difference between cache and session ? Is cache on server side as well ?
What is json object ? How do you recieve a json object in web application ?
Have you worked on wcf ?
How to build a responsive website ?
Have you used HTML5 ?
Which project do you select in Visual Studio to create a web service ?

## Macquarie Video Conference with Australia Questions :

Q What is wrong with this code (both programmatically and conceptually) ?
atoi(char *s)
{
int ret;
char *t=s;
while(*t)
{
ret=ret*10 + *t -‘0’;
++t;
}
return ret;
}
main()
{
char * s;
strcpy(s,”125″);
printf(“%d\n”,atoi(s));
}
Q Please complete following Buffer class code
by adding cast operator() such that the code compiles
class Buffer
{
enum{SIZE =10*1024*1024}
public:
BUffer()
{
buffer_ = new unsigned char[SIZE];
}
private:
unsigned char* buffer_;
};
void foo(const unsigned char* buffer)
{}
int main(int argc , const char* argv[])
{
const BUffer buf;
foo(buf);
return 0;
}
Q Write a function to reverse a C style sub-string in place
void reverse_sub_string(char* begin , char * end ) //don’t use STL
Q Write a function to finf depth of  a tree and its average weight if every node is assigned some weight.
Q Write an algorithm capable of linear interpolation
double interpolate(double point , double * x , double * y , size_t elements)
where x & y is array of double (0.0,5.0) , (3.0,12.0) respectively & elements gives length of array

## Tower Research , Telephonic Interview:

Q How would you store a large graph in Memory ?
Q How would you allow a socket to receive data streams from N Sockets if its a single threaded application ?
Q http://www.geeksforgeeks.org/given-a-number-find-next-smallest-palindrome-larger-than-this-number/

## Ciena , Gurgaon C++ Interview Questions :

Why do we need virtual destructor ?  What happens if none of the parent and child has destructor as virtual ? What happens if child has  virtual destructor ?
When is Private Inheritance required ? Private inheritance vs Composition ?
Aggregation vs Composition ?
Delete leafs of a binary tree ?
Why is prototype design pattern required ?

## Reliance Jio , Gurgaon (Cloud team)

Q. write a singleton class and make it thread safe ? Why two null checks are required ?
Q. Print Odd Even using two threads
Q. 25 horses , fastest 3 horse puzzle
Q. Play a game between two players where each player can pick 1-4 balls , there are 100 balls :
case a :the person picking the last ball lose .
case b :the person picking last ball wins
Q Implement dfs/bfs
Q In a stream of numbers , find kth smallest number with window size w
Q Find median of two sorted arrays ? Extend solution to n sorted arrays.
Q In a string , find first non repeating character ? optimize solution for space ? optimize solution for time ?
Q Scale a chat application from 100 users to a million user :
Solution : Make the application:
a. Scalable : use aws , load balancer (What algorithm load balancer use ?)
b. Reliable : store data on s3 (Implement your own S3)
c. Available : CDN (How CDN works ?) , Monitoring , AWS monitoring
d. avoid latency: caching , redis/memcache
Q Design a crawler service ?
Q why redis over memcache , sql over oracle ?
Q Is subtrees in a tree a binary immage of itself ?
Q Dynamic programing: No of ways a person can reach n steps , if he can skip 1,2 or 3 steps at a time
Solution: http://www.geeksforgeeks.org/count-ways-reach-nth-stair/

## Quovantis technologies Interview questions, Delhi:

Q There are n switches. Design a solution to take action based on how many times a switch is pressed. The n switched can be from different vendors ?
Q 25 horses , fastest 3 puzzle
Q. Questions mainly related to projects

## Nagarro Gurgaon , Gurgaon

MVC pipeline
how to avoid joins in large tables ?
is caching in mvc a good idea ?
routing ?

## Amazon Interview questions, Chennai;

Word break problem
http://www.geeksforgeeks.org/dynamic-programming-set-32-word-break-problem/
Baloon burst problem
https://www.hrwhisper.me/leetcode-burst-balloons/
If two trees are mirror image ? Discuss time and space complexity of solution.
Going from one word to another using words in dictionary changing one letter at a time ?
http://www.geeksforgeeks.org/length-of-shortest-chain-to-reach-a-target-word/
How huge data must be stored ? Location wise or replicate data on all data centers ?
Find number of zeros in an array of all 0 followed by 1 ?
Design a chess board ? Write all classes.

## Aristocrat , Noida Online assesment and Interview Questions

Q. class A

{}

Class B1: virtual class A{}

Class B2: class A{}

Class C: class B1, class B2{}

Static cast vs dynamic cast for reference? A & = static_cast<A&>(new C());

Q. How many times constructor of A is called ?

Q Puzzle : Person A, B, C either belongs to Truth Tribe or Lie tribe. A speaks “I belong to …. Tribe” , hearing A ,B says A has said that “He belongs to lie tribe ” and C then hearing B says B is lying .Which community A belongs to ?

Q How to Avoid copy of objects?

Q. Making copy constructor private and not defining it just declaring it.

class Aa

{

private:

Aa(const Aa& a);//{};

public:

Aa() {};

//Aa(const Aa& a) {};

void f(Aa *a)

{

Aa aa(*a);

//Aa bb = a;

}

};

int main()

{

Aa aa ;

aa.f(&aa);

return 1;

}

Q. Initialization list? what’s the difference when members are initialized vs when using initialization list? Why reference is to be initialized using initialization list ?

Q. Difference between pointers and references?

Q. Create a container class for employee in c++ using empid, name, designation with following api:

Q template int specialization syntax for addition function

Q How to input string of unlimited size?

Q. Operator delete can be overloaded ?

Q   Find number of char in a string?

Q  A{

A(int z){};

}

B{

B():A()

}

Should B constructor with one argument be defined  or A should define constructor without arguments must be defined?

Syntax of Func pointer to class member function ?

How to write a Const pointer to var ?

A* =new A() ;  vs

A*=new A ;

Q How to use erase while iterating ?

http://stackoverflow.com/questions/2874441/deleting-elements-from-stl-set-while-iterating

Cyber Group  , Noida Interview Questions:

updatePanel – ajax,

binding model to view,

handle concurrency on web api call ,

jquery async vs,

logical vs physical data modelling

, attribute routing ,

store image on one server but retrieve on another : sticky session , https://serversforhackers.com/so-you-got-yourself-a-loadbalancer

automated deployment – in aws,

wcf vs web api

## Siemens Gurgaon C# :

interface, abstract in c#
liskov substitution principle in c#
when multiple requests hits a web service which was earlier working fine  but now  starts hanging , what could be the reasons ?

## Mobikwik Gurgaon Java :

What new features in Java 8 ?
How Java is advanced than .NET ?

Design twitter ? Mainly focussed on partitioning of data and which db to used ?
max size rectangle containing 1 ?

https://www.geeksforgeeks.org/maximum-size-rectangle-binary-sub-matrix-1s/

Code for expression processor ? like

AND{
x > y,
y > 7,
OR{
x <2 ,
y .-1,
AND{ x==y}
}
}

Codechef 2019 Challenge java solutions

## Guardian , Noida METTL online test

Data saved between redirection ?
2 coding question : a. find count of palindrome words in a statement.
b. Depth of json ?
Association vs Aggregation in a Code ?
Design pattern : Don not changes Base class and child class to intraoduce a change , which design pattern ?
Which SOLID principle not followed in a given code ?
When is a LINQ query executed ? Are all linq queries lazy load ?
Which httpMethod is Idempotent ?
Dependency inversion ? Based on a code given.
2 rounds of Aptitude and problem solving
Cross Site Scripting multiple choice questions
virtual function usecases in program
try-catch
exception throwing