HCL Interview Questions
- 1of 1 vote
Answers#define mysizeof(x) (char*)(&x+1)-(char*)(&x)
- jkl March 20, 2016 in India
//why casting is done to char* for mysizeof
// casting it to void also works| Report Duplicate | Flag | PURGE
HCL Software Developer C - 0of 0 votes
Answerswhat are the sequence of creation of files with extension;.h,.cpp,.asm,.obj,.a? what are each phase called and explain them
- mohapatrasandeep60 March 13, 2016 in India| Report Duplicate | Flag | PURGE
HCL - 0of 0 votes
Answerwhat is the use of dynamic_cast in c++
- mohapatrasandeep60 March 13, 2016 in India| Report Duplicate | Flag | PURGE
HCL - 0of 0 votes
Answerswhat are the resources created newly when a new process is created in linux
- mohapatrasandeep60 March 13, 2016 in India| Report Duplicate | Flag | PURGE
HCL unix system programmin - 0of 0 votes
AnswersIn your large programme, thereis memory leak, how will ypu find out where(Linux)
- mohapatrasandeep60 February 15, 2016 in India| Report Duplicate | Flag | PURGE
HCL Developer Program Engineer - 0of 0 votes
Answergiven 2 processes. Each having 4 threads. ! thread is having performance issue. How will you find out that thread (Linux)
- mohapatrasandeep60 February 15, 2016 in India| Report Duplicate | Flag | PURGE
HCL Developer Program Engineer - 0of 0 votes
Answersgiven 2 processes , how to use a semaphore which is locked on 1 process and released in other(Linux)
- mohapatrasandeep60 February 15, 2016 in India| Report Duplicate | Flag | PURGE
HCL Developer Program Engineer - 0of 0 votes
AnswersThere are IPCs in Linux- Pipe, Fifo, Shared Memory, Message Queue, Socket. Which cases which IPC to choose(Linux)
- mohapatrasandeep60 February 15, 2016 in India| Report Duplicate | Flag | PURGE
HCL Developer Program Engineer - 0of 0 votes
AnswerWe have board represented using matrix (i.e Board[N][N],
- anshkun January 22, 2016 in India for 1
We have right angle triangle with same height, base and area of four types.
Types can be distinguish using points
i.e {1,0,1,1}, {1,1,0,1} etc which makes a right angle triangle in one block. We have to identify total count each triangle type. There are multiple cases
1. Include every possible triangle shape one can overlap with other triangle cell
2. Include every possible triangle shape without overlap with other triangle cell
3. Include adjacent triangles only (exclude triangle which is adjacent to two triangles )
4.Include adjacent triangles only
i.e : Input pattern
110011
100101
110110
000001
We see one triangle is getting formed a[0][0],a[0][1] and a[1],[0]
Triangles are adjacent if vertical and horizontal values are one.| Report Duplicate | Flag | PURGE
HCL Intern Algorithm - 0of 0 votes
AnswersWhy to use singleton class? What is the advantage you get by restricting single object of a class.
- mohapatrasandeep60 January 10, 2016 in India
eg.If you are using a logger class, if there are many objects of the class and you want to print that sequentially, you can achieve this with mutex. Why use singleton?
write code for thread safe singleton.| Report Duplicate | Flag | PURGE
HCL Developer Program Engineer - 0of 0 votes
Answerswrite commands for -
- mohapatrasandeep60 January 10, 2016 in India
1>list processes
2>remove 2lines from file
3>there are multiple hirarachical direcories. Change the file extension all .c files to .cpp
4>chang time stamp of a file
5> run a script at a particular time| Report Duplicate | Flag | PURGE
HCL Developer Program Engineer - 0of 0 votes
AnswersYou have a memory location. It is actually a character array abc... upto z .
- ahmad.husain.khan November 17, 2015 in India
I have a integer pointer p pointing to a ie the first character of the array.
How do I print the character array using the integer pointer ?| Report Duplicate | Flag | PURGE
HCL Software Engineer C - 0of 0 votes
Answershow to sent buffer limit in BufferedReader/ BufferedWriter class
- mdfirozansari December 03, 2014 in India| Report Duplicate | Flag | PURGE
HCL Product Security Engineer Java - 0of 0 votes
AnswersHow to implement thread safety in java without using synchronized method?
- mdfirozansari December 03, 2014 in India| Report Duplicate | Flag | PURGE
HCL Product Security Engineer Java - -1of 1 vote
Answersc program to print input 11000011 and output will be 0000
- anusha03dec November 19, 2013 in India for 8
Ex: 00011000
output =11| Report Duplicate | Flag | PURGE
HCL Developer Program Engineer - 0of 0 votes
AnswersC program to print from 1 paragraph it should print from 1st word 1st letter,2nd word 2nd letter, 3rd word 3rd letter if the word is less than 3 letter it should print new line, and again 4th word 4th letter.....
- anusha03dec November 19, 2013 in India for 8
example:
Once when a Lion was asleep, a little Mouse began running up and down upon him.
output will be:
O h
o
e
l e| Report Duplicate | Flag | PURGE
HCL Developer Program Engineer - 1of 3 votes
AnswersReverse a string without using any temporary variable.
- rasmiranjanbabu August 31, 2013 in India
Suppose {{char str[] = "Hello"; then str[] = "olleH";}}}.
I told him we can "shift H to o then o to H", similarly so on. But could able to write the code.| Report Duplicate | Flag | PURGE
HCL Software Engineer / Developer C - 0of 2 votes
AnswersSuppose a linked list (having n number of node) is given to you. You don't have the starting address. I have given you suppose address of "3rd" node.
ptr = Address of 3rd node;
Now using only ptr delete 5th node. And at the end of the program my "ptr should have the address of 3rd node". Don't use any temporary ptr and variable etc.
- rasmiranjanbabu August 31, 2013 in India| Report Duplicate | Flag | PURGE
HCL Software Engineer / Developer C# - 0of 0 votes
AnswersWhy are 2 boot loaders used in Android?
- sharma7067 August 19, 2013 in India
What is the use of each one and is it possible to remove any one of them and boot android?
Note: Two bootloaders are Xloader and Uboot.| Report Duplicate | Flag | PURGE
HCL Software Engineer / Developer Android - 0of 2 votes
Answers#include<stdio.h> void main() { void *p; int x=10; float y=20.2; p=&x; printf("int %d\n",*p); *p=20; p=&y; printf("float %d\n",*p); }
What is the output?
- sharma7067 August 19, 2013 in India
If error, which error and correct the code.| Report Duplicate | Flag | PURGE
HCL Software Engineer / Developer C - 0of 2 votes
AnswersWhat happens when "new" fails to allocate memory.
- rasmiranjanbabu August 11, 2013 in India
I answered as, it will return NULL. But he was not sastisfied.| Report Duplicate | Flag | PURGE
HCL Software Engineer / Developer - -1of 1 vote
AnswersHow do you dynamically allocate memory for an integer array of 10 bytes?
- rasmiranjanbabu August 11, 2013 in India| Report Duplicate | Flag | PURGE
HCL Software Engineer / Developer C++ - 1of 1 vote
Answerstoggle the given length of bit in 32 bit integer.
- gaurav.2897 July 31, 2013 in India
lets say ,i want to toggle 11-15 bit in 32 bit integer.| Report Duplicate | Flag | PURGE
HCL Software Engineer / Developer - 0of 0 votes
AnswersGive three Hash tables has some values.you need compare three hash tables and store the common values in fourth hash table?
- amit.grynch May 19, 2013 in India| Report Duplicate | Flag | PURGE
HCL Java Developer - 0of 0 votes
AnswersReverse a string using C pointers
- pirate May 11, 2013 in India
Ex: "Welcome to India" to "India to Welcome"| Report Duplicate | Flag | PURGE
HCL Software Engineer / Developer C# - 0of 0 votes
AnswersReverse a binary number using bitwise operations in C
- pirate May 11, 2013 in India
ex: 101101001 to 100101101| Report Duplicate | Flag | PURGE
HCL Software Engineer / Developer C#