Monday, January 19, 2015

HCL Telephonic Interview Question


2. Then there were questions from project.
---- Now the real question start ..... he asked to have a notebook and a pen
3. How confident are you in c - rate yourself in a scale of 10
4. what is a volatile keyword

5. what is the output of the program <first he ask me to write each line, then output.>

#include<stdio.h>
int main(){
int i = -1, j=0,k=1;
int r = ++i || j++ && --k;
printf("%d %d %d %d", i, j, k, r);
return 0;
}

6. Will this program runs,if so then what is the output

#include<stdio.h>
int main(){
if() 
printf("Empty");
else
printf("not Empty");
return 0;
}

7. What will be the output of the program

#include<stdio.h>
int main(){
char *cptr=0;
int *iptr=0;
void *vptr=0;

cptr++;
iptr++;
vptr++;

printf("%u %u %u",cptr,iptr,vptr);
return 0;
}



8. What will be the output 

#include<stdio.h>
int main(){
char *ptr = 0;
free(ptr);
return 0;
}

9. What will be the output

#include<stdio.h>
#define CPTR char *
typedef char * CHPTR;
int main(){
CPTR c1, c2; 
CHPTR c3, c4;
printf("%d %d %d %d", sizeof(c1), sizeof(c2),sizeof(c3),sizeof(c4));
return 0;
}

10. what is static keyword, scope and life.
11. Can static be externed.
12. Asked about the values of the static variable.

void increment()
{
static int i = 4;
printf("%d",i);
i++;
}

int main()
{
int i= 0;
printf("%d", i);
i++;
increment();
printf("%d",i);
return 0;
}

13. Changing the location of static to global, inside main and asking what will be the value.

I had this much in C, Now its turn to OS.

1. what is a process
2. what is a thread
3. why thread is a light weight
4. what are the process states
5. when a process is waiting in which queue it will be
6. what is the difference between sleep and delay
7. what is the difference between mutex and semaphores

Now he moved to some Networking questions.

1. Questions on routing protocol
2. what is difference between routing protocol and routed protocol
3. L2 header formate.
4. Do you know Vlan, vlan pkt formate. 

Thats All I had in telephonic round with HCL, The good thing is I got call for second round i.e webex. I am very happy to share this with you.
Also I am really thanks to Q-4-interview, it help me to set-up my mind for this interview.

Hit/Like/Share...... 

https://www.facebook.com/pages/Q-4-Interview/891122957582283?ref=hl

No comments:

Post a Comment