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
Solution: http://www.geeksforgeeks.org/find-water-in-a-glass/
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.
RBS GURGAON INTERVIEW QUESTIONS QUANT DEVELOPER CPP PROFILE
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 Design Instagram post update and notification to all followers feature ?
Q. If suppose 10 vouchers are available and millions of takers at the same time , how to handle such scenerio ?
IRIS Noida Interview Questions
Vizexperts Interview Questions , Gurgaon:
Q Large Image Loading:
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
Additional instructions:
- 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).
- 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.
- iv) Attach proper readme on how to run. Attach sample data that was used for testing.
- 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
BlackRock Gurgaon
https://www.geeksforgeeks.org/
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
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
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 ?
KNOWLARITY Gurgaon Interview Questions
Mobileum Gurgaon Java , Big Data Analytics team
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. Sessions , Cookies
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
AGODA BANGKOK THAILAND INTERVIEW JAVA
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 ?
char a[10];
// assign this i to a
sprintf(a,”%d”, i);
cout << a;
//return a;
return;
}int main()
{
//cout <<
func(2222);
}
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:
{
// 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
}
RateGain , Noida Interview Questions
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 ?
Solution: https://writeulearn.com/leetcode-solutions/#Burst_Balloons
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:
Aspiring Minds Interview Questions , Gurgaon
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 ?
Macquarie Video Conference with Australia Questions :
Tower Research , Telephonic Interview:
Ciena , Gurgaon C++ Interview Questions :
Reliance Jio , Gurgaon (Cloud team)
Quovantis technologies Interview questions, Delhi:
Nagarro Gurgaon , Gurgaon
Amazon Interview questions, Chennai;
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:
Add(…..) ,find(empid) ,delete(empid)
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
Python interview questions for freelancing
Occurance of a set of strings in a file
What are modules in python
redirect stdout to a fie in pyhton
zip command in python
lambda function in python
try catch python
sequence in python
with command in python
It’s handy when you have two related operations which you’d like to execute as a pair, with a block of code in between