Your Ad Here

Friday, October 31, 2008

C++ Interview Questions Answers - Vol 2

What do you mean by inline function?
The idea behind inline functions is to insert the code of a called function at the point where the function is called. If done carefully, this can improve the application's performance in exchange for increased compile time and possibly (but not always) an increase in the size of the generated binary executables.


Write a program that ask for user input from 5 to 9 then calculate the average
#include "iostream.h"
int main() {
int MAX = 4;
int total = 0;
int average;
int numb;
for (int i=0; i> numb;
while ( numb<5>9) {
cout << "Invalid input, please re-enter: "; cin >> numb;
}
total = total + numb;
}
average = total/MAX;
cout << "The average number is: " <<>Write a short code using C++ to print out all odd number from 1 to 100 using a for loop
for( unsigned int i = 1; i < = 100; i++ ) if( i & 0x00000001 ) cout <<>What is public, protected, private?
Public, protected and private are three access specifier in C++. Public data members and member functions are accessible outside the class. Protected data members and member functions are only available to derived classes. Private data members and member functions can’t be accessed outside the class. However there is an exception can be using friend classes. Write a function that swaps the values of two integers, using int* as the argument type.
void swap(int* a, int*b)
{
int t;
t = *a;
*a = *b;
*b = t;
}


Tell how to check whether a linked list is circular.
Create two pointers, each set to the start of the list. Update each as follows: while (pointer1) { pointer1 = pointer1->next;
pointer2 = pointer2->next; if (pointer2) pointer2=pointer2->next;
if (pointer1 == pointer2) {
print (\"circular\n\");
}
}


OK, why does this work?
If a list is circular, at some point pointer2 will wrap around and be either at the item just before pointer1, or the item before that. Either way, it’s either 1 or 2 jumps until they meet.


What is virtual constructors/destructors?
Answer1
Virtual destructors:
If an object (with a non-virtual destructor) is destroyed explicitly by applying the delete operator to a base-class pointer to the object, the base-class destructor function (matching the pointer type) is called on the object.
There is a simple solution to this problem declare a virtual base-class destructor.
This makes all derived-class destructors virtual even though they don’t have the same name as the base-class destructor. Now, if the object in the hierarchy is destroyed explicitly by applying the delete operator to a base-class pointer to a derived-class object, the destructor for the appropriate class is called. Virtual constructor: Constructors cannot be virtual. Declaring a constructor as a virtual function is a syntax error.

Answer2
Virtual destructors: If an object (with a non-virtual destructor) is destroyed explicitly by applying the delete operator to a base-class pointer to the object, the base-class destructor function (matching the pointer type) is called on the object.
There is a simple solution to this problem – declare a virtual base-class destructor. This makes all derived-class destructors virtual even though they don’t have the same name as the base-class destructor. Now, if the object in the hierarchy is destroyed explicitly by applying the delete operator to a base-class pointer to a derived-class object, the destructor for the appropriate class is called.


Virtual constructor: Constructors cannot be virtual. Declaring a constructor as a virtual function is a syntax error. Does c++ support multilevel and multiple inheritance?
Yes.


What are the advantages of inheritance?
• It permits code reusability.
• Reusability saves time in program development.
• It encourages the reuse of proven and debugged high-quality software, thus reducing problem after a system becomes functional.


What is the difference between declaration and definition?
The declaration tells the compiler that at some later point we plan to present the definition of this declaration.
E.g.: void stars () //function declaration
The definition contains the actual implementation.
E.g.: void stars () // declarator
{
for(int j=10; j>=0; j--) //function body
cout<<”*”; cout<

Wednesday, October 29, 2008

C Interview Questions Answers - Vol 2

printf() Function
What is the output of printf("%d")?


1. When we write printf("%d",x); this means compiler will print the value of x. But as here, there is nothing after %d so compiler will show in output window garbage value.

2. When we use %d the compiler internally uses it to access the argument in the stack (argument stack). Ideally compiler determines the offset of the data variable depending on the format specification string. Now when we write printf("%d",a) then compiler first accesses the top most element in the argument stack of the printf which is %d and depending on the format string it calculated to offset to the actual data variable in the memory which is to be printed. Now when only %d will be present in the printf then compiler will calculate the correct offset (which will be the offset to access the integer variable) but as the actual data object is to be printed is not present at that memory location so it will print what ever will be the contents of that memory location.

3. Some compilers check the format string and will generate an error without the proper number and type of arguments for things like printf(...) and scanf(...).
malloc()


What is the difference between "calloc(...)" and "malloc(...)"?
1. calloc(...) allocates a block of memory for an array of elements of a certain size. By default the block is initialized to 0. The total number of memory allocated will be (number_of_elements * size).

malloc(...) takes in only a single argument which is the memory required in bytes. malloc(...) allocated bytes of memory and not blocks of memory like calloc(...).

2. malloc(...) allocates memory blocks and returns a void pointer to the allocated space, or NULL if there is insufficient memory available.

calloc(...) allocates an array in memory with elements initialized to 0 and returns a pointer to the allocated space. calloc(...) calls malloc(...) in order to use the C++ _set_new_mode function to set the new handler mode.


printf() Function- What is the difference between "printf(...)" and "sprintf(...)"?

sprintf(...) writes data to the character array whereas printf(...) writes data to the standard output device.


Compilation How to reduce a final size of executable?

Size of the final executable can be reduced using dynamic linking for libraries.


Linked Lists -- Can you tell me how to check whether a linked list is circular?

Create two pointers, and set both to the start of the list. Update each as follows:
while (pointer1) {
pointer1 = pointer1->next;
pointer2 = pointer2->next;
if (pointer2) pointer2=pointer2->next;
if (pointer1 == pointer2) {
print ("circular");
}
}

If a list is circular, at some point pointer2 will wrap around and be either at the item just before pointer1, or the item before that. Either way, its either 1 or 2 jumps until they meet.


"union" Data Type What is the output of the following program? Why?

#include
main() {
typedef union {
int a;
char b[10];
float c;
}
Union;

Union x,y = {100};
x.a = 50;
strcpy(x.b,"hello");
x.c = 21.50;
printf("Union x : %d %s %f n",x.a,x.b,x.c);
printf("Union y : %d %s %f n",y.a,y.b,y.c);
}


String Processing --- Write out a function that prints out all the permutations of a string. For example, abc would give you abc, acb, bac, bca, cab, cba.

void PrintPermu (char *sBegin, char* sRest) {
int iLoop;
char cTmp;
char cFLetter[1];
char *sNewBegin;
char *sCur;
int iLen;
static int iCount;

iLen = strlen(sRest);
if (iLen == 2) {
iCount++;
printf("%d: %s%s\n",iCount,sBegin,sRest);
iCount++;
printf("%d: %s%c%c\n",iCount,sBegin,sRest[1],sRest[0]);
return;
} else if (iLen == 1) {
iCount++;
printf("%d: %s%s\n", iCount, sBegin, sRest);
return;
} else {
// swap the first character of sRest with each of
// the remaining chars recursively call debug print
sCur = (char*)malloc(iLen);
sNewBegin = (char*)malloc(iLen);
for (iLoop = 0; iLoop < iLen; iLoop ++) {
strcpy(sCur, sRest);
strcpy(sNewBegin, sBegin);
cTmp = sCur[iLoop];
sCur[iLoop] = sCur[0];
sCur[0] = cTmp;
sprintf(cFLetter, "%c", sCur[0]);
strcat(sNewBegin, cFLetter);
debugprint(sNewBegin, sCur+1);
}
}
}

void main() {
char s[255];
char sIn[255];
printf("\nEnter a string:");
scanf("%s%*c",sIn);
memset(s,0,255);
PrintPermu(s, sIn);
}

Sunday, October 26, 2008

Resume Guide Vol - 1

How to write a Resume

What are the things you should remember while writing a resume?

Resume is the professional reflection of individuals who are applying or looking for an employment. Because of this, resume must be well written to increase the chance of being invited for an interview. Effort is necessary to create a resume that will make you stand out among other probable candidates.

You need to plan before you start creating a resume. Gather and arrange the documents, certificates and all the list of information that you might need on the process of writing your resume. Scan and list all the significant events and data for quick reference.

Recall your career plan as this will be your basis for determining the resume format that will suit you most. Reverse Chronological format is the good resume format for traditional and conservative industries like academe and law and especially suited for those applicants aiming to stay in the same profession or position. The Functional format on the other hand is appropriate for new graduates and individuals who want to make a come back in their profession. And for those applicants who want to shift careers or those who have diverse employment backgrounds, the Combination format is the most recommended resume format. Nonetheless, regardless of the format, all resume contain the same information that should be presented and stated very well to yield positive result.

With an assortment of available job opportunities, choose only those jobs and positions that would fit on your qualifications and personality. Then, you need to understand what the company is looking for and what you have to offer before you go on with your resume. Identify your significant qualifications that would make you the best candidate for the particular position you wish to apply.

Now that you know your career path, the jobs that you want to apply and the resume format that suits you best, begin your resume with the Objective Section. Your objective should be based on your career plan and should likewise concede with what the company needs. In short, establish your objective in such a way that you can convey to the employer that you are just the right candidate they're looking for. Mention the exact position you are applying on the Objective Section to demonstrate clarity.

There are some instances when a separate Summary Section is recommended, particularly when the applicant have several significant accomplishments that are relevant to the position being applied. This summary should consist of brief paragraph of your important qualities to answer the question why the company should choose you over other applicants. In this case, put the Summary Section immediately after the Objective.

After the Objective and/or Summary, the resume is then followed by Experience Section. Here, you should begin with your job titles, followed by the company name or vice versa, depending which is more remarkable and must stick to it for consistency. Include all your work-related experience under this section including the internships and voluntary works and services. List them in reverse chronological order and write the dates after each work excluding the months unless the job is held for less than a year.

Education is written after the Work Experience. Write them just like what you did in Work Experience Section. Licenses and degrees must be put ahead of your trainings and certifications. State your major course and awards but don't include other small commendations unless you just graduate recently. For those applicants that do not earned their degree yet put the expected date of completion under the degree.

Affiliations and Organizations are listed after the Education Section. Site only those that are recent and relevant. You may also put some of your personal background or interest after the Affiliation Section. Personal Interest, when properly listed can demonstrate your versatility. But write only those that are somehow relevant on the company or the positioned being applied.

The final section of the resume can be end by the Reference Section. However, name and addresses of your reference must no be listed here. Prepare them in another sheet and present only when being asked. “Reference available upon request” is the proper statement under the Reference Section.

Saturday, October 25, 2008

SQL Interview Questions Answers - Vol 2

SQL*Plus

SQL*Plus is an application that recognizes & executes SQL commands & specialized SQL*Plus commands that can customize reports, provide help & edit facility & maintain system variables.

NVL

NVL : Null value function converts a null value to a non-null value for the purpose of evaluating an expression. Numeric Functions accept numeric I/P & return numeric values. They are MOD, SQRT, ROUND, TRUNC & POWER.

Date Functions

Date Functions are ADD_MONTHS, LAST_DAY, NEXT_DAY, MONTHS_BETWEEN & SYSDATE.

Character Functions

Character Functions are INITCAP, UPPER, LOWER, SUBSTR & LENGTH. Additional functions are GREATEST & LEAST. Group Functions returns results based upon groups of rows rather than one result per row, use group functions. They are AVG, COUNT, MAX, MIN & SUM.

TTITLE & BTITLE

TTITLE & BTITLE are commands to control report headings & footers.

COLUMN

COLUMN command define column headings & format data values.

BREAK

BREAK command clarify reports by suppressing repeated values, skipping lines & allowing for controlled break points.

COMPUTE

command control computations on subsets created by the BREAK command.

SET

SET command changes the system variables affecting the report environment.

SPOOL

SPOOL command creates a print file of the report.

JOIN

JOIN is the form of SELECT command that combines info from two or more tables.Types of Joins are Simple (Equijoin & Non-Equijoin), Outer & Self join.
Equijoin returns rows from two or more tables joined together based upon a equality condition in the WHERE clause.
Non-Equijoin returns rows from two or more tables based upon a relationship other than the equality condition in the WHERE clause.
Outer Join combines two or more tables returning those rows from one table that have no direct match in the other table.
Self Join joins a table to itself as though it were two separate tables.

Union

Union is the product of two or more tables.

Intersect

Intersect is the product of two tables listing only the matching rows.

Minus

Minus is the product of two tables listing only the non-matching rows.

Correlated Subquery

Correlated Subquery is a subquery that is evaluated once for each row processed by the parent statement. Parent statement can be Select, Update or Delete. Use CRSQ to answer multipart questions whose answer depends on the value in each row processed by parent statement.

Multiple columns

Multiple columns can be returned from a Nested Subquery.

Sequences

Sequences are used for generating sequence numbers without any overhead of locking. Drawback is that after generating a sequence number if the transaction is rolled back, then that sequence number is lost.

Synonyms

Synonyms is the alias name for table, views, sequences & procedures and are created for reasons of Security and Convenience.Two levels are Public - created by DBA & accessible to all the users. Private - Accessible to creator only. Advantages are referencing without specifying the owner and Flexibility to customize a more meaningful naming convention.

Indexes

Indexes are optional structures associated with tables used to speed query execution and/or guarantee uniqueness. Create an index if there are frequent retrieval of fewer than 10-15% of the rows in a large table and columns are referenced frequently in the WHERE clause. Implied tradeoff is query speed vs. update speed. Oracle automatically update indexes. Concatenated index max. is 16 columns.

Thursday, October 23, 2008

Importance of One (ONE)




One song can spark a moment,
One flower can wake the dream.
One tree can start a forest,
One bird can herald spring.



One smile begins a friendship,
One handclasp lifts a soul.
One star can guide a ship at sea,
One word can frame the goal



One vote can change a nation,
One sunbeam lights a room
One candle wipes out darkness,
One laugh will conquer gloom.


One step must start each journey.
One word must start each prayer.
One hope will raise our spirits,
One touch can show you care.


One voice can speak with wisdom,
One heart can know what's true,
One life can make a difference,
You see, it's up to you!

Wednesday, October 22, 2008

C Interview Questions Answers - Vol 1

What is C language?

The C programming language is a standardized programming language developed in the early 1970s by Ken Thompson and Dennis Ritchie for use on the UNIX operating system. It has since spread to many other operating systems, and is one of the most widely used programming languages. C is prized for its efficiency, and is the most popular programming language for writing system software, though it is also used for writing applications.

What does static variable mean?

there are 3 main uses for the static.
1. If you declare within a function:It retains the value between function calls
2.If it is declared for a function name:By default function is extern..so it will be visible from other files if the function declaration is as static..it is invisible for the outer files
3. Static for global variables:By default we can use the global variables from outside files If it is static global..that variable is limited to with in the file

What are the different storage classes in C ?

C has three types of storage: automatic, static and allocated.
Variable having block scope and without static specifier have automatic storage duration.
Variables with block scope, and with static specifier have static scope. Global variables (i.e, file scope) with or without the the static specifier also have static scope.
Memory obtained from calls to malloc(), alloc() or realloc() belongs to allocated storage class.

What is hashing?

To hash means to grind up, and that’s essentially what hashing is all about. The heart of a hashing algorithm is a hash function that takes your nice, neat data and grinds it into some random-looking integer.
The idea behind hashing is that some data either has no inherent ordering (such as images) or is expensive to compare (such as images). If the data has no inherent ordering, you can’t perform comparison searches.
If the data is expensive to compare, the number of comparisons used even by a binary search might be too many. So instead of looking at the data themselves, you’ll condense (hash) the data to an integer (its hash value) and keep all the data with the same hash value in the same place. This task is carried out by using the hash value as an index into an array.
To search for an item, you simply hash it and look at all the data whose hash values match that of the data you’re looking for. This technique greatly lessens the number of items you have to look at. If the parameters are set up with care and enough storage is available for the hash table, the number of comparisons needed to find an item can be made arbitrarily close to one.
One aspect that affects the efficiency of a hashing implementation is the hash function itself. It should ideally distribute data randomly throughout the entire hash table, to reduce the likelihood of collisions. Collisions occur when two different keys have the same hash value.
There are two ways to resolve this problem. In open addressing, the collision is resolved by the choosing of another position in the hash table for the element inserted later. When the hash table is searched, if the entry is not found at its hashed position in the table, the search continues checking until either the element is found or an empty position in the table is found.
The second method of resolving a hash collision is called chaining. In this method, a bucket or linked list holds all the elements whose keys hash to the same value. When the hash table is searched, the list must be searched linearly.

Can static variables be declared in a header file?

You can’t declare a static variable without defining it as well (this is because the storage class modifiers static and extern are mutually exclusive). A static variable can be defined in a header file, but this would cause each source file that included the header file to have its own private copy of the variable, which is probably not what was intended.

Can a variable be both const and volatile?

Yes. The const modifier means that this code cannot change the value of the variable, but that does not mean that the value cannot be changed by means outside this code. For instance, in the example in FAQ 8, the timer structure was accessed through a volatile const pointer. The function itself did not change the value of the timer, so it was declared const. However, the value was changed by hardware on the computer, so it was declared volatile. If a variable is both const and volatile, the two modifiers can appear in either order.

Can include files be nested?

Answer Yes. Include files can be nested any number of times. As long as you use precautionary measures , you can avoid including the same file twice. In the past, nesting header files was seen as bad programming practice, because it complicates the dependency tracking function of the MAKE program and thus slows down compilation. Many of today’s popular compilers make up for this difficulty by implementing a concept called precompiled headers, in which all headers and associated dependencies are stored in a precompiled state. Many programmers like to create a custom header file that has #include statements for every header needed for each module. This is perfectly acceptable and can help avoid potential problems relating to #include files, such as accidentally omitting an #include file in a module.

What is a null pointer?

There are times when it’s necessary to have a pointer that doesn’t point to anything. The macro NULL, defined in , has a value that’s guaranteed to be different from any valid pointer. NULL is a literal zero, possibly cast to void* or char*. Some people, notably C++ programmers, prefer to use 0 rather than NULL. The null pointer is used in three ways:
1) To stop indirection in a recursive data structure
2) As an error value
3) As a sentinel value

