– ‘ C ‘ –

Q: – Explain about storage of union elements. 

The key point about storage of union elements is that Union elements are use to share common memory space.

Q: – What is a memory leak?

Memory leak is that when memory is allocated but its not released because of an application consume memory reducing the available memory for other applications and causing the system to page virtual memory to the hard drive showing the application or crashing the application. When the computer memory resource limits are reached.

Q: – Is C is platform dependent or independent?how and why?

Major issue behind designing C language is that it is a small,portable programming language. It is used to implement an operating system.In past time C is a powerful tool for writing all types of program and has mechanism to achieve all most programming goals.So, we can say that C is platform dependent.

Q: – What are the stream files?

We can open file in C with using stream files.which are identified with a pointer to a FILE structure, or as low-level files, which are identified with an integer handle.

We can open stream files with using one of the following functions.

fopen(): Opens the specified file with the specified mode
freopen(): Closes the file specified, then opens a new file as specified
fdopen(): Opens a duplicate stream file for an already open low-level file

Q: – How the processor registers can be used in C? 

using keyword register we can use the process register in C.Basically process register is used to store variables those i want to access frequently.if these registers are not used in any other program,then those registers we used to allocate memory these variables.

Q: – How to access or modify the constt variable in C ?

We can not modify the constant variable.

Q: – Why n++ executes faster than n+1?

n++ executes faster than n+1 because n++ want only one instruction for execution where n+1 want more one instruction for execution.

Q: – What is the difference between the Heap and the Stack?

The main difference b/n the Heap and the Stack are given below:

– In stack we create object temporary where programmer used to reserve allocation.’
– stack not have automatic garbage collection where as heap have automatic garbage collection.

Q: – What is the Double LinkedList?

Double Linked List is that each data item in the list can point both side(next or previous)data item.It is not specific type means it may be of stack or queue.This is use to increase the performance of program.It is also called as Two-way Linked List or Symmetrically Linked list.

Q: – What are the advantages of high-level programming languages?

Readability, maintainability, and portability

Q: – Why is the main() function needed in a program?

The execution of a C program starts and ends with the main() function. Without the main() function, the computer does not know where to start to run a program.

Q: – What does the #include directive do?

The #include directive is used to include header files that contain the declarations to the functions used in your C program. In other words, the #include directive tells the C preprocessor to look into the include path to find the specified header file.

Q: – Why do you need a linker?

After compiling, some function code may still be missing in the object file of a program. A linker must then be used to link the object file to the C standard library or other user-generated libraries and include the missing function code so that an executable file can be created.

Q: – What is the difference between a constant and a variable?

The major difference is that the value of a constant cannot be changed, whereas the value of a variable can. You can assign different values to a variable whenever it’s necessary in your C program.

Q: – Why do you need a statement block?

Many C keywords can only control one statement. A statement block provides a way to put more than one statement together, and put the statement block under the control of a C keyword. Then, the statement block is treated as a single statement.

Q: – Which arithmetic operators have a higher precedence?

Among the five arithmetic operators, the multiplication, division, and remainder operators have a higher precedence than the addition and subtraction operators.

Q: – How many parts does a function normally have?

A function normally has six parts: the function type, the function name, the arguments, the opening brace, the function body, and the closing brace.

Q: – How can you declare two character variables?

There are two ways to do the declaration. The first one is

…char variable-name1, variable-name2;

The second one is

char variable-name1;
char variable-name2;

Q: – What are %c, %d, and %f?

These are format specifiers. %c is used to obtain the character format; %d is for the integer format; %f is for the floating-point format. %c, %d, and %f are often used with C functions such as printf().

Q: – What are the main differences between the int data type (integer) and the float data type (floating-point)?

First, an integer does not contain any fraction parts, but a floating-point number does. A floating-point number must have a decimal point. In C, the float data type takes more bits than the int data type. In other words, the float data type has a larger range of numeric values than the int data type.

Q: – What are stdin, stdout, and stderr?

In C, a file is treated as a series of bytes that is called file stream. stdin, stdout, and stderr are all pre-opened file streams. stdin is the standard input for reading; stdout is the standard output for writing; stderr is the standard error for outputting error messages.

Q: – What value is yielded by a relational expression?

A relational expression evaluates to either 0 or 1. If the relation indicated by a relational operator in an expression is true, the expression evaluates to 1; otherwise, the expression evaluates to 0.

Q: – Is the unary minus operator (-) the same as the subtraction operator (-)?

No, they are not the same, although the two operators share the same symbol. The meaning of the symbol is determined by the context in which it appears. The unary minus operator is used to change the sign of a numeric value. In other words, the unary minus operator yields the negation of the value. The subtraction operator is an arithmetic operator that performs a subtraction between its two operands.

Q: – Why do we need the sizeof operator?

The sizeof operator can be used to measure the sizes of all data types defined in C. When you write a portable C program that needs to know the size of an integer variable, it’s a bad idea to hard-code the size based on the machine you are currently using. The better way to tell the program the size of the variable is to use the sizeof operator, which yields the size of the integer variable at runtime.

Q: – What can the %lu format specifier do?

The %lu format specifier can be used in a printf() string to convert the corresponding argument to the unsigned long int data type. In addition, the %lu format specifier is equivalent to %Lu.

Q: – What are the left and right values?

The left value is the address of a variable, and the right value is the content stored in the memory location of a variable.

Q: – How can you obtain the address of a variable?

By using the address-of operator, &.

Q: – Can a null pointer point to valid data?

No. A null pointer cannot point to valid data. This is because the value contained by a null pointer has been set to 0.

Q: – What can the null character do?

The null character (‘’) in C can be used to mark the end of a string.

Q: – Can a global variable be hidden by a local variable with block scope?


Q: – Why do we need function prototypes?

With the help of a function prototype, the compiler can automatically perform type checking on the definition of the function, which saves you time in debugging the program.

Q: – Can a function return a pointer?


Q: – Why do you need to use arrays of pointers?

It is convenient to use an array of pointers to point to a set of character strings so that you can access any one of the strings referenced by a corresponding pointer in the array.

Q: – What does it mean if the malloc() function returns a null pointer?

If the malloc() function returns a null pointer, it means the function failed to allocate a block of memory whose size is specified by the argument passed to the function.

Q: – What are the differences between the calloc() and malloc() functions?

The calloc() function takes two arguments, while the malloc() function takes only one. The second difference is that the calloc() function initializes the allocated memory space to 0, whereas there is no such guarantee made by the malloc() function.

Q: – Is the free() function necessary?

Yes. The free() function is very necessary, and you should use it to free up allocated memory blocks as soon as you don’t need them.

Q: – What can you do with the enum data type?

The enum data type can be used to declare names that represent integer constants.

Q: – Why do you need to use the typedef keyword?

By using the typedef keyword, you can define your own names to represent the data types in C.

Q: – Can you redirect a standard stream to a disk file?

Yes. With the help of the freopen() function, you can redirect a standard stream and associate the stream with a disk file.

Q: – Is the C preprocessor part of the C compiler?


Q: – How do you remove a macro name?

By using the #undef directive with a macro name, that macro name can be removed, or “undefined.”

Q: – Why do you need the #endif directive?

The #endif directive is used with an #if, #ifdef, or #ifndef directives because statements under the control of a conditional preprocessor directive are not enclosed in braces ({ and }). Therefore, #endif must be used to mark the end of the block of statements.

Q: – Can the conditional expression following the #if directive be an arithmetic expression?


Q: – What is the difference b/n run time binding and compile time binding?

When the address of functions are determined a run time than it is called run time or dynamic binding or late binding. While when the addresses of functions are determined a compile time than it is called compile time or static binding or early binding.

Q: – Why do you need the #endif directive?

The key difference b/n linker and linkage is that linker is used to change an object code into an executable code by linking together the necessary build in functions. Place where we declare the variable in a program is called the linkage of variable.

Q: – What is the Double LinkedList?

Double Linked List is that each data item in the list can point both side(next or previous)data item.

Q: – Can we write a program with out using main() function?


Q: – Explain “method”?

A Method is a programmed procedure. It is defined as part of a class also included in any object of that class. Class can have more than one methods. It can be re-used in multiple objects.

Q: – What is the Double LinkedList?

Double Linked List is that each data item in the list can point both side(next or previous)data item.

Q: – Can we write a program with out using main() function?


Q: – Explain “method”?

A Method is a programmed procedure. It is defined as part of a class also included in any object of that class. Class can have more than one methods. It can be re-used in multiple objects.

Q: – Write a programme to display number from the bellow string?

char *ptr=”HELLO57hai”


int main()
char *ptr=”HELLO57hai”;

Q: – what are compilation process or steps?

prepocessor->compiler->assembler->linkEditor==Executable code

Q: – What is the output of the bellow program?

segmentation fault.because we are trying to read/assign character into const string.

char *ptr=”HELLO”;

Q: – There are numbers range from 1 to n randamly stored in the array and one number is missed in that array.write a program to find out missing number?

int missing_number(int a[],int n)
int Total,i;
Total -=a[i];
return Total;

Q: – What is the output of this Programme?

int main()
int x[]={1,3,2,4,6};
int *ptr,y;

Q: – How do you find middle element in the single linked list by traversing only one time from first to last?

we can findout middle element by taking two pointers.increment twice ptr1 while incrementing the ptr2 once ,so when ptr1 reaches to end of the node in the list,ptr2 will be pointing to middle element in the list. so we just return adress of middle element.
struct person*find_middle(struct person **listhead)
struct person *ptr1,*ptr2;
int i=0;
else if(i==1)

return ptr2;

Q: – What are “<<” and “>>” in C language. what is the output of the bellow code program?

int main()
int x=0x00AA;
int y=0x0055;
int z;
z=x<<8 + y>>8;


In C language <<(Left shift operator) and >>(Right shift operator) are called Bitwise operators and used to work on bits.
Z value is 4194304 for the above program.

Q: – What is Void pointer? can we perform arithimetic operations on void pointers?why? give one example?

void pointer is one kind of pointer ,it supports to hold data of all datatypes(like int,char,float etc).it’s also called generic pointer.we can’t perform arithimatic operations on void pointer because compiler doesn’t know the type of data to increment.


int main()
int a[]={100,200};
void *ptr;
printf(“%d\n”,*ptr); //here error occur.

Q: – What is the output of this program?

char *myfun(char *p)
return p;
int main()
int *p;
int *q;

Answer: LO.

Q: – Write a program to reverse a string with out using any array?

int main()
char *str=”Mahesh”;
char *ptr=str+strlen(str);


Q: – What is the output of this programe?

void Allocate(char *str, int size)
str =(char *)malloc(size);
int main()
char *str;
Allocate(str, 20);
strcpy(str, “HCL”);
strcat(str, “Technologies”);

Answer:Run time error(segmentation fault).

Reason: in function Allocate, we have allocated memory by using malloc function and assigned adress of that block to local pointer str. when control returns from that function the pointer (str) dies.so it will not affect in the main function. in main function,we are trying to read memory by using printf statement. so run time error occur.

Q: – What is the output of this programe?

char *ptr =”HCL Technologies”;

Answer:segmentation fault.because we are trying to modify the const string.

Q: – What is the output of this programe?

void show()
static int i=1;

int main()

Answer:1 2 3. static varibles values remain in function calls.if i(variable) in function show() islocal variable the out put would be 1 1 1.



MYSQL (DBMS) Interview Questions And Answers

Q: – What is REPLCAE statement, and how do I use it?

The REPLACE statement is the same as using an INSERT INTO command. The syntax is pretty much the same. The difference between an INSERT statement and a REPLACE statement is that MySQL will delete the old record and replace it with the new values in a REPLACE statement, hence the name REPLACE.

Q: – MySQL has a lot of neat functions. What if I need one that isn’t there?

MySQL is so flexible that it allows you to create your own functions. These user-defined functions act the same way that MySQL’s own intrinsic functions operate. It is also possible to recompile your functions into the application so that you will always have them, no matter how many times you install.

Q: – Do all unique keys have to be primary keys?

No. MySQL permits only one primary key per table, but there may be a number of unique keys. Both unique keys and primary keys can speed up the selecting of data with a WHERE clause, but a column should be chosen as the primary key if this is the column by which you want to join the table with other tables.

