Hewlett Packard Enterprise Interview Questions and Answers for 3 years Experience
1 / 5
I am from so and so places. I have finished my schoolings in so and so place.
No Tags on this question yet!
2 / 5
No Discussion on this question yet!
No Tags on this question yet!
3 / 5
No Discussion on this question yet!
No Tags on this question yet!
4 / 5
No Discussion on this question yet!
No Tags on this question yet!
5 / 5
No Discussion on this question yet!
No Tags on this question yet!
1 / 6
No Discussion on this question yet!
No Tags on this question yet!
2 / 6
Basically a valid sub-net mask, when written in binary, has to consist
of only consecutive 1's and then 0's, but no intermittent mixing. I.e.:
255.255.255.128 -> 11111111.11111111.11111111.10000000 is valid
255.255.255.0 -> 11111111.11111111.11111111.00000000 is valid
255.255.255.0 -> 11111111.11111111.11111111.00000000 is valid
255.255.255.144 -> 11111111.11111111.11111111.10010000 is not valid <<<<<<<<
#include <stdio.h>
int main()
{
char ip[4] = {255,255,255,128};
int count = 0, valid = 0,i,check,j;
for (j=3;j>=0;j--) {
count = 0;
if (valid)
check++;
for (i = 0;i < 8;i++)
{
if ((ip[j] & 1<<i) && count !=1)
{
count = 1;
}
if ((count ==1) && !(ip[j] & 1<<i))
valid = 1;
}
}
if (valid)
printf("Invalid subnet");
else
printf("Valid subnet");
}
No Tags on this question yet!
3 / 6
bool loopInLinkedList(Node *list)
{
Node *slow_p, *fast_p;slow_p = list;
fast_p = list;
while (slow_p && fast_p && fast_p->next)
{
slow_p = slow_p->next;
fast_p = fast_p->next->next;
if (slow_p == fast_p)
return TRUE;
}
return FALSE;
}
No Tags on this question yet!
4 / 6
No Discussion on this question yet!
No Tags on this question yet!
5 / 6
No Discussion on this question yet!
No Tags on this question yet!
6 / 6
No Discussion on this question yet!
No Tags on this question yet!
1 / 5
typedef enum {FALSE=0,TRUE} bool;
bool subStringInString(char const * oString, char const *sString)
{
int oLen = 0, sLen = 0;
int i=0,j=0;
oLen = strlen(oString);
sLen = strlen(sString);
for (i = 0;i <=(oLen-sLen); i++)
{
for (j = 0; j < sLen;j++)
{
if (sString[j] != oString[i+j])
break;
}
if (j == sLen)
return TRUE;
}
return FALSE;
}
No Tags on this question yet!
2 / 5
No Discussion on this question yet!
No Tags on this question yet!
3 / 5
No Discussion on this question yet!
No Tags on this question yet!
4 / 5
No Discussion on this question yet!
No Tags on this question yet!
5 / 5

No Discussion on this question yet!
No Tags on this question yet!
1 / 5
No Discussion on this question yet!
No Tags on this question yet!
2 / 5
No Discussion on this question yet!
No Tags on this question yet!
3 / 5
// C program to demonstrate working of Semaphores
#include
#include
#include
#include
sem_t mutex;
void* thread(void* arg)
{
//wait
sem_wait(&mutex);
printf("\nEntered..\n");
//critical section
sleep(4);
//signal
printf("\nJust Exiting...\n");
sem_post(&mutex);
}
int main()
{
sem_init(&mutex, 0, 1);
pthread_t t1,t2;
pthread_create(&t1,NULL,thread,NULL);
sleep(2);
pthread_create(&t2,NULL,thread,NULL);
pthread_join(t1,NULL);
pthread_join(t2,NULL);
sem_destroy(&mutex);
return 0;
}
No Tags on this question yet!
4 / 5
void array-init(int *arr)
{
arr = malloc (4*sizeof (int));
arr[1] = 10;
arr[0] = 20;
}
int main()
{
int *p = NULL;
array-init(p);
printf("%d", p[0]);
printf("%d", p[1]);
return 1;
}
No Discussion on this question yet!
No Tags on this question yet!
5 / 5
No Discussion on this question yet!
No Tags on this question yet!
1 / 3
No Discussion on this question yet!
No Tags on this question yet!
2 / 3
No Discussion on this question yet!
No Tags on this question yet!
3 / 3
No Discussion on this question yet!
No Tags on this question yet!