Tuesday, October 21, 2008

J2EE Interview Questions Answers - Vol 1

What is J2EE?
J2EE is an environment for developing and deploying enterprise applications. The J2EE platform consists of a set of services, application programming interfaces (APIs), and protocols that provide the functionality for developing multitier, web-based applications.

What is the J2EE module?
A J2EE module consists of one or more J2EE components for the same container type and one component deployment descriptor of that type.

What are the components of J2EE application?
A J2EE component is a self-contained functional software unit that is assembled into a J2EE application with its related classes and files and communicates with other components. The J2EE specification defines the following J2EE components:
Application clients and applets are client components.
Java Servlet and JavaServer PagesTM (JSPTM) technology components are web components.
Enterprise JavaBeansTM (EJBTM) components (enterprise beans) are business components.
Resource adapter components provided by EIS and tool vendors.

What are the four types of J2EE modules?
1. Application client module
2. Web module
3. Enterprise JavaBeans module
4. Resource adapter module

What does application client module contain?
The application client module contains:
--class files,
--an application client deployment descriptor.
Application client modules are packaged as JAR files with a .jar extension.

What does web module contain?
The web module contains:
--JSP files,
--class files for servlets,
--GIF and HTML files, and
--a Web deployment descriptor.
Web modules are packaged as JAR files with a .war (Web ARchive) extension.

