Alcatel-Lucent Interview Questions and Answers for 4 years Experience
1 / 6
Hi,
I'm Gursharan Singh. I have done diploma in I.T.E.S&M(Information Technology Enable Services & Management). I did schooling from C.B.S.E broad. I have about 4-5 months of experience in web development .I have two sibling.
No Tags on this question yet!
2 / 6
struct node * reverseList ( struct node *current, struct node *prev)
{
struct node *tmp = current->next;
current->next = prev;
if (tmp !=NULL)
reverseList(tmp, current);
return current;
}
No Tags on this question yet!
3 / 6
Ex. India is a Great Country.
Output: aidni si a taerg yrtnuoc.
reverseWordString ( char * str)
{
int len, i, j;
len = strlen(str);
j = 0;
for (i = 0;i < len; i++)
if ( str[i] == ' ')
{
swap (str, j, i-1)
j = i+1;
}
void swap(char *str1, int start, int end)
{
int i = start;
char tmp;
for ( ; i<=end; i++, end--)
tmp = srt1[i];
str1[i]= str[end];
str[end] = tmp;
}
No Tags on this question yet!
4 / 6
void setNthbit (int num, int bitposition)
{
num |= (1 << bitposition);
}
No Tags on this question yet!
5 / 6
No Discussion on this question yet!
No Tags on this question yet!
6 / 6
void owncpyString ( char const *str , char *rev, int length )
{
int i ;
for ( i = 0; (i < length && str[i] != '\0'); i++)
rev[i] = str[i];
if (i < length)
for ( ; i < length; i++)
rev[i] = '\0';
}
No Tags on this question yet!
1 / 8
No Discussion on this question yet!
No Tags on this question yet!
2 / 8
No Discussion on this question yet!
No Tags on this question yet!
3 / 8
No Discussion on this question yet!
No Tags on this question yet!
4 / 8
int (*b)[10];
int c[10] = {1,2,3,4,5,6,7,8,9}
a. is the below statement correct ?
a[0]=&c[0]; a[1]=&c[1]; ...... a[9]=&c[9];
b=c;
b. How to print the value using a and c ;
c. what will be the sizeof(a), sizeof(b), sizeof(c);
d. which operation is valid
1. a++
2. b++
3. c++
No Discussion on this question yet!
No Tags on this question yet!
5 / 8
char y[18] = "alcatel"
a. What will the the sizeof (x) and sizeof (y), strlen(x),strlen(y)
b. Whether the below statement is correct.
x++, y++
c. Whether the below statement is correct.
x[0]='L'
y[0]='L'
d. What if we allocate the memory and then
x=malloc(10)
y=malloc(10)
now perform the step b.
e. After the step c what will be the sizeof (x),sizeof(y)
f. What will be strlen(x), strlen(y);
No Discussion on this question yet!
No Tags on this question yet!
6 / 8
int y=0x01020304;
output y=0x04010203;
No Discussion on this question yet!
No Tags on this question yet!
7 / 8
No Discussion on this question yet!
No Tags on this question yet!
8 / 8
int detectLoop(struct node *head)
{
struct node *slow = list, *fast = head;
while (slow && fast && fast->next )
{
slow = slow->next;
fast = fast->next->next;
if (slow == fast)
{
printf("\r\nLoop detected in linked list \r\n");
removeloop(slow, head);
}
}
return 0;
}
void removeLoop(struct node *slow_node, struct node *head)
{
struct node *ptr1;
struct node *ptr2;
ptr1 = head;
while (1)
{
ptr2 = loop_node;
while (ptr2->next != loop_node && ptr2->next != ptr1)
ptr2 = ptr2->next;
if (ptr2->next == ptr1)
break;
ptr1 = ptr1->next;
}
ptr2->next = NULL;
}
No Tags on this question yet!
1 / 9
As given copy should be successful even source and dest address overlap, than we should implement memmove functionality
void ownMemMove(void *dest, void *src, size_t n)
{
char *src_l = (char *)src;
char *dest_l = (char *)dest;
char *temp [n];
memset(temp, '\0', n);
for (int i=0; i < n; i++)
temp[i] = src_l[i];
for (int i=0; i < n; i++)
dest_l[i] = temp[i];
}
No Tags on this question yet!
2 / 9
There are 100 doors, all closed. In a nearby cage are 100 monkeys. The first monkey is let out, and runs along the doors opening every one.
The second monkey is then let out, and runs along the doors closing the 2nd, 4th, 6th,... all the even-numbered doors.
The third monkey is let out. He attends only to the 3rd, 6th, 9th,... doors (every third door, in other words), closing any that is open and opening any
that is closed, and so on. After all 100 monkeys have done their work in this way, what state are the doors in after the last pass,which doors are left open and which are closed?
No Discussion on this question yet!
No Tags on this question yet!
3 / 9
No Discussion on this question yet!
No Tags on this question yet!
4 / 9
No Discussion on this question yet!
No Tags on this question yet!
5 / 9
No Discussion on this question yet!
No Tags on this question yet!
6 / 9
No Discussion on this question yet!
No Tags on this question yet!
7 / 9
No Discussion on this question yet!
No Tags on this question yet!
8 / 9
No Discussion on this question yet!
No Tags on this question yet!
9 / 9
No Discussion on this question yet!
No Tags on this question yet!