Ciena Interview Questions and Answers for 4 years Experience
- Threads can directly communicate with other threads of its process; processes must use inter process communication to communicate with sibling processes.
- Both process and threads are independent path of execution but one process can have multiple Threads.
- Each process has its own code, data and kernel context (VM structures, descriptor table, etc). While the threads of a process, they share the same code, data and kernel context.
- New threads are easily created. However the creation of new processes require duplication of the parent process.
- Threads are created using clone() method. Process are created using fork() method.
- Processes are heavily dependent on system resources available while threads require minimal amounts of resource, so a process is considered as heavyweight while a thread is termed as a lightweight process.
- Context switch between the threads are not much time consuming. Context switch between the process is time consuming.
- Processes never share the same memory. When a child process creates it duplicates the memory location of the parent process. Process communication is done by using pipe, shared memory, and message parsing.
- Threads within the same process share the Memory(heap/global), but each thread has its own stack and registers, and threads store thread-specific data in the heap. Threads never execute independently, so the inter-thread communication is much faster when compared to inter-process communication.
- each thread has its own stack, having its own stack allow to have its own execuation context.
1 / 20
No Discussion on this question yet!
No Tags on this question yet!
2 / 20
char *p = "ciena"
char ar[] = "ciena"
strlen(p);
strlen (ar);
strlen (&ar);
5 5 5
No Tags on this question yet!
3 / 20
#include<stdio.h>
void strlength(char c[])
{
char *p=c;
int count=0;
while(*p!=NULL)
{
*p++;
count++;
}
printf("%d",count);
}
int main()
{
char c[]="prachi katarua";
strlength(c);
return 0;
}
No Tags on this question yet!
4 / 20
void GetNthFromLast(struct node* head, int n)
{
int len = n, i;
struct node *temp = *temp1 = head;
while (temp != NULL)
{
if (len > 0)
{
temp = temp->next;
len--;
continue;
}
temp = temp->next;
temp1 = temp1->next;
}
if (len)
{
printf("\r\n Node in the given Linked list is not enough \r\n");
return;
}
printf ("%d\n", temp1->data);
return;
}
No Tags on this question yet!
5 / 20
int *p;
p = (int *) malloc(2 * sizeof (int));
When memory allocation is done, the actual heap space allocated is one word larger than the requested memory. The extra word is used to store the size of the allocation and is later used by free( )
No Tags on this question yet!
6 / 20
int x = 100;
printf("%d",!x);
0
No Tags on this question yet!
7 / 20
struct x
{
int p;
struct x *y;
char z;
char *b;
};
16
No Tags on this question yet!
8 / 20
char *p = "ciena"
char ar[] = "ciena"
Char Pointer p is pointing to char string which is stored in code segment so that it can not change due to read only memory location but in second statement char array is stored in stack segment which can be modified during run time.
No Tags on this question yet!
9 / 20
Sizeof (NULL)
Strlen(NULL);
sizeof(" ")
4, 0, 1
No Tags on this question yet!
10 / 20
Host A> ping Host B

No Discussion on this question yet!
No Tags on this question yet!
11 / 20
No Discussion on this question yet!
No Tags on this question yet!
12 / 20
No Discussion on this question yet!
No Tags on this question yet!
13 / 20
No Discussion on this question yet!
No Tags on this question yet!
14 / 20
1. static int x;
main()
{
printf x
}
2.
fun()
{
static int x;
}
No Discussion on this question yet!
No Tags on this question yet!
15 / 20
No Tags on this question yet!
16 / 20
No Discussion on this question yet!
No Tags on this question yet!
17 / 20
No Discussion on this question yet!
No Tags on this question yet!
18 / 20
No Discussion on this question yet!
No Tags on this question yet!
19 / 20
P++;
is there any abnormality in the above line.
no
No Tags on this question yet!
20 / 20
A) B)
thread process
| |
thread thread
| |
Thread thread
No Discussion on this question yet!
No Tags on this question yet!
1 / 15
No Discussion on this question yet!
No Tags on this question yet!
2 / 15
No Discussion on this question yet!
No Tags on this question yet!
3 / 15
No Discussion on this question yet!
No Tags on this question yet!
4 / 15
No Discussion on this question yet!
No Tags on this question yet!
5 / 15
No Discussion on this question yet!
No Tags on this question yet!
6 / 15
No Discussion on this question yet!
No Tags on this question yet!
7 / 15
No Discussion on this question yet!
No Tags on this question yet!
8 / 15
No Discussion on this question yet!
No Tags on this question yet!
9 / 15
No Discussion on this question yet!
No Tags on this question yet!
10 / 15
Dest mac,
inport,
ethernet Type,
source port,
No Discussion on this question yet!
No Tags on this question yet!
11 / 15
No Discussion on this question yet!
No Tags on this question yet!
12 / 15
No Discussion on this question yet!
No Tags on this question yet!
13 / 15
No Discussion on this question yet!
No Tags on this question yet!
14 / 15
No Discussion on this question yet!
No Tags on this question yet!
15 / 15
No Discussion on this question yet!
No Tags on this question yet!
1 / 12
No Discussion on this question yet!
No Tags on this question yet!
2 / 12
No Discussion on this question yet!
No Tags on this question yet!
3 / 12
No Discussion on this question yet!
No Tags on this question yet!
4 / 12
No Discussion on this question yet!
No Tags on this question yet!
5 / 12
No Discussion on this question yet!
No Tags on this question yet!
6 / 12
No Discussion on this question yet!
No Tags on this question yet!
7 / 12
No Discussion on this question yet!
No Tags on this question yet!
8 / 12
char *p = "ciena"
char ar[] = "ciena"
No Discussion on this question yet!
No Tags on this question yet!
9 / 12
No Discussion on this question yet!
No Tags on this question yet!
10 / 12
struct cc
{
int x;
char y;
struct cc *c;
}
No Discussion on this question yet!
No Tags on this question yet!
11 / 12
No Discussion on this question yet!
No Tags on this question yet!
12 / 12
No Discussion on this question yet!
No Tags on this question yet!
1 / 10
No Discussion on this question yet!
No Tags on this question yet!
2 / 10
No Discussion on this question yet!
No Tags on this question yet!
3 / 10
No Discussion on this question yet!
No Tags on this question yet!
4 / 10
No Discussion on this question yet!
No Tags on this question yet!
5 / 10
Array of pointer
Int tmp[]={1,2,3};
Int *ar[3];
for(i=0;I<3;I++)
at[I]=&tmp[I];
Pointer to an array
Int *Parr;
Parr = &tmp;
No Tags on this question yet!
6 / 10
int * Profunction( int *arrpoint[]);
No Tags on this question yet!
7 / 10
No Discussion on this question yet!
No Tags on this question yet!
8 / 10
No Discussion on this question yet!
No Tags on this question yet!
9 / 10
No Discussion on this question yet!
No Tags on this question yet!
10 / 10
No Discussion on this question yet!
No Tags on this question yet!
1 / 4
No Discussion on this question yet!
No Tags on this question yet!
2 / 4
No Discussion on this question yet!
No Tags on this question yet!
3 / 4
No Discussion on this question yet!
No Tags on this question yet!
4 / 4
And there was many more question in this round, it may vary from person to person.
No Discussion on this question yet!
No Tags on this question yet!