What are the differences between Ear, Jar and War files? Under what circumstances should we use each one?
There are no structural differences between the files; they are all archived using zip-jar compression. However, they are intended for different purposes.
--Jar files (files with a .jar extension) are intended to hold generic libraries of Java classes, resources, auxiliary files, etc.
--War files (files with a .war extension) are intended to contain complete Web applications. In this context, a Web application is defined as a single group of files, classes, resources, .jar files that can be packaged and accessed as one servlet context.
--Ear files (files with a .ear extension) are intended to contain complete enterprise applications. In this context, an enterprise application is defined as a collection of .jar files, resources, classes, and multiple Web applications.
Each type of file (.jar, .war, .ear) is processed uniquely by application servers, servlet containers, EJB containers, etc.

What is the difference between Session bean and Entity bean ?
The Session bean and Entity bean are two main parts of EJB container. Session Bean
--represents a workflow on behalf of a client
--one-to-one logical mapping to a client.
--created and destroyed by a client
--not permanent objects
--lives its EJB container(generally) does not survive system shut down
--two types: stateless and stateful beansEntity Bean
--represents persistent data and behavior of this data
--can be shared among multiple clients
--persists across multiple invocations
--findable permanent objects
--outlives its EJB container, survives system shutdown
--two types: container managed persistence(CMP) and bean managed persistence(BMP)

