Saturday, November 21, 2009

Singham's Chronicle

A Day with

Campus Recruitment

I was shortlisted for the first time in the history in HoneyWell, internship programme. Any how God booked this dullhead's name on the papers. . .

It was fine November morning, as usual I was prayed for my placements, But I dont have any intention to have my interns in Honeywell. Again, I prayed to have my first Ever Panel Experience.I went to placement office after checking my name in Placement Notice Board. I saw SivaGuru with moooooore sparkling eyes and it shows tat only way is the internship. Then Myself, Guru & Sarvesh fetch some 2 bags & 20 packets of water bottles. The First Time Service to the Placement Cell. Then, time speeds up to 09:30am. A big fat fellow simply, we can say him as Maduraey Veeran... came put some mokkai on HLTS, Honeywell in Y302.

On morning session, they mocked Anbu, Gowtham, Loki, all gals they all finished at particular panel , its all works of Sreeeeeeeniiiiiiii, Ghillllllllliiiiii who had done a tremendous job for f5erz they are the sole responsible for everyone's right path due to them, most of them chose the panel directed by them...,

About Interview Questions,
Data Structures Linked List, Sorting thats all!!
OS Based on Area of Interest
DBMS Joins & Queries
C , C++ pointers and OOPS
JAVA based on project
Networks very very few

I attended after 4'o clock only... I saw the ferocious of some of our f5erz especially GV..., what an involvement he had.., I can understand that on the same day, he learned practically many things in his Career.

I am last 3rd to attend. My first panel. The first time, I am entering the Placement room. A mild cry of happiness fills the eyes. I feel as if a child, first time, try to stand on his feet without his mother's intervention. The war is to me and on me. I also feel that A mammoth of men facing towards me. I am armless, but smiling face of Sreeenii, Ghilli, Siiiidu helped to grab my situation.
I attended to Panel-5 A smart Gentleman like Vibu sat there.

He started the converstation by asking the question called "Your Achievements of Life"
then proceeded by asking the question in C, constant pointers & pointer constant

int i[] = {0,5,11,15,21,25};
// Prefix Incrementer
int *p=&i;
*++p = 5 (first increment then return)
p = &i;
*(++p) = 5 (first increment then return)
p = &i;
(*)++p = syntax error
p = &i;
++(*p) = 6(5+1)

// Postfix Incrementer
p = &i;
*p++ = 0 (first return then increment)
p = &i;
*(p++) = 0 (first return then increment)
p = &i;
(*)p++ = syntax error
p = &i;
(*p)++ = 0


const int *p;
integer pointer is constant
value cant be modified
but can be referenced to another pointer
int *q= &p;

int * const p;
constant pointer is integer
value can be modified
but cant be referenced to another pointer
int *q = &p; //error : referencing READ-ONLY memory
const int * const p;
value cant be modified & reference cant be assigned

This is my question... even I knew it, I stammered and I confused him...

the next question is
function pointers and what is the use of it?
i said correctly but i cant bring the use of function pointers

Function Pointers :

return_type (*pointers)(arguments,....);

int (*fp) (int[],int,int)

Use of Function Pointers :

I am having 2 different functions (1) min (2) max
int min(int arr[],int low,int high)
{. . . //returns index of minimum }
int max(int arr[],int low,int high)
{. . .//returns index of maximum }
int value(int (*fp)(int[],int,int) , int arr[])
{. . .// returns value of array at the index
int i = fp;
return arr[i];
}
int main(){
int arr[]={1,0,2,9,3,8,4,7,5,6,1};
int (*fp)(int[],int,int);
fp = max(arr,0,10);
value(fp,arr);
fp = min(arr,0,10);
value(fp,arr);
return 0;
}
Sorry Guys!! I dunno how to return a function pointer from a function. Next Question is Array of Pointers and Pointer to an Array.

Array of Pointers & Pointer to an Array:

array of pointers int *arrOfPtr[10];
pointer to array int (*ptr2Arr)[10];

int main(){
int arr[]={1,0,2,9,3,8,4,7,5,6};
int *arrOfPtr[3]={arr,(arr+4),(arr+9)};
int *(ptr2Arr)[3]=arr;
for(i=0;i<3;i++)
printf("\n%d.%d.%d.",
arr[i],
*arrOfptr[i],
(*ptr2arr)[i]
);
return 0;
}
output
1.1.1
0.3.0
2.6.2

Copy Constructor in C++ :
I wrote the code. . . and also explain it... but he asked when a copy constructor is called!
A Copy constructor is called when an object is returned, called, passed as an argument, thrown, caught, placed in braced-enclosed list
class A
{
public:
int i,j,k;
A ()
{
this->i=1;
this->j=2;
this->k=3;
cout<<"\nDefault";
}
A (A &copy)
{
this->i=copy.i;
this->j=copy.j;
this->k=copy.k;
cout<<"\nCopy";
}
};
int main()
{
A aa = A();
A const a;//A(const A& copy){}
A b = a;
A c;
A d = c;
}
/*
valid copy constructor
    A(const A& copy);  
   A(A& copy);  
   A(const volatile A& copy);  
   A(volatile A& copy);  
   A(const A& copy, int = 10);  
   A(const A& copy, double = 1.0, int = 40);
*/
DataStructure :

kth largest element in an array! Its Complexity
Answer : Quick Sort at kth Partition
Circular Queue,
Doubly Linked List Deletion
OS : since my AOI plenty of rapid questions
Virtual Address Space, Device Driver, DMA, Page Fault, Thrashing, Working Set, Principle of Locality, Compaction, MMU-Paging, Segmentation, Segmented Paging

JAVA : Adaptor, Listener, Wrapper
FEEDBACK : I have done good job in FIRST round... he was impressed but he said I am Confident on my mistake . . . Not thinking certainly where I am doing the mistake. Oscillations in my answers. Sooooo....., I have done good job in SECOND round, tat is I answered all questions in OS especially . But all tat sucks me
I got these in First Round
7/10 in DataStructure
5/10 in C,C++ ;
6/10 in OS[this is not right judgement]
And my Second Round
3/10 in all DS,C,C++,OS






This is the Answer ---------------->









Okkkkkkk!!!!
Evalavoo Panroamamma Idhu Pannamatomma

No comments: