By admin | December 8, 2007
What is the most efficient way to reverse a linklist?
How to sort & search a single linklist?
Which is more convenient - single or double-linked linklist? Discuss the trade-offs? What about XOR-linked linklist?
How does indexing work?
char s[10];
s=”Hello”;
printf(s);
What will be the output? Is there any error with this code?
What is the difference between
char s[]=”Hello”;
char *s=”Hello”;
Please give a [...]
By admin | December 31, 2006
Frequently a question of the programs printing out their own output appears in code interviews. The question does not really test a skill of a programmer, as much as general awareness of tricks to do that. The quine page by Gary Thompson provides many examples of such applications in various languages. In case you were [...]
age = 63;
With that in mind, look at the following program:
———— program 5.2 ————–
#include
#include
struct tag{ /* the structure type */
char lname[20]; [...]
Will the following program execute?void main()
{
void *vptr = (void *) malloc(sizeof(void));
vptr++;
}
How about this one?
void main()
{
char *cptr = 0?2000;
long *lptr = 0?2000;
cptr++;
lptr++;
printf(†%x %xâ€Â, cptr, lptr);
}Will it execute or not?
When the processor wakes up after power on, it goes to a particular memory location. What is that memory location called?
What is the difference between Mutex and [...]
By admin | February 6, 2006
This is not really a set of interview questions, a reader sent TechInterviews.com what looks like a copy of his notes from C++ class that describes various tricks and code for C++.
What is the output of printf(“%dâ€Â)?
%d helps to read integer data type of a given variable
when we write (“%dâ€Â, X) compiler will print [...]
By admin | December 12, 2005
What does a special set of tags <?= and ?> do in PHP? - The output is displayed directly to the browser.
What’s the difference between include and require? - It’s how they handle failures. If the file is not found by require(), it will cause a fatal error and halt the execution of the script. [...]
By admin | September 22, 2005
What is the output of printf(”%d”)
What will happen if I say delete this
Difference between “C structure” and “C++ structure”.
Diffrence between a “assignment operator” and a “copy constructor”
What is the difference between “overloading” and “overridding”?
Explain the need for “Virtual Destructor”.
A reader submitted the interview questions he was asked. More C/C++ questions will be added here, as people keep sending us a set of 2-3 questions they got on their job itnerview.
Q1: Tell how to check whether a linked list is circular.
A: Create two pointers, each set to the start of the list. Update each [...]
A frequent reader of this site sent this in. No answers, but a nice set of questions. Consider getting Kernighan and Ritchie title if you find many things puzzling here.
What does static variable mean?
What is a pointer?
What is a structure?
By admin | December 23, 2003
What will print out?
main() { char *p1=“name”; char *p2; p2=(char*)malloc(20); memset (p2, 0, 20); while(*p2++ = *p1++); printf(“%sn”,p2);
}
Answer:empty string.
By admin | December 7, 2003
Can structures be passed to the functions by value?
Why cannot arrays be passed by values to functions?
Advantages and disadvantages of using macro and inline functions?
Posted in C++, Hardware |
By admin | December 7, 2003
Classic: If a bear walks one mile south, turns left and walks one mile to the east and then turns left again and walks one mile north and arrives at its original position, what is the color of the bear.
ANS. The color of the bear is trivial. The possible solutions to it are [...]