What is "applet" ?
A J2EE component that typically executes in a Web browser but can execute in a variety of other applications or devices that support the applet programming model.

What is "applet container" ?
A container that includes support for the applet programming model.

What is "application assembler" ?
A person who combines J2EE components and modules into deployable application units.

Monday, October 20, 2008

ASP Interview Questions Answers - Vol 1

What is ASP?

ASP stands for Active Server Pages. It is a server side technology which is used to display dynamic content on web pages. For example you could write code that would give your visitors different information, different images or even a totally different page depending on what browser version they are using.

How can you disable the browser to view the code?

Writing codes within the Tag

What is a "Virtual Directory"?

Virtual directories are aliases for directory paths on the server. It allows moving files on the disk between different folders, drives or even servers without changing the structure of web pages. It avoids typing an extremely long URL each time to access an ASP page.

Give the comment Tags for the following?

VBScript : REM & ‘(apostrophe)

JavaScript : // (single line comment)/* */ (Multi-line comments)

Which is the default Scripting Language of ASP (server-side)?

VBScript

Which is the default Data types in VBScript?

Variant is the default data type in VBScript, which can store a value of any type.

What is a variable?

Variable is a memory location through which the actual values are stored/retrieved. Its value can be changed.

What is the maximum size of an array?

Up to 60 dimensions.