Q: – How many databases can one MySQL RDBMS contain?

Because MySQL uses the file system of the operating system, there really is no limit to the number of databases contained within a single MySQL RDBMS. The size of the database is limited by the operating system. The database tables can only be as big as the OS’s file system will allow.

Q: – I want to sort the values of my ENUM and SET columns. How do I do this?

The sort order depends on the order in which the values were inserted. ENUM and SET types are not case sensitive. The value that is inserted reverts to the value that you used when you created the ENUM or SET.

Q: – What can I do with the contents of a mysqldump file?

This file is a complete replica of your database in SQL format. You can do a lot of things with this data. You could re-create your database in Microsoft SQL Server or Sybase by simply cutting and pasting the contents of the file. You could also restore your database by using the dump file and the batching ability of the mysql program.

Q: – What are features of MYSQL ?

MySQL is a full-featured relational database management system. It is very stable and has proven itself over time. MySQL has been in production for over 10 years.

– MySQL is a multithreaded server. Multithreaded means that every time someone establishes a
connection with the server, the server program creates a thread or process to handle that client’s
requests. This makes for an extremely fast server. In effect, every client who connects to a MySQL
server gets his or her own thread.

– MySQL is also fully ANSI SQL92-compliant. It adheres to all the standards set forth by the American National Standards Institute.

– another feature of MySQL is its portability—it has been ported to almost every platform. This means that you don’t have to change your main platform to take advantage of MySQL. And if you do want to switch, there is probably a MySQL port for your new platform.

– MySQL also has many different application programming interfaces (APIs). They include APIs for Perl, TCL, Python, C/C++, Java (JDBC), and ODBC.

Q: – What do I do if I forget the MySQL root password?

First log in to the system as the same person who is running the mysqld
daemon (probably root). Kill the process, using the kill command.
Restart MySQL with the following arguments:
bin/mysqld Skip-grant
USE mysql;
UPDATE user SET password = password(‘newpassword’) WHERE User = ‘root’;
bin/mysqladmin reload

The next time you log in, you will use your new password

Q: – Where is the data stored in a MySQL database?

MySQL uses files to store data. These files are under the data/databasename directory, where databasename is the name of the database. There are three file types: .ISM, .FRM, and .ISD. The .FRM file contain the table schema. The .ISD is the file that actually holds the data. The .ISM file is the file that provides quick access between the two of them.

Q: – Explain the terms “mysqlimport”, “mysqldump”, “mysqladmin” and “mysqlcheck”?

mysqlimport for importing data files, mysqldump for making backups, mysqladmin for server administration, and mysqlcheck for checking the integrity of the database files.

Q: – How you will determine the options which are used by mysql?

#mysql –help

Q: – How you will determine the version of MySQL?

mysql –version

mysql  Ver 14.12 Distrib 5.0.77, for redhat-linux-gnu (i386) using readline 5.1

Q: – How you will connect to the server at a specific IP address with username and password?

mysql –host= –user=NAME –password=PASSWORD

Q: – What do you think about this command “mysql> STATUS;”

It will display information about the current connection to the server, as well as status information about the server itself.

Q: – Have you used this command “mysql> HELP contents;”?

Yes, You can get server-side help from this command.

mysql> HELP contents;

You asked for help about help category: “Contents”

For more information, type ‘help <item>’, where <item> is one of

the following categories:


Column Types

Data Definition

Data Manipulation


Geographic features


Q: – What is MySQL Query Browser?

The MySQL Query Browser is a graphical tool designed to provide a user friendly environment in which to construct and execute SQL statements.

Q: – Explain “AUTO_INCREMENT” attribute?

AUTO_INCREMENT attribute may be added to an integer column definition to create a column for which MySQL automatically generates a new sequence number each time you create a new row. There may be only one AUTO_INCREMENT column per table, the column must be indexed, and the column must be defined as NOT NULL.

Q: – What this command “mysqladmin status variables” will do?

This command will display a brief status message, followed by the list of server system variables.

Q: – Explain “CHECK TABLE” statement?

The CHECK TABLE statement performs an integrity check on table structure and contents. It works for MyISAM and InnoDB tables. For MyISAM tables, it also updates the index statistics. If the table is a view, CHECK TABLE verifies the view definition.

Q: – Explain “REPAIR TABLE” statement?

The REPAIR TABLE statement corrects problems in a table that has become corrupted. It works only for MyISAM tables.

Q: – Explain “ANALYZE TABLE” statement?

The ANALYZE TABLE statement updates a table with information about the distribution of key values in the table. This information is used by the optimizer to make better choices about query execution plans. This statement works for MyISAM and InnoDB tables.

Q: – Explain “OPTIMIZE TABLE” statement?

The OPTIMIZE TABLE statement cleans up a MyISAM table by defragmenting it. This involves reclaiming unused space resulting from deletes and updates, and coalescing records that have become split and stored non-contiguously. OPTIMIZE TABLE also sorts the index pages if they are out of order and updates the index statistics.

Q: – What is “mysqlcheck Client Program”?

mysqlcheck checks, repairs, analyzes, and optimizes tables. It can perform all these operations on MyISAM tables, and can perform some of them on InnoDB tables. It provides a command-line interface to the various SQL statements that instruct the server to perform table maintenance, such as CHECK TABLE and REPAIR TABLE.

Q: – What is “myisamchk Utility”?

The myisamchk utility performs table maintenance on MyISAM tables.

Q: – What is the use of “INFORMATION_SCHEMA Database”?

The INFORMATION_SCHEMA database provides access to database metadata.INFORMATION_SCHEMA is a “virtual database” in the sense that it is not stored anywhere on disk. But like any other database, it contains tables, and its tables contain rows and columns that can be accessed by means of SELECT statements.

Q: – What is “binary backup”?

A binary backup is a copy of the files in which database contents are stored. Copying these files preserves the databases in exactly the same format in which MySQL itself stores them on disk. Restoration involves copying the files back to their original locations. Techniques for making binary backups include file copy commands.

Q: – What is “text backup”?

A text backup is a dump of database contents into text files. Restoration involves loading the file contents back into databases by processing them through the server. Techniques for making text backups include the SELECT … INTO OUTFILE SQL statement, mysqldump, and MySQL Administrator.

Q: – How you will grant the SELECT privilege for all tables in the TEST database to a user named Ravi, who must connect from the local host and use a password of Ravi123?

Use following command.

GRANT SELECT ON TEST.* TO ‘Ravi’@’localhost’ IDENTIFIED BY ‘Ravi123’;

Q: – Explain “REVOKE statement”?

The REVOKE statement to revoke privileges from an account.

Q: – Explain the command “SHOW GRANTS FOR ‘root’@’localhost’;”

It will show the account has global, database-level, and table-level privileges.

.net Interview Questions And Answers

Q: – What is “Common Language Specification” (CLS) in .NET? 

CLS is the collection of the rules and constraints that every language (that seeks to achieve .NET compatibility) must follow. It is a subsection of CTS and it specifies how it shares and extends one another libraries.

Q: – What are Attributes in .NET? 

Attributes are declarative tags in code that insert additional metadata into an assembly. There exist two types of attributes in the .NET Framework: Predefined attributes such as Assembly Version, which already exist and are accessed through the Runtime Classes; and custom attributes, which you write yourself by extending the System

Q: – What are possible implementations of distributed applications in .NET?

.NET Remoting and ASP.NET Web Services. If we talk about the Framework Class Library, noteworthy classes are in System.Runtime.Remoting and System.Web.Services.


Q: – How to manage pagination in a page using .NET?

Using pagination option in DataGrid control is available in .NET. We have to set the number of records for a page, then it takes care of pagination by itself automatically.


Q: – What is ADO .NET and what is difference between ADO and ADO.NET?

ADO.NET is stateless mechanism. I can treat the ADO.Net as a separate in-memory database where in I can use relationships between the tables and select insert and updates to the database. I can update the actual database as a batch.


Q: – What is Reflection in .NET? 

It extends the benefits of metadata by allowing developers to inspect and use it at runtime. For example, dynamically determine all the classes contained in a given assembly and invoke their methods. Reflection provides objects that encapsulate assemblies, modules, and types. You can use reflection to dynamically create an instance of a type, bind the type to an existing object, or get the type from an existing object. You can then invoke the type’s methods or access its fields and properties. Namespace: System.Reflection

Q: – What Is ASP.NET?

ASP.NET, or Active Server Pages for the .NET Framework, is a technology for providing dynamic Web page content to your users.


Q Does using code-behind techniques with ASP.NET result in faster code?

Q Is the Page_Load event the best place to validate the contents of an ASP.NET page?


Q: – What Is XML?

XML is a way to represent structured data. Just like HTML, XML uses tags to enclose each piece of data. Unlike HTML, however, with XML you pick the names for each tag so that they are appropriate for your own dataset. One big advantage of XML is that the data contained in XML files is “self-describing,” because each data element is enclosed in HTML-like tags that give contextual clues about the data.


Q: – What Is XSL?

The eXtensible Stylesheet Language (XSL) is used to transform XML files into HTML, new and differently formatted XML files, text files, or other formats.


Q: – I want to add a custom method to my typed dataset. How should I do this?

 Don’t modify the automatically generated file itself because Visual Studio could rewrite it when you modify the source XML Schema. Instead, create a new class derived from the automatically generated class with your custom methods.


Q: – I store all my application data using XML. Can I still use the techniques presented
in the last part of this chapter?



Q Which UDDI provider should I use to publish my Web Service?

Choosing a UDDI provider is only a matter of personal preference. All UDDI providers share the same database of information. After you make a UDDI entry in one provider, the entry propagates to all other UDDI providers within a short amount of time.


Q: – Can malicious users read my configuration files and find out confidential information about my Web site?



Q: – I store all my application data using XML. Can I still use the techniques presented
in the last part of this chapter?



Q Which UDDI provider should I use to publish my Web Service?

Choosing a UDDI provider is only a matter of personal preference. All UDDI providers share the same database of information. After you make a UDDI entry in one provider, the entry propagates to all other UDDI providers within a short amount of time.


Q: – Can malicious users read my configuration files and find out confidential information about my Web site?





50 Common Interview Questions and Answers :

Review these typical interview questions and think about how you would answer them. Read the questions listed; you will also find some strategy suggestions with it.

1. Tell me about yourself:

The most often asked question in interviews. You need to have a short statement prepared in your mind. Be careful that it does not sound rehearsed. Limit it to work-related items unless instructed otherwise. Talk about things you have done and jobs you have held that relate to the position you are interviewing for. Start with the item farthest back and work up to the present.

2. Why did you leave your last job?

Stay positive regardless of the circumstances. Never refer to a major problem with management and never speak ill of supervisors, co- workers or the organization. If you do, you will be the one looking bad. Keep smiling and talk about leaving for a positive reason such as an opportunity, a chance to do something special or other forward- looking reasons.

3. What experience do you have in this field?

Speak about specifics that relate to the position you are applying for. If you do not have specific experience, get as close as you can.

4. Do you consider yourself successful?

You should always answer yes and briefly explain why. A good explanation is that you have set goals, and you have met some and are on track to achieve the others.

5. What do co-workers say about you?

Be prepared with a quote or two from co-workers. Either a specific statement or a paraphrase will work. Jill Clark, a co-worker at Smith Company, always said I was the hardest workers she had ever known. It is as powerful as Jill having said it at the interview herself.

6. What do you know about this organization?

This question is one reason to do some research on the organization before the interview. Find out where they have been and where they are going. What are the current issues and who are the major players?

7. What have you done to improve your knowledge in the last year?

Try to include improvement activities that relate to the job. A wide variety of activities can be mentioned as positive self-improvement. Have some good ones handy to mention.

8. Are you applying for other jobs?

Be honest but do not spend a lot of time in this area. Keep the focus on this job and what you can do for this organization. Anything else is a distraction.

9. Why do you want to work for this organization?

This may take some thought and certainly, should be based on the research you have done on the organization. Sincerity is extremely important here and will easily be sensed. Relate it to your long-term career goals.

10. Do you know anyone who works for us?

Be aware of the policy on relatives working for the organization. This can affect your answer even though they asked about friends not relatives. Be careful to mention a friend only if they are well thought of.

11. What kind of salary do you need?
A loaded question. A nasty little game that you will probably lose if you answer first. So, do not answer it. Instead, say something like, That’s a tough question. Can you tell me the range for this position? In most cases, the interviewer, taken off guard, will tell you. If not, say that it can depend on the details of the job. Then give a wide range.

12. Are you a team player?
You are, of course, a team player. Be sure to have examples ready. Specifics that show you often perform for the good of the team rather than for yourself are good evidence of your team attitude. Do not brag, just say it in a matter-of-fact tone. This is a key point.

13. How long would you expect to work for us if hired?

Specifics here are not good. Something like this should work: I’d like it to be a long time. Or As long as we both feel I’m doing a good job.
14. Have you ever had to fire anyone? How did you feel about that?

This is serious. Do not make light of it or in any way seem like you like to fire people. At the same time, you will do it when it is the right thing to do. When it comes to the organization versus the individual who has created a harmful situation, you will protect the organization. Remember firing is not the same as layoff or reduction in force.

15. What is your philosophy towards work?

The interviewer is not looking for a long or flowery dissertation here. Do you have strong feelings that the job gets done? Yes. That’s the type of answer that works best here. Short and positive, showing a benefit to the organization.

16. If you had enough money to retire right now, would you?

Answer yes if you would. But since you need to work, this is the type of work you prefer. Do not say yes if you do not mean it.

17. Have you ever been asked to leave a position?

If you have not, say no. If you have, be honest, brief and avoid saying negative things about the people or organization involved.

18. Explain how you would be an asset to this organization.

You should be anxious for this question. It gives you a chance to highlight your best points as they relate to the position being discussed. Give a little advance thought to this relationship.

19. Why should we hire you?

Point out how your assets meet what the organization needs. Do not mention any other candidates to make a comparison.

20. Tell me about a suggestion you have made.

Have a good one ready. Be sure and use a suggestion that was accepted and was then considered successful. One related to the type of work applied for is a real plus.

21. What irritates you about co-workers?

This is a trap question. Think real hard but fail to come up with anything that irritates you. A short statement that you seem to get along with folks is great.

22. What is your greatest strength?

Numerous answers are good, just stay positive. A few good examples: Your ability to prioritize, Your problem-solving skills, Your ability to work under pressure, Your ability to focus on projects, Your professional expertise, Your leadership skills, Your positive attitude

23. Tell me about your dream job.

Stay away from a specific job. You cannot win. If you say the job you are contending for is it, you strain credibility. If you say another job is it, you plant the suspicion that you will be dissatisfied with this position if hired. The best is to stay genetic and say something like: A job where I love the work, like the people, can contribute and can’t wait to get to work.

24. Why do you think you would do well at this job?

Give several reasons and include skills, experience and interest.

25. What are you looking for in a job?

See answer # 23

26. What kind of person would you refuse to work with?

Do not be trivial. It would take disloyalty to the organization, violence or lawbreaking to get you to object. Minor objections will label you as a whiner.

27. What is more important to you: the money or the work?

Money is always important, but the work is the most important. There is no better answer.

28. What would your previous supervisor say your strongest point is?

There are numerous good possibilities:
Loyalty, Energy, Positive attitude, Leadership, Team player, Expertise, Initiative, Patience, Hard work, Creativity, Problem solver

29. Tell me about a problem you had with a supervisor.

Biggest trap of all. This is a test to see if you will speak ill of your boss. If you fall for it and tell about a problem with a former boss, you may well below the interview right there. Stay positive and develop a poor memory about any trouble with a supervisor.

30. What has disappointed you about a job?

Don’t get trivial or negative. Safe areas are few but can include:
Not enough of a challenge. You were laid off in a reduction Company did not win a contract, which would have given you more responsibility.

31. Tell me about your ability to work under pressure.

You may say that you thrive under certain types of pressure. Give an example that relates to the type of position applied for.

32. Do your skills match this job or another job more closely?

Probably this one. Do not give fuel to the suspicion that you may want another job more than this one.

33. What motivates you to do your best on the job?

This is a personal trait that only you can say, but good examples are: Challenge, Achievement, Recognition

34. Are you willing to work overtime? Nights? Weekends?

This is up to you. Be totally honest.

35. How would you know you were successful on this job?

Several ways are good measures:
You set high standards for yourself and meet them. Your outcomes are a success.Your boss tell you that you are successful

36. Would you be willing to relocate if required?

You should be clear on this with your family prior to the interview if you think there is a chance it may come up. Do not say yes just to get the job if the real answer is no. This can create a lot of problems later on in your career. Be honest at this point and save yourself uture grief.

37. Are you willing to put the interests of the organization ahead of your own?

This is a straight loyalty and dedication question. Do not worry about the deep ethical and philosophical implications. Just say yes.

38. Describe your management style.

Try to avoid labels. Some of the more common labels, like progressive, salesman or consensus, can have several meanings or descriptions depending on which management expert you listen to. The situational style is safe, because it says you will manage according to the situation, instead of one size fits all.

39. What have you learned from mistakes on the job?

Here you have to come up with something or you strain credibility. Make it small, well intentioned mistake with a positive lesson learned. An example would be working too far ahead of colleagues on a project and thus throwing coordination off.

40. Do you have any blind spots?

Trick question. If you know about blind spots, they are no longer blind spots. Do not reveal any personal areas of concern here. Let them do their own discovery on your bad points. Do not hand it to them.

41. If you were hiring a person for this job, what would you look for?

Be careful to mention traits that are needed and that you have.

42. Do you think you are overqualified for this position?

Regardless of your qualifications, state that you are very well qualified for the position.

43. How do you propose to compensate for your lack of experience?

First, if you have experience that the interviewer does not know about, bring that up: Then, point out (if true) that you are a hard working quick learner.

44. What qualities do you look for in a boss?

Be generic and positive. Safe qualities are knowledgeable, a sense of humor, fair, loyal to subordinates and holder of high standards. All bosses think they have these traits.

45. Tell me about a time when you helped resolve a dispute between others.

Pick a specific incident. Concentrate on your problem solving technique and not the dispute you settled.

46. What position do you prefer on a team working on a project?

Be honest. If you are comfortable in different roles, point that out.

47. Describe your work ethic.

Emphasize benefits to the organization. Things like, determination to get the job done and work hard but enjoy your work are good.

48. What has been your biggest professional disappointment?

Be sure that you refer to something that was beyond your control. Show acceptance and no negative feelings.

49. Tell me about the most fun you have had on the job.

Talk about having fun by accomplishing something for the organization.

50. Do you have any questions for me?

Always have some questions prepared. Questions prepared where you will be an asset to the organization are good. How soon will I be able to be productive? and What type of projects will I be able to assist on? are examples.

And Finally Good Luck

Practical Applications of the ADO.NET XML Integration Features Part 1


Use a scenario-driven approach to examine how the Microsoft® ADO.NET XML integration features can be used explicitly in Microsoft .NET applications to address real world application development challenges
Audience familiarity with the following will be assumed:
  • The ADO.NET Object Model
  • Relational features in ADO.NET
  • Implicit usage of XML in ADO.NET (marshalling/remoting format, typed datasets, etc.)
  • Accessing/manipulating Microsoft SQL Server™ data using the SQL Managed Provider
Audience familiarity with the following will be assumed:
  • Basic knowledge of XML and its related standards: Writing well-formed XML
  • XML schemas (XSD) and their role in XML data validation
  • Concept and understanding of the usage of the XML DOM
  • Concept and understanding of the usage of XSLT transformations
  • Concept and understanding of the usage of XPath queries


ADO.NET Overview

Implicit Uses of XML in ADO.NET
  • The XML integration features in ADO.NET are centered around the Dataset object
  • XML is used implicitly in/by the following aspects of the Dataset object:
  1. Underlying storage format
  2. Serialization
  3. Marshalling (Web Services, .NET Remoting)
  4. Schema definition
  5. Strongly typed Datasets
  • XML is not the format used to represent data inside a memory resident Dataset object

Categories of the Explicit ADO.NET XML Integration API

  • The Dataset class implements the core ADO.NET XML integration API
  • API categories

Methods to fill a Dataset with data and schema information from an XML document/stream:

  • ReadXml
  • ReadXmlSchema
  • InferXmlSchema

Methods to serialize a Dataset as XML:

  • WriteXml
  • WriteXmlSchema
  • GetXml
  • GetXmlSchema

The XmlDataDocument Class

Inherits from System.Xml.XmlDocument
Implements the core W3C XML DOM level 1.0 API
Designed specifically to work hand-in-hand with the ADO.NET Dataset
  • Hierarchical view of relational data
  1. Relational data can be accessed/manipulated as hierarchical XML data (DOM API, XPath, XSLT)
  • Relational view of hierarchical data
  1. Hierarchical XML data can be accessed/manipulated using the dataset’s relational API
  • Automatic synchronization (integrate hierarchical and relational views of the data)

The XmlDataDocument and the DataSet

Practical Applications of the ADO.NET XML Integration Features Part 2

ADO.NET XML Integration Scenarios

  • Application integration
  • Transforming Dataset data using XSLT
  • Executing XPath queries on Dataset data
  • Relational views of hierarchical data
  • Creating repositories of frequently used Dataset schemas
  • Returning Datasets from ASP.NET Web Forms and Web Services
  • Programmatically convert XDR schemas to XSD schemas
  • Programmatically generate XSD schemas for XML documents
  • Create and populate SQL Server database tables usin g a manually fabricated Dataset

Scenario 1:

Application Integration

XML as a Medium for Application Integration

  • XML is a universal standards–based format for representing data
  • Its specifications and development are not owned/controlled by any specific organization
  • Its most significant application is its ability to serve as a universal platform/vendor–independent data interchange format
  • Platforms/applications capable of processing XML data can be integrated to share and exchange data

ADO.NET and Application Integration

  • The ADO.NET XML integration features facilitate true application integration
  • The ability to serialize a Dataset’s data and schema to XML makes it possible for other XML-enabled applications/platforms to:
  1. Access the data in a .NET application’s database
  2. Interpret the structure of the data in a .NET application’s database
  • The abilities to merge ADO.NET Datasets and use a source XML document/stream to fill a Dataset make it possible to:
  1. Insert/update/delete data in a .NET application’s database using XML generated by an external application/platform

Sample Scenario: http://www.buy-book.net

Buy-book.net Database Schema

  • Schema structures of the Titles and TitleInfo tables in the Buy-book.net database
  • These tables will be referenced in the subsequent slides of this scenario

Sample Scenario: The Publisher Catalog Update Service

  • Accesses a Web Service exposed by a publisher to obtain information about new titles and add new records to the Titles table in the Buy-book.net database.
  • The Titles table contains two columns (ISBN and Title). The ISBN column is the Primary key.
  • The publisher’s Web Service returns the list of new titles as well-formed XML that is compliant with the XSD schema definition of the structure of the Titles table.
  • The XML returned by the publisher’s Web Service is used to add new records to the Titles table.
  • Steps executed by the Buy-book.net publisher catalog update service to add new records to the Titles table:
  1. Instantiates a SqlDataAdapter by specifying a non-row returning query to select all columns in the Titles table
  2. Uses the SqlDataAdapter to fill an empty Dataset with schema information that reflects the structure of the Titles table
  3. Syncs the Dataset with an XmlDataDocument
  4. Loads the XML Data returned by the publisher’s Web Service into the XmlDataDocument (this will add the data to the Titles DataTable in the Dataset)
  5. Uses the Dataset and the SqlDataAdapter to update the Titles table in the database

Sample Code: The Publisher Catalog Update Service

Dim cn As SqlConnection

cn = New SqlConnection(“<Connection String>”)

Dim dsTitles As New DataSet()

Dim daTitles As New SqlDataAdapter(“Select * from Titles where 1=2”, cn)

Dim cmdBuilderTitles As New SqlCommandBuilder(daTitles)


dsTitles.DataSetName = “NewTitles“

daTitles.FillSchema(dsTitles, SchemaType.Source, “Titles”)

Dim NewTitlesDoc As New XmlDataDocument(dsTitles)


daTitles.Update(dsTitles, “Titles”)


Practical Applications of the ADO.NET XML Integration Features Part 3

Sample Scenario:

The Store Catalog Update Service

  • Uses XML to provide stores with a listing of their current Buy-book.net catalog
  • The stores return their updated Buy-book.net catalog as  well-formed XML that is compliant with the XSD schema definition of the structure of the TitleInfo table
  1. Columns: ISBN, StoreID, Price, DaysToDeliver
  2. Primary Key: ISBN + StoreID
  • Uses the XML data returned by the stores to update their catalog in the Buy-book.net database (modifies existing store TitleInfo records; adds new store TitleInfo records)
  • Steps executed by the Buy-book.net store catalog update service to update the TitleInfo table:
  1. Instantiates a SqlDataAdapter by specifying a query to return all TitleInfo records for the store whose catalog has to be updated
  2. Fills an empty Dataset with schema information that reflects the structure of the TitleInfo table
  3. Uses the SqlDataAdapter to fill the Dataset with data that reflects the current catalog of the store
  4. Instantiates a second Dataset and fills it with the schema of the TitleInfo table and the updated data contained in the XML returned by the store
  5. Merges the first Dataset with the second to reflect the store updates
  6. Uses the Dataset and the SqlDataAdapter to update the TitleInfo table in the database

Sample Code: The Store Catalog Update Service

Dim cn As SqlConnection

cn = New SqlConnection(“<ConnectionString>”)

Dim dsTitleInfo As New DataSet()

Dim daTitleInfo As New SqlDataAdapter(“Select * from TitleInfo where StoreID=1”, cn)

Dim cmdBuilderTitleInfo As New SqlCommandBuilder(daTitleInfo)


dsTitleInfo.DataSetName = “BookStoreCatalog”


daTitleInfo.Fill(dsTitleInfo, “TitleInfo”)

Dim dsUpdatedTitleInfo As New DataSet()



dsTitleInfo.Merge(dsUpdatedTitleInfo, False, MissingSchemaAction.Ignore)

daTitleInfo.Update(dsTitleInfo, “TitleInfo”)


Scenario 2:
Transforming Dataset Data Using XSLT

Applications of Using XSLT to Transform Dataset Data

  • Widely used for data presentation purposes in an ASP.NET application
  • Typically used when:
  1. Out-of-the box ASP.NET data bound server controls do not address presentation requirements (e.g. read-only hierarchical grid control)
  • Desired presentation format can be easily implemented by transforming the data to custom HTML
  • Can also be used to:
  1. Transform Dataset data to alternate presentation formats (CSV files, fixed length text files, etc.)
  2. Transform data to an alternate XML representation (interchange data with an external third-party application)
  3. Get a window (subset) of Dataset data

Programming Steps: Transforming Dataset Data Using XSLT

  • Fill the Dataset using a DataAdapter
  • Use the Dataset’s GetXml method to load the XML representation of the data into an XmlDocument object instance
  • Instantiate an XslTransform object using the desired XSLT style sheet
  • Call the Transform method of the XslTransform object to execute the XSLT transformation

Sample Code: Transforming Dataset Data in an ASP.NET Web Form

Dim ds as DataSet

Dim cn as SqlConnection

Dim da as SqlDataAdapter

‘Code to establish db connection, instantiate the DataAdapter and

‘fill the DataSet

Dim doc As New XmlDocument()


Dim xslTran As XslTransform = New XslTransform()

xslTran.Load(“<Path to XSLT Style sheet>”)

Response.ContentType = “text/html”

xslTran.Transform(doc, Nothing, Response.OutputStream)

Practical Applications of the ADO.NET XML Integration Features Part 4

Scenario 3:

Executing XPath Queries Against Dataset Data

Applications of Executing XPath Queries Against DataSet Data

  • Implicit application : XPath queries are used in XSLT style sheets to specify location paths for XSLT templates
  • Explicit application : Query/filter data contained in a 3+ level deep hierarchical Dataset using conditional query expressions that reference columns 2+ levels (grand-parent/grand-children columns) up/down the Dataset hierarchy

Sample Scenario: Using XPath to Query Dataset Data

  • Sample Dataset

  • Sample query: Find the number of times CustomerID VINET has placed an order for ProductID 70
  1. Requires access to data in the Orders and the OrderDetails tables (Parent – Child)
  2. Relational solution

Dim datview As New DataView(dsNorthwind.Tables(“OrderDetails”))

datview.RowFilter = “ProductID = 70 and Parent.CustomerID=’VINET'”

lXPath solution


  • Sample query: Find the names of customers in the UK who placed orders for ProductID 70
  1. Requires access to data in the Customers and the OrderDetails tables (Grand-parent – Grand-child)
  2. Relational solution
  3. No straight-forward relational solution (for instance, you cannot do the following):

Dim datview As New DataView(dsNorthwind.Tables(“OrderDetails”))

datview.RowFilter = “ProductID = 70 and ” & _

” Parent.Parent.Country = ‘UK’ ”

4.XPath solution


Programming Steps: Executing XPath Queries on Dataset Data

  • Fill the Dataset using a DataAdapter
  • Synchronize the Dataset with an XmlDataDocument
  • Use one of the following methods to execute the XPath query:
  1. Execute the SelectNodes or SelectSingleNode methods of the XmlDataDocument object by specifying the required XPath query as the query string parameter.
  2. Execute the CreateNavigator method of the XmlDataDocument to create an XPathNavigator object instance. Use the XPathNavigator to execute the XPath query (faster).

Sample Code: Executing an XPath Query on Dataset Data Using an XPathNavigator

‘Code to establish db connection, instantiate the DataAdapter(s) and

‘fill the DataSet

‘Instantiate and synchronize an XmlDataDocument with the DataSet

Dim dataDoc As New System.Xml.XmlDataDocument(dsNorthwind)

‘Use an XPathNavigator object to execute the XPath query

Dim nav As System.Xml.XPath.XPathNavigator = dataDoc.CreateNavigator()

‘Use an XPathNodeIterator object to access the results

Dim iter As System.Xml.XPath.XPathNodeIterator

iter = nav.Select(“<XPath query>”)

Do While iter.MoveNext



Sample Code: Executing an XPath Query on Dataset Data Using the SelectNodes Method

‘Code to establish db connection, instantiate the DataAdapter(s) and

‘fill the DataSet

‘Instantiate and synchronize an XmlDataDocument with the DataSet

Dim dataDoc As New System.Xml.XmlDataDocument(dsNorthwind)

‘Use the SelectNodes method of the XmlDataDocument to execute

‘the XPath query

nlist = dataDoc.SelectNodes(“<XPath query>”)

For Each node In nlist



Practical Applications of the ADO.NET XML Integration Features Part 5

Scenario 4:

Relational Views of Hierarchical Data

  • A relational view of hierarchical data can be obtained by:
  1. Using the ReadXml method of the Dataset
  2. Synchronizing an empty Dataset with an XmlDataDocument and loading the XmlDataDocument with XML data
  • Applications
  1. Data binding (enables visual editing of XML data using a custom UI)
  2. Relational data access to hierarchical data (use of the ADO.NET Dataset API to access/manipulate hierarchical data)
  3. Obtain a relational window to access a subset of the hierarchical data

Relational Window of Hierarchical  Data

  • Can be used to obtain a relational view of a subset of the hierarchical data
  • The subset of data used to fill the Dataset is determined by its schema
  • Use the ReadXml method of the Dataset if you do not need to:
  1. Update the data


  1. Preserve the original hierarchical structure of the source XML when persisting changes made using the Dataset API and/or data bound controls
  • Use an XmlDataDocument if you need to preserve the original hierarchical structure of the source XML when persisting changes made using the Dataset API and/or data bound controls

Sample Code: Relational Window of Hierarchical Data

Dim SuppliersDS as DataSet

Dim dataDoc as XmlDataDocument

Private Sub DisplaySupplierData()

‘Suppliers.xsd contains the XSD schema definition

‘for the structure of the Suppliers table


dataDoc = New XmlDataDocument(SuppliersDS)

‘Northwind.xml is a persisted snapshot of the

‘Customers, Orders, OrderDetails, Products and Suppliers tables

‘in the Northwind database


SuppliersGrid.DataSource = SuppliersDS

End Sub

Private Sub UpdateSupplierData()


End Sub

Practical Applications of the ADO.NET XML Integration Features Part 6

Scenario 5:

Creating a Repository of Frequently Used Dataset Schemas

Filling Dataset Schemas

  • Filling a Dataset with schema information can be done by:
  1. Manually fabricating the schema
  2. Using the FillSchema method of the DataAdapter
  3. Using the ReadXmlSchema method of the Dataset object
  • The manual option is generally code intensive and susceptible to errors
  • The FillSchema option is accurate, but requires additional roundtrips to the data source
  • The ReadXmlSchema method of the Dataset can be used efficiently when a repository of frequently used Dataset schemas exists

Persisting Dataset Schemas

  • The WriteXml method of the Dataset object can be used to persist a Dataset’s schema information in XSD format
  • A schema repository (e.g. a folder on a server, ASP.NET cache engine, or a database) can be created to store frequently used (rarely changing) Dataset schemas
  • A routine can be created to combine the accuracy of the DataAdapter’s FillSchema method and the persistence capability of the Dataset’s WriteXmlSchema method to create a repository of frequently used Dataset schemas
  • The ReadXml method of the Dataset object can then be used to fill a Dataset with schema information using a schema persisted in the repository

Scenario 6:

Returning Datasets from ASP.NET Web Forms and Web Services

Returning Datasets from an ASP.NET Web Form

  • Use the WriteXml method to return a Dataset’s data as XML
  1. Example: ds.WriteXml(Response.OutputStream)
  • Control the format of the returned XML using the XmlWriteMode parameter of the WriteXml method
  • Use the WriteXmlSchema method to return a Dataset’s schema in XSD format
  1. Example:   ds.WriteXmlSchema(Response.OutputStream)

Returning DataSets from an ASP.NET Web Service

  • The Microsoft Diffgram format is used by default when a Dataset is returned directly by a method of an ASP.NET Web Service
  • To return a Dataset’s data as regular well-formed XML
  1. Use the GetXml method to return a Dataset’s data as a regular well-formed XML string
  2. Use the returned string to load an XmlDocument object instance (the LoadXml method)
  3. Return the XmlDocument
  • To return a Dataset’s schema as regular well-formed XML
  1. Use the GetXmlSchema method to return a Dataset’s schema as a well-formed XML string (XSD format)
  2. Use the returned string to load an XmlDocument object instance (the LoadXml method)
  3. Delete the XmlDocument’s XML prolog node using RemoveChild DOM API
  4. Return the XmlDocument

Scenario 7:

Programmatically Converting XDR Schemas to XSD Schemas

  • The ReadXmlSchema method of the Dataset object can be used to fill a Dataset’s schema using either an XDR or an XSD schema source
  • The WriteXmlSchema method of the Dataset object serializes a Dataset’s schema only in the XSD format
  • These two methods can be used to programmatically convert an XDR schema into an XSD schema

Dim ds as New DataSet()



Scenario 8:

Programmatically Generating XSD Schemas from XML Instance Documents

  • Can be used to generate basic XSD schemas for XML instance documents that do not have associated schemas
  • Use the ReadXml and WriteXmlSchema methods if you wish to work with the data before generating the schema
  • Use the InferXmlSchema and WriteXmlSchema methods if you only need to infer and generate an XSD schema for an XML document

Dim ds as New DataSet()

ds.InferXmlSchema(“Titles.xml”, Nothing)


Scenario 9:

Generating and Populating SQL 2000 Database Tables Using Manually Fabricated Datasets

  • Manually fabricate a Dataset
  • Serialize its schema using the WriteXmlSchema method
  • Serialize its data using the WriteXml method
  • Alter the generated Schema to add SQLXML mapping annotations
  • The SQL 2000 XML Bulk Load component can use the generated XSD schema and XML data file to create and populate tables in a SQL 2000 database that map to the Dataset’s manually fabricated tables


  • Took a quick overview of the core ADO.NET components
  • Reviewed implicit uses of XML in ADO.NET
  • Identified the categories of the explicit ADO.NET XML integration API
  • Briefly examined the XmlDataDocument class and its integration with the ADO.NET Dataset
  • Examined scenarios to demonstrate practical applications of the ADO.NET XML integration features