Sunday, August 22, 2010

Reverse the Linked list

Reversing the linked list.....

void reverse()
{
mynode *p , *q , *r ;
if( head == NULL)
{
return ;
}
p = head ;
q = p -> next ;
p -> next = NULL ;
while( q != NULL )
{
r = q -> next ;
q -> next = p ;
p = q ;
q = r ;
}
head = p;
}

TIME COMPLEXITY : O(n)

Friday, August 20, 2010

DELOITTE INTERVIEW PROCESS

Deloitte , it is a management company so interview process wont be more technical.

FIRST ROUND :
40 aptitude questions, contains
---> problems on numbers
---> data sufficiency questions
---> comprehension questions
---> general maths questions

SECOND ROUND :
students shortlisted from first round are separated into batches. then given a case study to individual batch . they have to discuss and present to the interviewers.

THIRD ROUND :
It is HR + Technical round.

As it is a management company, English fluency is very important !!!

All the best .....

Thursday, August 19, 2010

AMAZON AND GLOBAL SCHOLAR

AMAZON interview process :
first round : section A : 15 questions (technical aps) , section B : 3 programming questions
three to four technical rounds.

GLOBAL SCHOLAR interview process :
first round : Section A : 10 aptitute (quants) , Section B : 10 aptitude (c++ and Java) , Section C : 5 programming questions.
technical round
HR round

Programming questions asked in Global Scholar

here are the some programming questions...
1. given the linked list with one character at each node.. our work is to find whether the given linked list is palindrome or not ?

2. Given an array .. 1, 2 , 0 , 5 , 8 , 9 , 3 , 6
output:
1,2 //increasing thread
2,0 //decreasing thread
0,5,8,9 //increasing thread
9,3 //decreasing thread
3,6 //increasing thread

3. given a binay tree...
print the elements in the zig-zag order.
eg. ---->1----------------->
<---------2 3<---------------
----->4 5 6 7--------->
8 9<-----------

Amazon 1st round questions

here is the
Amazon 1st round questions...

Part A
-------

1.int foo(int n)
{
if(n<=0) return -1;
else
print n;
n=n/2;
return foo(n);
}

find the complexity ? Ans: O(log n)

2.What is the Big 'O' notation for (n+10)*(n-6) ?

Ans : O(n^2)

3.which is better function A or c? under what circumstances?

void A()
{
while(testandset(lock));
}

void c()
{
while(testandset(lock))
{
try{
sleep(x);
}
catch(Exception e){ }
}
}

testandset function is....

boolean testandset(lock)
{
if(lock) return false;
lock = Locketd;
return true;
}

4. Execution time of the tasks are 4,4,7,8,9 . by what way these task should execute so that average time shoubld be least and write the schedule.

5. write the query to find second highest mark.
Student(rollnumber int , name varchar,marks int)

6. find the minimum of x,y without using branching statements?
a)(y-x)-(x-y)<<1
b) x>y?x:y
c) y+((x-y)&-(x d)x^((x^y)&-(x
7.write the grammar for the expression 1+2*3(4+5)*(6*7)

8.another TOC question to find what the given transition diagram does?

9.given a java program(binary search program) , debug the program.

10. given a number, find whether it is a power of 2?

a)num & (num-1)
b)num && (num & (num-1))
c)num && (num & num-1)
d)num && (num-1)

11. given a code:
int hashcode()
{
return 0;
}
find complexity ?
12. x % y ---> leaves remainder 24
2x % y ---> leaves remainder 11
what is the value of y?


Part B
------

1. given an array {5,3,6,2,7,1,4}. sort the odd position elements into descending order and even position elements into ascending order.

O/P : { 7,6,5,4,1,2,3}

2. given two numbers.
reverse 2 numbers.
add those two reversed numbers.

Input : 31000
2500

Output : 65

In placements, every company 's first round ll be very basic. clearing the first round is the big hurdle. it contains the questions of all field.

Wednesday, August 18, 2010

Work hard ! Achieve success !!

hi friends,
I created this blog to share my interview experiences and share what i studied which may be useful for your placements . Here, we can discuss all type of interview questions such as technical , HR and etc... All the best .

regards ,
spgokul