What is Query string collection?

This collection stores any values that are provided in the URL. This can be generated by three methods:By clicking on an anchor tag By sending a form to the server by the GET methodThrough user-typed HTTP addressIt allows you to extract data sent to the server using a GET request.

What are the attributes of the tags? What are their functions?

The two attributes are ACTION and METHODThe ACTION gives the name of the ASP file that should be opened next by which this file can access the information given in the form The METHOD determines which of the two ways (POST or GET) the browser can send the information to the server

What are the methods in Session Object?

The Session Object has only one method, which is Abandon. It destroys all the objects stored in a Session Object and releases the server resources they occupied.

What is ServerVariables collection?

The ServerVariables collection holds the entire HTTP headers and also additional items of information about the server.

What is the difference between Querystring collection and Form collection?

The main difference is that the Querystring collection gets appended to a URL.

What is a Form collection?

The Form collection holds the values of the form elements submitted with the POST method. This is the only way to generate a Form collection.

What are the ASP Scripting Objects?

The Dictionary object, the FileSystemObject object, TextStream object.

What happens to a HTML page?

The browser makes a HTTP request; the server gives a HTTP response to the browser and the browser converts into a HTML page.

Sunday, October 19, 2008

HR Interview Questions - Answers Vol - 2

Why are you leaving (or did you leave) this position ?

(If you have a job presently tell the hr)

If you’re not yet 100% committed to leaving your present post, don’t be afraid to say so. Since you have a job, you are in a stronger position than someone who does not. But don’t be coy either. State honestly what you’d be hoping to find in a new spot. Of course, as stated often before, you answer will all the stronger if you have already uncovered what this position is all about and you match your desires to it.

(If you do not presently have a job tell the hr.)

Never lie about having been fired. It’s unethical – and too easily checked. But do try to deflect the reason from you personally. If your firing was the result of a takeover, merger, division wide layoff, etc., so much the better.

But you should also do something totally unnatural that will demonstrate consummate professionalism. Even if it hurts , describe your own firing – candidly, succinctly and without a trace of bitterness – from the company’s point-of-view, indicating that you could understand why it happened and you might have made the same decision yourself.

Your stature will rise immensely and, most important of all, you will show you are healed from the wounds inflicted by the firing. You will enhance your image as first-class management material and stand head and shoulders above the legions of firing victims who, at the slightest provocation, zip open their shirts to expose their battle scars and decry the unfairness of it all.

For all prior positions:
Make sure you’ve prepared a brief reason for leaving. Best reasons: more money, opportunity, responsibility or growth.

The "Silent Treatment"

Like a primitive tribal mask, the Silent Treatment loses all it power to frighten you once you refuse to be intimidated. If your interviewer pulls it, keep quiet yourself for a while and then ask, with sincere politeness and not a trace of sarcasm, “Is there anything else I can fill in on that point?” That’s all there is to it.

Whatever you do, don’t let the Silent Treatment intimidate you into talking a blue streak, because you could easily talk yourself out of the position.

Why should I hire you?

By now you can see how critical it is to apply the overall strategy of uncovering the employer’s needs before you answer questions. If you know the employer’s greatest needs and desires, this question will give you a big leg up over other candidates because you will give him better reasons for hiring you than anyone else is likely to…reasons tied directly to his needs.

Whether your interviewer asks you this question explicitly or not, this is the most important question of your interview because he must answer this question favorably in is own mind before you will be hired. So help him out! Walk through each of the position’s requirements as you understand them, and follow each with a reason why you meet that requirement so well.

Example: “As I understand your needs, you are first and foremost looking for someone who can manage the sales and marketing of your book publishing division. As you’ve said you need someone with a strong background in trade book sales. This is where I’ve spent almost all of my career, so I’ve chalked up 18 years of experience exactly in this area. I believe that I know the right contacts, methods, principles, and successful management techniques as well as any person can in our industry.”

“You also need someone who can expand your book distribution channels. In my prior post, my innovative promotional ideas doubled, then tripled, the number of outlets selling our books. I’m confident I can do the same for you.”

“You need someone to give a new shot in the arm to your mail order sales, someone who knows how to sell in space and direct mail media. Here, too, I believe I have exactly the experience you need. In the last five years, I’ve increased our mail order book sales from $600,000 to $2,800,000, and now we’re the country’s second leading marketer of scientific and medical books by mail.” Etc., etc., etc.,

Every one of these selling “couplets” (his need matched by your qualifications) is a touchdown that runs up your score. IT is your best opportunity to outsell your competition.

Aren’t you overqualified for this position?

As with any objection, don’t view this as a sign of imminent defeat. It’s an invitation to teach the interviewer a new way to think about this situation, seeing advantages instead of drawbacks.

Example: “I recognize the job market for what it is – a marketplace. Like any marketplace, it’s subject to the laws of supply and demand. So ‘overqualified’ can be a relative term, depending on how tight the job market is. And right now, it’s very tight. I understand and accept that.”

“I also believe that there could be very positive benefits for both of us in this match.”

“Because of my unusually strong experience in ________________ , I could start to contribute right away, perhaps much faster than someone who’d have to be brought along more slowly.”

“There’s also the value of all the training and years of experience that other companies have invested tens of thousands of dollars to give me. You’d be getting all the value of that without having to pay an extra dime for it. With someone who has yet to acquire that experience, he’d have to gain it on your nickel.”

“I could also help you in many things they don’t teach at the Harvard Business School. For example…(how to hire, train, motivate, etc.) When it comes to knowing how to work well with people and getting the most out of them, there’s just no substitute for what you learn over many years of front-line experience. You company would gain all this, too.”

“From my side, there are strong benefits, as well. Right now, I am unemployed. I want to work, very much, and the position you have here is exactly what I love to do and am best at. I’ll be happy doing this work and that’s what matters most to me, a lot more that money or title.”

“Most important, I’m looking to make a long term commitment in my career now. I’ve had enough of job-hunting and want a permanent spot at this point in my career. I also know that if I perform this job with excellence, other opportunities cannot help but open up for me right here. In time, I’ll find many other ways to help this company and in so doing, help myself. I really am looking to make a long-term commitment.”

NOTE: The main concern behind the “overqualified” question is that you will leave your new employer as soon as something better comes your way. Anything you can say to demonstrate the sincerity of your commitment to the employer and reassure him that you’re looking to stay for the long-term will help you overcome this objection.

Where do you see yourself five years from now?

Reassure your interviewer that you’re looking to make a long-term commitment…that this position entails exactly what you’re looking to do and what you do extremely well. As for your future, you believe that if you perform each job at hand with excellence, future opportunities will take care of themselves.

Example: “I am definitely interested in making a long-term commitment to my next position. Judging by what you’ve told me about this position, it’s exactly what I’m looking for and what I am very well qualified to do. In terms of my future career path, I’m confident that if I do my work with excellence, opportunities will inevitable open up for me. It’s always been that way in my career, and I’m confident I’ll have similar opportunities here.”

Describe your ideal company, location and job.

The only right answer is to describe what this company is offering, being sure to make your answer believable with specific reasons, stated with sincerity, why each quality represented by this opportunity is attractive to you.

Remember that if you’re coming from a company that’s the leader in its field or from a glamorous or much admired company, industry, city or position, your interviewer and his company may well have an “Avis” complex. That is, they may feel a bit defensive about being “second best” to the place you’re coming from, worried that you may consider them bush league.

This anxiety could well be there even though you’ve done nothing to inspire it. You must go out of your way to assuage such anxiety, even if it’s not expressed, by putting their virtues high on the list of exactly what you’re looking for, providing credible reason for wanting these qualities.

If you do not express genuine enthusiasm for the firm, its culture, location, industry, etc., you may fail to answer this “Avis” complex objection and, as a result, leave the interviewer suspecting that a hot shot like you, coming from a Fortune 500 company in New York, just wouldn’t be happy at an unknown manufacturer based in Topeka, Kansas.

Saturday, October 18, 2008

Friday, October 17, 2008

C++ Interview Questions Answers - Vol 1

What is C++?
Released in 1985, C++ is an object-oriented programming language created by Bjarne Stroustrup. C++ maintains almost all aspects of the C language, while simplifying memory management and adding several features - including a new datatype known as a class (you will learn more about these later) - to allow object-oriented programming. C++ maintains the features of C which allowed for low-level memory access but also gives the programmer new tools to simplify memory management.
C++ used for:
C++ is a powerful general-purpose programming language. It can be used to create small programs or large applications. It can be used to make CGI scripts or console-only DOS programs. C++ allows you to create programs to do almost anything you need to do. The creator of C++, Bjarne Stroustrup, has put together a partial list of applications written in C++.


How do you find out if a linked-list has an end? (i.e. the list is not a cycle)
You can find out by using 2 pointers. One of them goes 2 nodes each time. The second one goes at 1 nodes each time. If there is a cycle, the one that goes 2 nodes each time will eventually meet the one that goes slower. If that is the case, then you will know the linked-list is a cycle.


What is the difference between realloc() and free()?
The free subroutine frees a block of memory previously allocated by the malloc subroutine. Undefined results occur if the Pointer parameter is not a valid pointer. If the Pointer parameter is a null value, no action will occur. The realloc subroutine changes the size of the block of memory pointed to by the Pointer parameter to the number of bytes specified by the Size parameter and returns a new pointer to the block. The pointer specified by the Pointer parameter must have been created with the malloc, calloc, or realloc subroutines and not been deallocated with the free or realloc subroutines. Undefined results occur if the Pointer parameter is not a valid pointer.


What is function overloading and operator overloading?
Function overloading:
C++ enables several functions of the same name to be defined, as long as these functions have different sets of parameters (at least as far as their types are concerned). This capability is called function overloading. When an overloaded function is called, the C++ compiler selects the proper function by examining the number, types and order of the arguments in the call. Function overloading is commonly used to create several functions of the same name that perform similar tasks but on different data types.
Operator overloading allows existing C++ operators to be redefined so that they work on objects of user-defined classes. Overloaded operators are syntactic sugar for equivalent function calls. They form a pleasant facade that doesn't add anything fundamental to the language (but they can improve understandability and reduce maintenance costs).


What is the difference between declaration and definition?
The declaration tells the compiler that at some later point we plan to present the definition of this declaration.
E.g.: void stars () //function declaration
The definition contains the actual implementation.
E.g.: void stars () // declarator
{
for(int j=10; j > =0; j--) //function bodycout
<< *; cout <<>What are the advantages of inheritance?
It permits code reusability. Reusability saves time in program development. It encourages the reuse of proven and debugged high-quality software, thus reducing problem after a system becomes functional.


How do you write a function that can reverse a linked-list?
void reverselist(void)
{
if(head==0)
return;
if(head->next==0)
return;
if(head->next==tail)
{
head->next = 0;
tail->next = head;
}
else
{
node* pre = head;
node* cur = head->next;
node* curnext = cur->next;
head->next = 0;
cur-> next = head;
for(; curnext!=0; )
{
cur->next = pre;
pre = cur;
cur = curnext;
curnext = curnext->next;
}
curnext->next = cur;
}
}

Thursday, October 16, 2008

Why SO ? ? ? ?


1.> When I Take a long time to finish,
I am slow,

When my boss takes a long time,
he is thorough



2.> When I don't do it
I am lazy,

When my boss does not do it,
he is busy,


3.> When I do something without being told,
I am trying to be smart,

When my boss does the same,
he takes the initiative,


4.> When I please my boss,
I am apple polishing,

When my boss pleases his boss,
he is cooperating,


5.>When I make a mistake,
I' am an idiot.

When my boss makes a mistake,
he's only human.


6.> When I am out of the office,
I am wondering around.

When my boss is out of the office,
he's on business.


7.> When I am on a day off sick,
I am always sick.

When my boss is a day off sick,
he must be very ill.


8.> When I apply for leave,
I must be going for an interview

When my boss applies for leave
it's because he's overworked


9.> When I do good,
my boss never remembers,

When I do wrong,
he never forgets....

Wednesday, October 15, 2008

Aptitude Questions Answers Vol - 1

Q. If 2x-y=4 then 6x-3y=?
(a)15
(b)12
(c)18
(d)10
Ans. (b)


Q. If x=y=2z and xyz=256 then what is the value of x?
(a)12
(b)8
(c)16
(d)6
Ans. (b)


Q. (1/10)18 - (1/10)20 = ?
(a) 99/1020
(b) 99/10
(c) 0.9
(d) none of these
Ans. (a)


Q. Pipe A can fill in 20 minutes and Pipe B in 30 mins and Pipe C can empty the same in 40 mins.If all of them work together, find the time taken to fill the tank
(a) 17 1/7 mins
(b) 20 mins
(c) 8 mins
(d) none of these
Ans. (a)


Q. Thirty men take 20 days to complete a job working 9 hours a day. How many hour a day should 40 men work to complete the job?
(a) 8 hrs
(b) 7 1/2 hrs
(c) 7 hrs
(d) 9 hrs
Ans. (b)


Q. Find the smallest number in a GP whose sum is 38 and product 1728
(a) 12
(b) 20
(c) 8
(d) none of these
Ans. (c)


Q. A boat travels 20 kms upstream in 6 hrs and 18 kms downstream in 4 hrs. Find the speed of the boat in still water and the speed of the water current?
(a) 1/2 kmph
(b) 7/12 kmph
(c) 5 kmph
(d) none of these
Ans. (b)


Q. A goat is tied to one corner of a square plot of side 12m by a rope 7m long. Find the area it can graze?
(a) 38.5 sq.m
(b) 155 sq.m
(c) 144 sq.m
(d) 19.25 sq.m
Ans. (a)


Q. Mr. Shah decided to walk down the escalator of a tube station. He found that if he walks down 26 steps, he requires 30 seconds to reach the bottom. However, if he steps down 34 stairs he would only require 18 seconds to get to the bottom. If the time is measured from the moment the top step begins to descend to the time he steps off the last step at the bottom, find out the height of the stair way in steps?
Ans.46 steps.


Q. The average age of 10 members of a committee is the same as it was 4 years ago, because an old member has been replaced by a young member. Find how much younger is the new member ?
Ans.40 years.

Tuesday, October 14, 2008

Date of Grandma and Grandpa

Grandpa and Grandma always got very excited when they recalled the old days they were together. They made a decision, one day to make it "yesterday once more".



They made a date on the riverbank they used to go when they were young. The next day, Grandpa got up 6 a.m. in the morning, dashed to the bank, picked up a big bunch of wild flowers before sunrise, waited there for his sweetheart to come. But grandpa ended in disappointment grandma never showed up even after sunset.



Grandpa went home in such anger. He opened the door, seeing grandma lying on the sofa with her pillow. He threw the flowers on the floor and questioned: "Why didn't you come to our date?"



Grandma hid her head in the pillow and replied shyly: "Mom didn't allow me to go.........

Monday, October 13, 2008

Don't Worry!!! Marry to any Girl.

A young man went to his father one day to tell him that he wanted to get married. His father was happy for him.



He asked his son who the girl was, and he told him that it was Samantha a girl from the neighborhood. With a sad face the old man said to his son, 'I'm sorry to say this son but I have to.The girl you want to marry is your sister, but please don't tell your mother.



The young man again brought 3 more names to his father but ended up frustrated cause the response was still the same. So he decides to go to his mother. 'Mama I want to get married but all the girls that I love, dad said they are my sisters and I mustn't tell you.



His mother smiling said to him, 'Don't worry my son, you can marry any of those girls. You're not his son !!'

Sunday, October 12, 2008

How to Marry with Bill Gate's daughter?

Father: I want you to marry a girl of my choice


Son: 'I will choose my own bride!'





Father: 'But the girl is Bill Gates's daughter.'


Son: 'Well, in that case...ok'Next Day Father approaches Bill Gates.





Father: 'I have a husband for your daughter.'


Bill Gates: 'But my daughter is too young to marry!'





Father: 'But this young man is a vice-president of the World Bank.'


Bill Gates: 'Ah, in that case...ok'





Finally Father goes to see the president of the World Bank.


Father: 'I have a young man to be recommended as a vice-president.'





President: 'But I already have more vice- presidents than I need!'





Father: 'But this young man is Bill Gates's son-in-law.'


President: 'Ah, in that case...ok





'This is how business is done!!





Moral: Even If you have nothing, You can get Anything.. But yourattitude should be +ve...
a

Tuesday, October 7, 2008

GOD is Missing

Two little boys, aged 8 and 10, are excessively mischievous. They are always getting into trouble and their parents know all about it. If any mischief occurs in their town, the two boys are probably involved.



The boys' mother heard that a preacher in town had been successful in disciplining children, so she asked if he would speak with her boys. The preacher agreed, but he asked to see them individually. So the mother sent the 8 year old first, in the morning, with the older boy to see the preacher in the afternoon.



The preacher, a huge man with a booming voice, sat the younger boy down and asked him sternly, "Do you know where God is, son?"



The boy's mouth dropped open, but he made no response, sitting there wide-eyed with his mouth hanging open. So the preacher repeated the question in an even sterner tone, "Where is God?!"



Again, the boy made no attempt to answer. The preacher raised his voice even more and shook his finger in the boy's face and bellowed, "Where is God?!"



The boy screamed and bolted from the room, ran directly home and dove into his closet, slamming the door behind him. When his older brother found him in the closet, he asked, "What happened?"



The younger brother, gasping for breath, replied, "Boss we are in BIG trouble this time
....................
....................
....................
....................
................................................................................
................................................................................
................................................................................



"GOD is missing, and they think we did it!”

Thursday, October 2, 2008

Attack of a DOG !!!

A man sees a woman getting chased by a dog.

When the dog is about to bite the woman, the man intervenes and kicks the dog.



A reporter was seeing all this.

He said "That was great. I'll definitely publish this in newspaper.



Tomorrow the headline will be 'LOCAL HERO SAVES LADY FROM A DOG'."



The man replied "Thank you, but I'm not from here. I am from US".

Reporter: "OK. Then the headline will be 'US CITIZEN SAVES WOMAN FROM A DOG'".



Man: Actually, I live in US but I'm not a US citizen. I'm a Pakistani national".



Next day, the headline in the paper read

....

.....

...

.....

.....

.....

.....

.....

.....

.....

.....

.....

.....

.....

.....

.....

.....

.....

.....

.....

.....

.....

.....

.....

.....

.....



TERRORIST ATTACKS A LOCAL DOG.