Interview DesKClick Here to share your interview experience! |
|
< DrishtiSoft | Microsoft > |
Cisco | (electronic packaging designer) |
1.#define clrscr() 100
main()
{
clrscr();
printf(?%d?,clrscr());
}
2.A triangle ABC is given, a line DE is paralel to base side and that cuts the triangle. The ratio of area of triangle to the area of trapezium .given DE/BC=3/5.
3. struct s1 { struct { struct {int x;}s2}s3}y;
How to access x? ANS: y.s3.s2.x
4.Given two numbers m and n, write a method to return the first number r that is divisible by both (e.g., the least common multiple).
ANS:Define q to be 1.
for each prime number p less than m and n:
find the largest a and b such that p^a m and p^b n
let q = q * p^max(a, b)
return q
5.There are set of coins of {50,25,10,5,1} paise in a box.Write a program to find the number of ways a 1 rupee can be created by grouping the paise.
6. ONE PUZZLE THAT I REMEMBERED.
At the local model boat club, four friends were talking about their boats.
There were a total of eight boats, two in each colour, red, green, blue and yellow. Each friend owned two boats. No friend had two boats of the same colour.
Alan didn't have a yellow boat. Brian didn't have a red boat, but did have a green one. One of the friends had a yellow boat and a blue boat and another friend had a green boat and a blue boat. Charles had a yellow boat. Darren had a blue boat, but didn't have a green one.
Can you work out which friend had which coloured boats?
7.main()
{
printf(?as?);
printf(?hi?);
printf(?is ?);
} wat will b printed.
10. main()
{
unsigned short a=-1;
unsigned char b=a;
printf(?%d %d ?,a,b);
}
wat is o/p of the program
8.Given an array which is alternatively sorted. Find an element in it.
e.g. 12,2,16,5,18,32,33,38
9.selective repeat widow size of sender & receiver 1 question.
10.main()
{
int *i;
int s=(int *)malloc(10*sizeof(int));
for (i=0;i<10;i++)
{
printf(?%d?,i*i)
}
whats the output?
11.Design an algorithm that, given a list of n elements in an array, finds all the elements that appear more than n/3 times in the list. The algorithm should run in linear time ( n >=0 )
You are expected to use comparisons and achieve linear time. No hashing/excessive space/ and don't use standard linear time deterministic selection algo
12. In a tournament with N teams, where in one team can play only one match per day, develop an algo which schedules the matches in the tournament.
Each team shall play with the other team once(same as designing the league matches of a Cricket tournament like IPL)
He also asked me to optimise on days
13.main()
{
int ret;
ret=fork();
ret=fork();
ret=fork();
ret=fork();
if(!ret)
printf("one");
else
printf("two");
}
14.Bridges are used in which layer?
and dey asked lot of qstn on geometric algorythm and my master's project as i was applied for electronic packaging designer in cisco system r&d bangalore