Posts

FREQUENTLY ASKED QUESTIONS:OBJECT ORIENTED CONCEPTS

How do you write a program which produces its own source code as its output? * How can I find the day of the week given the date? * Why doesn't C have nested functions? * What is the most efficient way to count the number of bits which are set in a value? * How can I convert integers to binary or hexadecimal? * How can I call a function, given its name as a string? * How do I access command-line arguments? * How can I return multiple values from a function? * How can I invoke another program from within a C program? * How can I access memory located at a certain address? * How can I allocate arrays or structures bigger than 64K? * How can I find out how much memory is available? * How can I read a directory in a C program? * How can I increase the allowable number of simultaneously open files? * What's wrong with the call "fopen("c:\newdir\file.dat", "r")"? * What is the output of printf("%d") * What will happen if I say del...

Ten rules of interview

Keep your answers brief and concise. Unless asked to give more detail, limit your answers to two to three minutes per question. Tape yourself and see how long it takes you to fully answer a question. Include concrete, quantifiable data. Interviewees tend to talk in generalities. Unfortunately, generalities often fail to convince interviewers that the applicant has assets. Include measurable information and provide details about specific accomplishments when discussing your strengths. Repeat your key strengths three times. It's essential that you comfortably and confidently articulate your strengths. Explain how the strengths relate to the company's or department's goals and how they might benefit the potential employer. If you repeat your strengths then they will be remembered and—if supported with quantifiable accomplishments—they will more likely be believed. Prepare five or more success stories. In preparing for interviews, make a list of your skills and key...

C++ INTERVIEW QUESTIONS

What is the difference between an ARRAY and a LIST? What is faster : access the element in an ARRAY or in a LIST? Define a constructor - what it is and how it might be called (2 methods). Describe PRIVATE, PROTECTED and PUBLIC – the differences and give examples. What is a COPY CONSTRUCTOR and when is it called (this is a frequent question !)? Explain term POLIMORPHISM and give an example using eg. SHAPE object: If I have a base class SHAPE, how would I define DRAW methods for two objects CIRCLE and SQUARE. What is the word you will use when defining a function in base class to allow this function to be a polimorphic function? What are 2 ways of exporting a function from a DLL? You have two pairs: new() and delete() and another pair : alloc() and free(). Explain differences between eg. new() and malloc() What is a callback function. Explain in C and C++ and WIN API environment. (From WINDOWS API area): what is LPARAM and WPARAM?

C INTERVIEW QUESTIONS

What does static variable mean? What is a pointer? What is a structure? What are the differences between structures and arrays? In header files whether functions are declared or defined? What are the differences between malloc() and calloc()? What are macros? What are the advantages and disadvantages? Difference between pass by reference and pass by value? What is static identifier? Where are the auto variables stored? Where does global, static, local, register variables, free memory and C Program instructions get stored? Difference between arrays and linked list? What are enumerations? Describe about storage allocation and scope of global, extern, static, local and register variables? What are register variables? What are the advantage of using register variables? What is the use of typedef? Can we specify variable field width in a scanf() format string? If possible how? Out of fgets() and gets() which function is safe to use and why? Difference between s...

C++ QUESTIONS FOR JOB APPLICANTS

How do you decide which integer type to use? What should the 64-bit integer type on new, 64-bit machines be? What's the best way to declare and define global variables? What does extern mean in a function declaration? What's the auto keyword good for? I can't seem to define a linked list node which contains a pointer to itself. How do I declare an array of N pointers to functions returning pointers to functions returning pointers to characters? How can I declare a function that returns a pointer to a function of its own type? My compiler is complaining about an invalid redeclaration of a function, but I only define it once and call it once. What's happening? What can I safely assume about the initial values of variables which are not explicitly initialized? Why can't I initialize a local array with a string? What is the difference between char a[] = "string"; and char *p = "string"; ? How do I initialize a pointer to a functi...

C Interview Questions

What will print out? main () { char *p1= "name" ; char *p2; p2=(char*)malloc(20); memset (p2, 0, 20); while(*p2++ = *p1++); printf ( "%s\n" ,p2); } Answer :empty string. What will be printed as the result of the operation below: main () { int x=20,y=35; x=y++ + x++; y= ++y + ++x; printf ( "%d%d\n" ,x,y); } Answer : 5794 What will be printed as the result of the operation below: main () { int x=5; printf( "%d,%d,%d\n" ,x,x >2); } Answer: 5,20,1 What will be printed as the result of the operation below: #define swap(a,b) a=a+b;b=a-b;a=a-b; void main () { int x=5, y=10; swap (x,y); printf( "%d %d\n" ,x,y); swap2(x,y); printf( "%d %d\n" ,x,y); } int swap2(int a, int b) { int temp; temp=a; b=a; a=temp; return 0; } Answer : 10, 5 10, 5 What will be printed as the result of the operation below: main () { char *ptr = " Cisco Systems" ; *ptr++; printf( "%s\n" ,ptr); ptr++; printf( ...

Large Hadron Collider (LHC)

Image
Big bang theory assumptions The Big Bang theory depends on two major assumptions: the universality of physical laws, and the Cosmological Principle. The cosmological principle states that on large scales the universe is homogeneous and isotropic. These ideas were initially taken as postulates, but today there are efforts to test each of them. For example, the first assumption has been tested by observations showing that largest possible deviation of the fine structure constant over much of the age of the universe is of order. Also, General Relativity has passed stringent tests on the scale of the solar system and binary stars while extrapolation to cosmological scales has been validated by the empirical successes of various aspects of the Big Bang theory. If the large-scale universe appears isotropic as viewed from Earth, the cosmological principle can be derived from the simpler Copernican Principle , which states that there is no pr...