Here the interviewer is looking at a number of factors- your problem solving skills, underlying attitudes, how you put across your ideas and how your previous experience may be useful to the present organization. When answering this question, keep the following in mind. What are the requirements of this organization or the job you have applied for? (You should have done some research about this before going to the interview). Now consider a situation, skill or experience from your past that would be relevant to the present company. This acts as a proof of your usefulness. It is a good idea to prepare such a list and have a few small stories ready for the interview. The word ‘story’ does not mean that you have to cook up something- find something genuine from your past. Having such stories helps you in several ways- you have something to talk about, and you feel more confident.
2. What is your way of handling conflicts?
Work related conflicts can be of several sub varieties. This could be conflicts between colleagues, conflicts between senior management and subordinates, conflicts with management rules, systems and procedures, conflicts with clients and customers as well as work versus personal life. The employer obviously expects you to look at things from their point of view. No employer likes an employee for whom they are second priority. You are valued for your ability to solve problems and not for bringing problems to the workplace. Therefore it is important to project a rational and realistic approach. You can say something like “I am aware that conflicts are quite natural things- problems do crop up. My approach would be to look at what is causing the problem. This involves communicating with my team members or the other concerned parties. I will take in as many views as possible and go with the solution that appears to be the most rational to me”. The interviewer is quite likely to ask you for some such instance from your previous work. In fact you can offer some such example even if you are not asked, as long as you keep it brief and relevant. If it illustrates your point, go for it.
3. In what ways do you think you are suited for this job? How can you contribute to this organization?
This again is a question that requires preparation. Before appearing for the interview, assess your own qualification and skills. You should also evaluate the needs of the job and the company. You are qualified for the job to the extent that these two match. What are the most important skills this particular position requires? Make a list and then prepare a list of instances from your previous work experience that match these requirements.
For instance, a customer care executive needs good interpersonal skills, ability to look at problems rationally, and also the ability to deal with difficult people. Once you are clear about this, make a list of such instances where your good interpersonal skills and objectivity helped to solve a difficult problem at work.
The next step is to analyze the specific requirements or problems the company is facing at the moment. Which of these can be helped by you? What is the value that you bring to the company?
Once you have prepared specific answers to these questions, you are in a great position to answer this question. You can now say something like “In my view, good interpersonal skills and objective problem analysis are the most important requirements in a customer care executive. I can tell you a few instances from my previous experience where I had demonstrated these skills and solved problems successfully (Give one or two brief stories here). I also see that you are planning to set up a separate unit to cater to corporate clients. With my previous experience in servicing corporate clients, this is an area I could be of specific use to you…”
Incidentally, this question may be framed in another way. “Why should we hire you?”
4. I would like to hear about some experience from your work life so far.
This is in fact another version of the previous question, but a more open-ended one. The interviewer wants to leave it up to you what part of your personality and work experience you wish to bring forth. However this is not an invitation to share your adventures and tales of heroism. You would do well to tell them some story from everyday work life, but one that shows your problem solving skills- things like how you conduct yourself at work and with difficult situations and people. Here you have more possibilities for showing something that you value in yourself- your resourcefulness, your adherence to the rules or your ability to think out of the box. But do consider the organization you are interviewing for- its requirements as well as work culture. What you say should not give the impression of a misfit.
5. Give us an instance when you failed in spite of your best efforts?
This is a very common situation for many people, but nevertheless a tricky question. You are likely to be embarrassed or worried that talking about a previous failure hampers your job prospects. This need not be the case. No one can be perfect. The employer here is most probably looking at your ability to deal with failure, learn from mistakes and also deal with other people’s mistakes. If you have such experiences, be prepared with one. Make sure that it is something that took place sometime back, was not too gigantic or drastic and something that offered you a chance to learn from and apply that learning thereafter. The net result should be to show you in a better light.
6. How would you evaluate your analytical skills?
This is a fairly easy question if you have done your homework. It is important to be realistic about what skills you have and how you can substantiate your claims. You have to be prepared to talk about where or how you learned the skill and how you have applied it. However your inventory should be in tune with what the current job requires. This way the employer gets to know about the specific skills you can bring to the table. You can also take into account skills you learned from extracurricular activities, as these can also teach you great skills like teamwork.
7. Tell us about what you consider as your weak area- things you find difficult to manage.
This is a multi-purpose question again. The interviewer wants to see how you react to tricky questions. They are also assessing your awareness of yourself and how you approach difficult situations and tasks. The trick is again being prepared with a story or two. It could be about addressing a meeting, voicing your disagreement about an important issue or being put in a situation you had no skills to handle. The story should show something valuable you have learned from the experience. It could also show a difficulty that you are preparing yourself to handle. “I find that it is difficult for me to make a presentation to my seniors without adequate preparation. I usually have to prepare all the details and rehearse in advance. For example, there was this instance with my previous company where the project had to be temporarily discontinued due to some problems with the supplies. The company was very concerned, as this project was strategically very important to them. I was asked to brief the top management immediately. I was handling all the details, so I simply put together all the facts and brought them up in the meeting. It was easier than I thought, but whenever possible I still would like some time to prepare”.
8. Tell us about your goals- both short term and long term.
This is a very you-specific question. It all depends on you. In answering this question, you have to assess where you are at the moment in your career and where you want to go from there. Many people switch careers five or six times and some have two careers going on simultaneously. Be sure to connect your answer to the job you are interviewing for. It makes sense to steer clear of aims that cannot be achieved with this organization. For example, you may like a stint abroad but the organization has no overseas connections. It is better not to mention this in the interview. This does not mean that you have to come up with things that you have no interest in. Research into the organization and the possibilities it offers and also consider your wishes. There is a good chance that you come up with something that connects the two.
9. Where do you see yourself in the next two/five/ten years?
This is another version of the previous question. The interviewer is here assessing how realistic and adept you are in making short term and long term plans. They also want to see if your aims are in sync with the organization’s. A sensible way to answer this is to relate it to your progress so far. “I started working five years back as a customer care executive while I was still pursuing my graduate studies. Once my graduation was done, I went ahead for a part-time MBA. Meanwhile I was promoted on the job to the level of a team leader in the next company that I worked for. This was in recognition of my experience and added qualification. . I am a fairly quick learner on the job and I have also continued with my learning through training programs and workshops. I am not really looking at titles, but overall growth in tandem with my learning and contribution to the organization. Therefore I could say that at the end of this period I will have learned more and assumed a role of more responsibility where I can make more significant contributions to the organization.”
10. Is there anything that would make us want to hire you, apart from what we have already asked you?
This is your chance for you to present your key selling points. Remember that many qualified people would have interviewed for this job. What makes you stand out? What are your strengths that this organization may want to hire you? Perhaps you are good at making stories sound interesting? Maybe you genuinely enjoy helping people. Or you have a knack of holding kids’ attention to what you are saying. Think of which of these are useful in the job you are applying for. Also be prepared to substantiate your claims. A class’ overall scores went up at the end of the term you took over as teacher- a difficult child was integrated into the class- or some such evidence. Be sure to plan this out well in advance. You can also include this in your thank you letter after the interview. That would help to sum up your key skills in your request for the job.
11. What in your view are the key factors in good customer service?
To answer this question, you need to step into the customer’s shoes. Keep aside the specific situation or problem. What do you expect as a customer? Now you are equipped to answer this question. You can say something like “There are two important elements to customer service- respect and prompt action”. You might come up with some other variant of this, so choose whatever sounds the most convincing to you. It would be great if you can cite one or two instances of exceptional customer care behavior where you were involved.
12. Tell us what you know about this organization.
This question is an excellent opportunity to show that you have an active interest in the organization. For this you need to do prior research about the company and also relate it to the field of expertise you are offering the company. For instance, if you are applying for a marketing position, “I am aware that you are one of the top five FMCG companies in India and that you are currently looking to expand your market into the Middle East. This area already has intense competition, however you have certain advantages like…”. This shows several things. For one, you have already gathered relevant information and you appreciate the company’s position. It also shows that you are actively using your expertise to bring in solutions.
13. From your resume, we see that you have been in your current job only for six months. Why do you want to leave it so soon and join us?
This is a tricky question. Be well prepared with a safe answer if you are in this position. The answer has to be closest to the truth while at the same time sounding a safe one. Your reasons could be any of these.
The actual job was very different from how it was described to me while joining.
The company changed its direction/ goals.
My skills and talents were not being put to good use there.
The company management changed and the new management brought in their own staff.
The company went in for downsizing or reorganization.
Whichever answer you might give, be prepared for a few follow up questions. Therefore it is important not to make up stories- who knows what kind of unexpected question the interviewer might throw at you!
The fact is, this is a very common situation. Most interviewers of some experience have heard these stories before. They are not really interested in all your details- what they want to know is how dependable you are. Are you a job hopper? The employer evaluates the circumstances under which you went for this short term job. Did you take it up when you already had a job or did you join the job when you were unemployed?
If you have held on to other jobs for longer and more reasonable durations, it is better to stress on that so that the employer sees this short term job as a one-off incident. You can even omit it from your resume. However you may not be able to omit the job from your resume if you are a young person who doesn’t have much experience and even a six or four month stint makes up a good percent of your total work experience.
14. What are you looking to gain from this organization?
This is another question where research makes all the difference. In other words the interviewer is asking what brings you job satisfaction. Find out some important things about the company, like the corporate structure, product base, recent happenings or current plans and the key figures in the management. Which of these appeal the most to you? “ In the past I have had several opportunities to work with some innovative launches. I understand that you are about to launch an e-learning portal to reach out to more students. I am very excited about this. With my experience in launching student interactive programs, I am positive of brining insights and contributions for this project. I am also very enthusiastic about the team you have already formed for this project. I feel that I have also a lot to learn from them..”. Working on new technology, doing path-breaking work, learning new skills, working with experts the company has on board, these are all sound lines to approach this question.
15. What for you are the most important factors of an employee’s responsibility towards the organization?
These include constantly bringing your best abilities to do the work at hand, putting your time to productive use, being loyal to the company, being a good team player, valuing the work relationship, and being passionate about the products and services the company is offering.
16. Why do you want to leave your current job and join us?
You may have to answer this question either in the company’s application form or at the interview. Be ready with a good answer. You might say something like this: “This company is known all over the country/world and I would like to work for you.” Whenever possible, it is a good idea to come to a consensus with your current employer as to your reasons for leaving, as the new company might approach them to enquire about you. Again put the information you have gathered by research to good use. Your effort should be to show how your skills and talents match with the company. If you can impress on the interviewer that this is just the opportunity you have been looking for, great. Give several points as to how you can add value to the company. Do not give downgrade the previous employer if asked your reasons for leaving the job. This reflects badly on you. You should come across as a positive, and enthusiastic individual who can be of value to the organization for many years to come. Ideally, you should put across a sincere, long-term interest in the company- this creates the impression that you are not just job-hopping.
17. Tell us about what motivates you.
This is something only you can frame an answer to. It is helpful to look into your past. What were the times and occasions when you were highly charged? When was the time when you were not motivated? Looking into these situations helps to bring forth a concrete answer.
18. What are the essential qualities that make a good team player?
It is better to answer this question taking the work context. What is the overall environment of the organization- what kind of work does it do? Is the organization framework very strong? Is the work atmosphere informal? Are the teams permanent or temporary? A person’s individual idea of a good team member might be different from what the organization needs. Your aim is to present yourself as a good team member who meets the specific parameters of the organization. A lot also depends on where you are in the structure- are you a new member, a team leader or in a support position? Consider all these factors before you answer this question. Also study what are the specific problems the company is facing in its team building and how you can contribute to solve them. You need to make yourself into a good fit into the team and ensure cooperation from others.
19. Why should we hire you for this position?
The answer to this question must be ready in your mind even before you submit your resume and prepare the cover letter. Do your homework by researching into the organization and the job. What are the requirements. Next, take stock of your own skills, experiences and interests. Which of these are matching with what the company needs? In other words, how can you add value to the company? Now form a strategy as to how you will prove that you are suitable for the job. Have concrete examples of your contributions to the previous employers and show enthusiasm for the job you are interviewing for. Remember that you are at the interview to offer solutions to some specific problems/requirements of the organization.
20. What is your salary now?
This is a tricky question. The good side is that you have come to a stage where the company is going to make an offer to you. This is a good opportunity to discuss salary. In case you are pressed to disclose your current salary, it is better to mention ranges or a total package rather than go for an exact figure. You can say something like the current package is on the higher side of five figures. Some employers might ask to see your salary slip or some such proof, therefore be sure not to lie. This punctures your credibility. It is better to show that you are willing to take a step back as an investment in this new career. This is an area where you should market yourself well. It is important to show why you like the job and how you are suited for it- the compensation is important, but not your first consideration.
21. What do you consider as a reasonable starting salary with us?
Ideally you should stay away from talking about compensation till the company makes an offer. However this does not happen in many situations and the company tries to figure out your price tag, so to say. This question might be used as a filter, so you need to give a response. Research can help you here. How is the general pay rate for this job? Have you checked out other ads for similar jobs? Now consider your experience level and see if your experience matches this pay range. This can work as an indicator to calculate how much you can ask for.
It is also important to present your estimate in the right manner. If you don’t have all the relevant information about the job so that you can present a reasonable range, say it and ask for what you need to know. “Before we can talk about salary, I would like to know how many people will be reporting to me and what their experience and skill levels are”. It is also possible to ask in a straightforward manner how other people in the same position are paid in this organization. Try to get as much information as possible, and then present your quote in the form of a range. “Based on the information I have got now, I feel that a range of – to – would be appropriate for this position. However I am quoting this outside of your standard benefits package”. Peg this in such a way that there is some possibility of negotiation.
22. If you got a chance to get into a merry-go-round, what song would you like to play? What animal would you choose?
This is one of those off-the-beaten-track questions. The first step towards answering this is not to feel embarrassed. This means just that the interviewer is creatively oriented. Moreover this question is very much appropriate if you are interviewing for a creatively oriented job like an advertising copy writer. Enjoy the situation and go with the flow. Try to give an answer that comes from within and reflects your real personality. Be ready to explain why you chose a particular song/tune or animal. An anecdote from your experience would be a good idea. If you can’t come up with any such stories, at least give a song you have always liked and held a special meaning for you. A brief and interesting narration is what the interviewer is looking forward to. The same is true for the choice of animal. You can choose an animal you like and tell them why. It does not really matter which song or animal you choose- your explanation of your choice is what makes all the difference.
Software Testing Release Life Cycle »
Software Testing Life Cycle consist of six (generic) phases: 1) Planning, 2) Analysis, 3) Design, 4) Construction, 5) Testing Cycles, 6) Final Testing and Implementation and 7) Post Implementation.
1. Planning ( Product Definition Phase)
1. High Level Test Plan, (includes multiple test cycles)
2. Quality Assurance Plan (Quality goals, Beta criteria, etc ..)
3. Identify when reviews will be held.
4. Problem Reporting Procedures
5. Identify Problem Classification.
6. Identify Acceptance Criteria - for QA and Users.
7. Identify application testing databases
8. Identify measurement criteria, i.e. defect quantities/severity level and defect origin (to name a few).
9. Identify metrics for the project
10. Begin overall testing project schedule (time, resources etc.)
11. Requisite: Review Product Definition Document
1. QA input to document as part of the Process Improvement Project
2. Help determine scope issues based on Features of the Product
3. 5 - 10 hours / month approximately
12. Plan to manage all test cases in a database, both manual or automated.
2. Analysis ( External Document Phase)
1. Develop Functional validation matrix based on Business Requirements.
2. Develop Test Case format - time estimates and priority assignments.
3. Develop Test Cycles matrices and time lines
4. Begin writing Test Cases based on Functional Validation matrix
5. Map baseline data to test cases to business requirements
6. Identify test cases to automate.
7. Automation team begin to setup variable files and high level scripts in AutoTester.
8. Setup TRACK and AutoAdviser for tracking components of automated system.
9. Define area for Stress and Performance testing.
10. Begin development of Baseline Database as per test case data requirements.
11. Define procedures for Baseline Data maintenance, i.e. backup, restore, validate.
12. Begin planning the number of test cycles required for the project, and Regression Testing.
13. Begin review of documentation, i.e. Functional Design, Business Requirements, Product Specifications, Product Externals etc..
14. Review test environments and lab, both Front End and Back End.
15. Prepare for using McCabe tool to support development in white box testing and code complexity analysis.
16. Setup Requite and start inputting documents.
17. Requisite: Review Externals Document
1. QA input to document as part of the Process Improvement Project
2. Start to write test cases from Action Response Pair Groups
3. Start to develop metrics based on estimated number of test cases, time to execute each case and if it is “automatable” .
4. Define baseline data for each test case
5. 25 hours / month approximately
3. Design (Architecture Document Phase)
1. Revise Test Plan based on changes.
2. Revise Test Cycle matrices and timelines
3. Verify that Test Plan and cases are in a database or Requisite.
4. Revise Functional Matrix
5. Continual to write out test cases and add new ones based on changes.
6. Develop Risk Assessment Criteria
7. Formalize details for automated testing and multi-user testing.
8. Select set of test cases to automate and begin scripting them.
9. Formalize detail for Stress and Performance testing
10. Finalize test cycles. (number of test case per cycle based on time estimates per test case and priority.)
11. Finalize the Test Plan
12. (Estimate resources to support development in unit testing)
13. Requisite: Review Architecture Document
1. QA input to document as part of the Process Improvement Project
2. Actual components or modules that development will code.
3. Unit testing standard defined here, pass/fail criteria, etc.
4. Unit testing reports, what they will look like, for both white and black box testing including input/outputs and all decision points.
5. List of modules that will be unit tested.
4. Construction (Unit Testing Phase)
1. Complete all plans
2. Complete Test Cycle matrices and timelines
3. Complete all test cases. (manual)
4. Complete AutoTester scripting of first set of automated test cases.
5. Complete plans for Stress and Performance testing
6. Begin Stress and Performance testing
7. McCabe tool support - supply metrics
8. Test the automated testing system and fix bugs.
9. (Support development in unit testing)
10. Run QA Acceptance test suite to certify software is ready to turn over to QA.
5. Test Cycle(s) / Bug Fixes (Re-Testing/System Testing Phase)
1. Test Cycle 1, run first set of test cases (front and back end)
2. Report bugs
Bug Verification - ongoing activity
3. Revise test cases as required
4. Add test cases as required
5. Test Cycle II
6. Test Cycle III
6. Final Testing and Implementation (Code Freeze Phase)
1. Execution of all front end test cases - manual and automated.
2. Execution of all back end test cases - manual and automated.
3. Execute all Stress and Performance tests.
4. Provide on-going defect tracking metrics.
5. Provide on-going complexity and design metrics.
6. Update estimates for test cases and test plans.
7. Document test cycles, regression testing, and update accordingly.
7. Post Implementation
1. Post implementation evaluation meeting to review entire project. (lessons learned)
2. Prepare final Defect Report and associated metrics.
3. Identify strategies to prevent similar problems in future project.
4. Create plan with goals and milestone how to improve processes.
5. McCabe tools - produce final reports and analysis.
6. Automation team - 1) Review test cases to evaluate other cases to be automated for regression testing, 2) Clean up automated test cases and variables, and 3) Review process of integrating results from automated testing in with results from manual testing.
7. Test Lab and testing environment - clean up test environment, tag and archive tests and data for that release, restore test machines to baseline, and etc. ..
Interview questions on C/C++ »
By admin on Oct 14, 2007 | In Interview questions on C/C++ | No Comments »
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.
How can you quickly find the number of elements stored in a a) static array b) dynamic array ?
Why is it difficult to store linked list in an array?
How can you find the nodes with repetetive data in a linked list?
Write a progamme to accept a given string in any order and flash error if any of the character is different. For example : If abc is the input then abc, bca, cba, cab bac are acceptable but aac or bcd are unacceptable.
This is a C question that I had for an intern position at Microsoft: 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. You can assume that all the characters will be unique. After I wrote out my function, he asked me to figure out from the code how many times the printf statement is run, and also questions on optimizing my algorithm.
What’s 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);
}
Given inputs X, Y, Z and operations | and & (meaning bitwise OR and AND, respectively)
What is output equal to in
output = (X & Y) | (X & Z) | (Y & Z)
Explain which of the following declarations will compile and what will be constant - a pointer or the value pointed at:
const char *
char const *
char * const
Note: Ask the candidate whether the first declaration is pointing to a string or a single character. Both explanations are correct, but if he says that it’s a single character pointer, ask why a whole string is initialized as char* in C++. If he says this is a string declaration, ask him to declare a pointer to a single character. Competent candidates should not have problems pointing out why const char* can be both a character and a string declaration, incompetent ones will come up with invalid reasons.
You’re given a simple code for the class BankCustomer. Write the following functions:
Copy constructor
= operator overload
== operator overload
+ operator overload (customers’ balances should be added up, as an example of joint account between husband and wife)
Note:Anyone confusing assignment and equality operators should be dismissed from the interview. The applicant might make a mistake of passing by value, not by reference. The candidate might also want to return a pointer, not a new object, from the addition operator. Slightly hint that you’d like the value to be changed outside the function, too, in the first case. Ask him whether the statement customer3 = customer1 + customer2 would work in the second case.
What problems might the following macro bring to the application?
#define sq(x) x*x
Consider the following struct declarations:
struct A { A(){ cout << \"A\"; } };
struct B { B(){ cout << \"B\"; } };
struct C { C(){ cout << \"C\"; } };
struct D { D(){ cout << \"D\"; } };
struct E : D { E(){ cout << \"E\"; } };
struct F : A, B
{
C c;
D d;
E e;
F() : B(), A(),d(),c(),e() { cout << \"F\"; }
};
What constructors will be called when an instance of F is initialized? Produce the program output when this happens.
Anything wrong with this code?
T *p = new T[10];
delete p;
Note: Incorrect replies: “No, everything is correct”, “Only the first element of the array will be deleted”, “The entire array will be deleted, but only the first element destructor will be called”.
Anything wrong with this code?
T *p = 0;
delete p;
Note: Typical wrong answer: Yes, the program will crash in an attempt to delete a null pointer. The candidate does not understand pointers. A very smart candidate will ask whether delete is overloaded for the class T.
Explain virtual inheritance. Draw the diagram explaining the initialization of the base class when virtual inheritance is used.
Note: Typical mistake for applicant is to draw an inheritance diagram, where a single base class is inherited with virtual methods. Explain to the candidate that this is not virtual inheritance. Ask them for the classic definition of virtual inheritance. Such question might be too complex for a beginning or even intermediate developer, but any applicant with advanced C++ experience should be somewhat familiar with the concept, even though he’ll probably say he’d avoid using it in a real project. Moreover, even the experienced developers, who know about virtual inheritance, cannot coherently explain the initialization process. If you find a candidate that knows both the concept and the initialization process well, he’s hired.
What’s potentially wrong with the following code?
long value;
//some stuff
value &= 0xFFFF;
Note: Hint to the candidate about the base platform they’re developing for. If the person still doesn’t find anything wrong with the code, they are not experienced with C++.
What does the following code do and why would anyone write something like that?
void send (int *to, int * from, int count)
{
int n = (count + 7) / 8;
switch ( count %
{
case 0: do { *to++ = *from++;
case 7: *to++ = *from++;
case 6: *to++ = *from++;
case 5: *to++ = *from++;
case 4: *to++ = *from++;
case 3: *to++ = *from++;
case 2: *to++ = *from++;
case 1: *to++ = *from++;
} while ( –n > 0 );
}
}
In the H file you see the following declaration:
class Foo {
void Bar( void ) const ;
};
Tell me all you know about the Bar() function
C++ object oriented interview questions »
By admin on Oct 14, 2007 | In C++ object oriented interview questions | No Comments »
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;
}
}
What is polymorphism?
Polymorphism is the idea that a base class can be inherited by several classes. A base class pointer can point to its child class and a base class array can store different child class objects.
How do you find out if a linked-list has an end?
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.
How can you tell what shell you are running on UNIX system?
You can do the Echo $RANDOM. It will return a undefined variable if you are from the C-Shell, just a return prompt if you are from the Bourne shell, and a 5 digit random numbers if you are from the Korn shell. You could also do a ps -l and look for the shell with the highest PID.
What is Boyce Codd Normal form?
A relation schema R is in BCNF with respect to a set F of functional dependencies if for all functional dependencies in F+ of the form a->b, where a and b is a subset of R, at least one of the following holds:
a->b is a trivial functional dependency (b is a subset of a)
a is a superkey for schema R
C++ Interview Questions »
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 <<>
ISO layers and what layer is the IP operated from?
caption, Presentation, Session, Transport, Network, Data link and Physical. The IP is operated in the Network layer.
Write a program that ask for user input from 5 to 9 then calculate the average
A.int main()
{
int MAX=4;
int total =0;
int average=0;
int numb;
cout<<"Please enter your input from 5 to 9";
cin>>numb;
if((numb <5)&&(numb>9))
cout<<"please re type your input";
else
for(i=0;i<=MAX; i++)
{
total = total + numb;
average= total /MAX;
}
return 0;
}
Can you be bale to identify between Straight- through and Cross- over cable wiring? and in what case do you use Straight- through and Cross-over?
Straight-through is type of wiring that is one to to one connection Cross- over is type of wiring which those wires are got switched. We use Straight-through cable when we connect between NIC Adapter and Hub. Using Cross-over cable when connect between two NIC Adapters or sometime between two hubs.
If you hear the CPU fan is running and the monitor power is still on, but you did not see any thing show up in the monitor screen. What would you do to find out what is going wrong?
I would use the ping command to check whether the machine is still alive(connect to the network) or it is dead.
Interview Questions That Are Defensive »
I understand the company has experienced layoffs within the last two years. Can you review the reasons why they were necessary?How were the layoffs handled in terms of notification, severance, outplacement services, etc.?
What rewards have you found effective in recognizing and rewarding exceptional work?
Are there formal metrics in place for measuring and rewarding performance over time?
How effectively has the company communicated its top three business goals?
I am a hard worker, and like to be around hard-working people. Am I going to be comfortable with the level of effort I find here?
Is the company’s training strategy linked to the company’s core business objectives?
How does your firm handle recognition for a job well done?
When was the last time you rewarded a subordinate for his or her efforts? What token of appreciation did you offer?
How does the firm recognize and learn from a brave attempt that didn’t turn out quite as expected?
If I were a spectacular success in this position after six months, what would I have accomplished?
How much freedom would I have in determining my objectives and deadlines?
How long has this position existed in the organization? Has its scope changed recently?
Do you foresee this job involving significant amounts of overtime or work on weekends?
What are the greatest challenges I will face in this position in furthering the agenda of the organization?
Are my tasks limited to my job description, or will I be performing duties outside the described job scope?
Probing interview Questions »
Could you please describe the management team to me?Does the company have a Net-use policy?
Will I receive my assignments from IT or from the business unit?
Do developers have little contact with the business unit or significant contact?
Can you show or sketch me an organizational chart?
If for any reason you were unable to function as CEO, how would you like to see the company managed?
To whom does the chief information or technology officer report?
How would you describe the degree to which you want your heirs to have strategic or operational influence in the company until one of them is ready to assume the role of COO or CEO?
What are you hoping to accomplish, and what will be my role in those plans?
May I see a job description? What are the most important responsibilities of the job?
How much time should be devoted to each area of responsibility?
What is my spending/budget authority?
What initial projects would I be tackling?
What are the biggest technical challenges ahead for this department/ company?
Presuming that I’m successful on this assignment, where else might I be of service to the company?
Traditionally, companies have used IT to reduce bottom-line costs. But I am excited about the use of IT to advance top-line opportunities such as creating new products and identifying new markets. Can you talk about how IT is used in this company to create top-line value?
What structured strategies for software testing have you found effective here?
Does the company use an IT steering committee?
If you put all the salespeople in a line from your best to the merely acceptable performer, what are the earnings of the 50th percentile? The 25th? The 75th?
Can you describe the performance of the sales team?
What is the commission structure, and what is my earning potential in 1,3,5, or 10 years?
What percentage of salespeople attain objectives?
What percentage of the current people are above and below their set goals?
Questions for Hiring Managers »
Could you explain the company’s organizational structure?
What is the organization’s plan for the next five years, and how does this department or division fit in?
What specific skills from the person you hire would make your life easier?
Will we be expanding or bringing on new products or new services that I should be aware of?
What are some of the problems that keep you up at night?
What are some of the skills and abilities you see as necessary for someone to succeed in this job?
What would be a surprising but positive thing the new person could do in first 90 days?
What challenges might I encounter if I take on this position?
How does upper management perceive this part of the organization?
What are your major concerns that need to be immediately addressed in this job?
What do you see as the most important opportunities for improvement in the area I hope to join?
What are the attributes of the job that you’d like to see improved?
What are the organization’s three most important goals?
What is your company’s policy on attending seminars, workshops, and other training opportunities?
How do you see this position impacting the achievement of those goals?
What is the budget this department operates with?
What attracted you to working for this organization?
What committees and task forces will I be expected to participate in?
What have you liked most about working here?
How will my leadership responsibilities and performance be measured? By whom?
What are the day-to-day responsibilities I’ll be assigned?
Are there any weaknesses in the department that you are particularly looking to improve?
What are the department’s goals, and how do they align with the company’s mission?
What are the company’s strengths and weaknesses compared with the competition? (name one or two companies)
How does the reporting structure work here? What are the preferred means of communication?
What goals or objectives need to be achieved in the next six months?
Can you give me an ideal of the typical day and workload and the special demands the job has?
This a new position. What are the forces that suggested the need for this position?
What areas of the job would you like to see improvement in with regard to the person who was most recently performing these duties?
From all I can see, I’d really like to work here, and I believe I can add considerable value to the company. What’s the next step in the selection process?
How does this position contribute to the company’s goals, productivity, or profits?
What is currently the most pressing business issue or problem for the company or department?
Would you describe for me the actions of a person who previously achieved success in this position?
Would you describe for me the action of a person who previously performed poorly in this position?
How would you describe your own management style?
What are the most important traits you look for in a subordinate?
How do you like your subordinates to communicate with you?
What personal qualities or characteristics do you most value?
Could you describe to me your typical management style and the type of employee who works well with you?
Corporate culture is very important, but it’s usually hard to define until one violates it. What is one thing an employee might do here that would be perceived as a violation of the company’s culture?
How would you characterize the organization? What are its principal values? What are its greatest challenges?
How would you describe the experience of working here?
If I were to be employed here, what one piece of wisdom would you want me to incorporate into my work life?
What are a couple of misconceptions people have about the company?
Work-life balance is an issue of retention as well as productivity. Can you talk about your own view of how to navigate the tensions between getting work done and encouraging healthy lives outside the office?
How does the company support and promote personal and professional growth?
What types of people seem to excel here?
Every company contends with office politics. It’s a fact of life because politics is about people working together. Can you give me some exams of how politics plays out in this company?
What have I yet to learn about this company and opportunity that I still need to know?
I’m delighted to know that teamwork is highly regarded. But evaluating performance of teams can be difficult. How does the company evaluate team performance? For example, does it employ 360-degree feedback programs?
What are the organization’s primary financial objectives and performance measures?
What operating guidelines or metrics are used to monitor the planning process and the results?
To what extent are those objectives uniform across all product lines?
How does the company balance short-term performance versus long-term success?
What kinds of formal strategic planning systems, if any, are in place?
Can you describe the nature of the planning process and how decisions concerning the budgeting process are made?
Can you identify the key corporate participants in the planning process?
How often and in what form does the company report its results internally to its employees?
In the recent past, how has the company acknowledged and rewarded outstanding performance?
What are the repercussions of having a significant variance to the operating plan?
Are budgeting decisions typically made at corporate headquarters, or are the decisions made in a more decentralized fashion?
I’m glad to hear that I will be part of a team. Let me ask about reward structures for teams. Does the company have a formal team-based compensation process?
Is the company more of an early adapter of technology, a first mover, or is it content to first let other companies work the bugs out and then implement a more mature version of the technology?
How does the company contribute to thought leadership in its market?
How advanced is the company’s commitment to knowledge management?
I was pleased to hear you describe the company’s branding strategy. How does branding fit into the overall marketing mix?
How does this position contribute to the company’s goals, productivity, or profits?
According to (name source), your principal competitor, Brand X, is the best-selling product in the space. What does Brand X do better than your product?
Business Week magazine ranks the company second (or whatever) in its industry. Does this position represent a change from where it was a few years ago?
How accessible is the CEO (name him or her) to people at my level of the organization?
Does the CEO (name him or her) publish his or her email address?
I understand that the CEO is really approachable. Are there ground rules for approaching him or her?
Staff development is mentioned in your annual report as a measure on which executives are evaluated. What kinds of training experiences might I expect?
Is the department a profit center?
Can you please tell me about the people who will look to me for supervision?
Would I encounter any coworker or staff person who’s proved to be a problem in the past?
What happened to the person who previously held this job?
The incumbent was dismissed? How could the problems have been avoided?
The incumbent was promoted? I’m delighted to hear it. Would it be possible for me to talk to him or her?
What is the company customer-service philosophy?
Could you tell me about a time when the team/company went out of its way to provide knock-your-socks-off service?
The best companies rely on rich customer data to fuel personalized content and services. How is the company doing in personalizing its offerings?
Customers are expecting companies to protect their data. Does the company have a privacy policy for its Web initiatives, and how does the company balance the momentum for ever-increasing personalization with rising concerns for privacy?
How empowered are employees? How much of the company’s money can your people (including the ones with single-digit pay grades) spend on their own recognizance to satisfy a customer or address a work-process issue?
How often would I come into direct contact with real, living, breathing, paying customers?
What are the success factors that will tell you if the decision to bring me on board was the right one?
To make our working relationship successful — something we both want — we’ll need to be sure we have good chemistry together. How might we determine this, and then what action would you see us engage in to build that relationship?
If you and I were developing some sort of philosophical difference, how would you want to go about resolving it?
Popularity: 25% [?]
Java Interview Question »
By admin on Oct 14, 2007 | In Java Interview Question | No Comments »
What is the difference between an Interface and an Abstract class?
An abstract class can have instance methods that implement a default behavior. An Interface can only declare constants and instance methods, but cannot implement default behavior and all methods are implicitly abstract. An interface has all public members and no implementation. An abstract class is a class which may have the usual flavors of class members (private, protected, etc.), but has some abstract methods.
What is the purpose of garbage collection in Java, and when is it used?
The purpose of garbage collection is to identify and discard objects that are no longer needed by a program so that their resources can be reclaimed and reused. A Java object is subject to garbage collection when it becomes unreachable to the program in which it is used.
Describe synchronization in respect to multi threading.
With respect to multithreading, synchronization is the capability to control the access of multiple threads to shared resources. Without synchronization, it is possible for one thread to modify a shared variable while another thread is in the process of using or updating same shared variable. This usually leads to significant errors.
Explain different way of using thread?
The thread could be implemented by using runnable interface or by inheriting from the Thread class. The former is more advantageous, ’cause when you are going for multiple inheritance..the only interface can help.
What are pass by reference and passby value?
Pass By Reference means the passing the address itself rather than passing the value. Passby Value means passing a copy of the value to be passed.
What is HashMap and Map?
Map is Interface and Hashmap is class that implements that.
Difference between HashMap and HashTable?
The HashMap class is roughly equivalent to Hashtable, except that it is unsynchronized and permits nulls. (HashMap allows null values as key and value whereas Hashtable doesnt allow). HashMap does not guarantee that the order of the map will remain constant over time. HashMap is unsynchronized and Hashtable is synchronized.
Difference between Vector and ArrayList?
Vector is synchronized whereas arraylist is not.
Difference between Swing and Awt?
AWT are heavy-weight componenets. Swings are light-weight components. Hence swing works faster than AWT.
What is the difference between a constructor and a method?
A constructor is a member function of a class that is used to create objects of that class. It has the same name as the class itself, has no return type, and is invoked using the new operator.
A method is an ordinary member function of a class. It has its own name, a return type (which may be void), and is invoked using the dot operator.
What is an Iterator?
A: Some of the collection classes provide traversal of their contents via a java.util.Iterator interface. This interface allows you to walk through a collection of objects, operating on each object in turn. Remember when using Iterators that they contain a snapshot of the collection at the time the Iterator was obtained; generally it is not advisable to modify the collection itself while traversing an Iterator.
State the significance of public, private, protected, default modifiers both singly and in combination and state the effect of package relationships on declared items qualified by these modifiers.
public : Public class is visible in other packages, field is visible everywhere (class must be public too)
private : Private variables or methods may be used only by an instance of the same class that declares the variable or method, A private feature may only be accessed by the class that owns the feature.
protected : Is available to all classes in the same package and also available to all subclasses of the class that owns the protected feature.This access is provided even to subclasses that reside in a different package from the class that owns the protected feature.
default :What you get by default ie, without any access modifier (ie, public private or protected).It means that it is visible to all within a particular package.
What is an abstract class?
Abstract class must be extended/subclassed (to be useful). It serves as a template. A class that is abstract may not be instantiated (ie, you may not call its constructor), abstract class may contain static data. Any class with an abstract method is automatically abstract itself, and must be declared as such.
A class may be declared abstract even if it has no abstract methods. This prevents it from being instantiated.
What is static in java?
A: Static means one per class, not one for each object no matter how many instance of a class might exist. This means that you can use them without creating an instance of a class.Static methods are implicitly final, because overriding is done based on the type of the object, and static methods are attached to a class, not an object. A static method in a superclass can be shadowed by another static method in a subclass, as long as the original method was not declared final. However, you can’t override a static method with a nonstatic method. In other words, you can’t change a static method into an instance method in a subclass.
What is final?
A: A final class can’t be extended ie., final class may not be subclassed. A final method can’t be overridden when its class is inherited. You can’t change value of a final variable (is a constant).
Popularity: 28% [?]
Database objective interview questions »
By admin on Oct 14, 2007 | In Database objective interview questions | No Comments »
What are the maximum number of tables that can be joined together in a query?
A) 16
B) 32
C) 256
D) 1024
When using BCP to copy data into a table, which of the following statements apply? Choose 2.
A) Database users will not be able to access the table because BCP will lock it.
B) Database users will see the rows inserted by BCP after each batch is complete.
C) You must have INSERT permissions on the table.
D) Existing rows are replaced by BCP.
An UPDATE statement may modify how many tables?
A) One or more tables, provided the UPDATE statement is not operating on a view.
B) Only one, though triggers may cause additional side-effects.
C) Only one.
D) Up to sixteen
Data and log files expand by what increment?
A) 8KB
B) 64KB
C) 512KB
D) 1MB
Jamie is having a problem tracking down an issue users are having with a stored procedure. Users will occasionally have problems with the stored procedure running for an excessive amount of time, perhaps hours on end. There are no messages in the SQL Server error log that correspond to the times that users are having problems. Which of the following is the most likely cause and resolution?
A) The server is crashing and the users aren’t able to access their data. Replace the hardware.
B) The server is processing a database backup, and which is causing an excessive
amount of locking. Stop the automated backup jobs.
C) There is a problem with one or more user connections causing lock contention.
Use sp_who and DBCC INPUTBUFFER to track down the likely culprit.
D) There is a problem with one or more user connections causing lock contention.
Use sp_lock to track down the
Which of the following commands are parts of the Data Definition Language (DDL)?
A) INSERT
B) CREATE TABLE
C) UPDATE
D) CREATE VIEW
Consider the following table and trigger definitions: Table1: UserID int IDENTITY FirstName char(50) LastName char(50) DepartmentID int BillingID int CREATE TRIGGER Table1_InsertUpdate ON Table1 FOR INSERT, UPDATE AS BEGIN IF UPDATE(DepartmentID) IF (Select count(*) from Table1 inner join Deleted on Table1.DepartmentID = deleted.departmentid) = 0 BEGIN RAISERROR (’Cannot remove the last member from a department.’, 16, 1) ROLLBACK END END What does the ROLLBACK statement in the trigger do?
A) It causes the transaction to roll back, aborting the INSERT or UPDATE that cause the trigger to run, but not aborting the transaction that the offending statement was part of.
B) It causes the transaction containing the offending statement to roll back.
C) Nothing; the keyword EXIT should have been used to abort the transaction.
D) It causes the transaction log to fill up.
In order for her new application to process a sales record, Kim has to make sure that the application has collected enough information. For sales over $500, she needs to have a valid account manager’s ID number. For sales over $1000, she needs to have a valid zip code for delivery to determine who gets commission. For sales over $10,000, she needs to make sure that enough stock is available. Which of the following would be a good way to check the data prior to inserting it?
A) Table constraints
B) Triggers
C) An inline table-valued function
D) A multi-statement table-valued function
What is the maximum number of rows that a table can store in SQL Server 2000?
A) 255
B) 1,048,516
C) 2,147,483,647
D) No limit besides physical storage size
If table_a has an insert trigger that performs an update on table_b, in which case will the update trigger on table_b be fired?
A) If the ‘nested triggers’ database option has a value of ‘1′.
B) If the ‘nested triggers’ server option is set to ‘1′.
C) If the ‘nestable’ option is set for the trigger on table_a.
D) If the ‘nestable’ option is set for the trigger on table_b.
You are finding unusually high memory utilization on a SQL Server that is primarily used to process XML data. The server will periodically freeze up and refuse to process any more XML statements. The problem can only be fixed by restarting the SQL Server service, at which point it work fine for a while, but the problem always returns. What is the most likely cause for
the problem?
A) Your developers are probably not deallocating their cursors after processing the XML data.
B) The system is routinely encountering malformed XML and the accumulated errors are crashing the system.
C) The XML strings are not being removed after being prepared and used.
D) A hardware problem is the root of your trouble.
What are two advantages of triggers over rules and constraints? Choose two.
A) The ability to define boundaries within which the data must reside.
B) The ability to use looping structures.
C) The ability to reference data in other databases.
D) The ability to check data before it is logged.
Which of the following is a good reason to use transactional replication?
A) It provides an up-to-the-second backup in case one of the sites in the replication model goes down.
B) It provides a method for using a lot of resources on several servers in order to provide
up-to-the-second reporting capabilities.
C) It provides the lowest-overhead replication of any other type.
D) It is veryQuestion tolerant of network outages.
When creating a table that contains a birth date for a person, you want to ensure that a valid date is always entered. Which of the following is the best way to accomplish this?
A) Adding a CHECK constraint to the column
B) Adding a trigger to the table that will validate the column
C) Using a DateTime data type for the column.
D) Using a NOT NULL constraint on the column
Which of the following EXEC statements are valid? Choose all that apply.
A) exec ReturnValue = MyProc 5, 4, ‘hello’, @A OUTPUT
B) exec @ReturnValue = MyProc @length = 5, 4, ‘Hello’, @A OUTPUT
C) exec @ReturnValue = MyProc 5, 4, ‘Hello’, @A OUTPUT
D) exec @ReturnValue = MyProc @length = 5, @width = 4, @message = ‘Hello’, @A = @A OUTPUT
What tool included with SQL Server is primarily used for writing and executing ad-hoc queries?
A) SQL Server Enterprise Manager
B) SQL Server Profiler
C) SQL Server Query Analyzer
D) SQL Server Index Wizard
What are the three join operations SQL Server supports? Choose all that apply.
A) Nested loops
B) Merge join
C) Index spool
D) Hash match
The graphical execution plan presented by SQL Server Query Analyzer uses different icons to represent which of the following?
A) Physical operators
B) Logical Operators
C) T-SQL commands
D) Process flow
Phil has created a new database that takes advantage of multiple physical disks on his server. He has created his primary data file on one disk and placed a secondary data file on a separate physical disk. The transaction log exists on the same physical disk as the primary file. Phil’s plan is to put all user objects on the secondary data file and leave the system tables on the primary data file. After creating all his objects, however, he quickly discovers that they ended up on the primary file group. What might he have done wrong?
A) All objects are created on the primary data file until there is no more room.
Only after the primary data file is full will objects be created on the secondary data file.
B) He probably forgot to create the secondary data file as part of a separate file group.
Objects are created on file groups rather than on data files.
C) He probably forgot to declare the secondary data file as the default data file.
Objects are created on the default data file unless another data file is specified.
D) Nothing is actually wrong. SQL Server automatically assigns the secondary data file as the primary file group so that all user defined objects will be created separately from the
primary data file.
Which of the following best describes a situation in which the statistics for a table would be misleading?
A) Random rows in the table have been deleted.
B) Deleting all of the records of a specific gender.
C) Dropping Foreign Key constraints on the table
D) Dropping indexes on a table
Which of the following are results of specifying schema binding on a view?
Choose all that apply.
A) The view created with schema binding cannot be dropped.
B) The CREATE statement for the view must contain a two-part name for all objects referenced.
C) When created with schema binding, the CREATE statement is stored in an encrypted manner and cannot be scripted out.
D) Objects referenced by the view cannot be dropped or changed while the view is schema bound.
George needs to write a view that can return one or more customers from a table given a last name or part of a last name. Which of the following strategies will allow him to do that?
A) Write a view for every single last name that can be entered.
B) Write an application that automatically creates a new view for each last name in the database.
C) Pass a lastname parameter into the view.
D) Write a SELECT statement that references the view. Use the WHERE clause in the SELECT statement to filter the data.
Which of the following are parts of a SELECT statement? Choose all that apply.
A) FROM
B) SORT BY
C) WHERE
D) SELECT
Which of the following features are new to SQL Server 2000? Choose all that apply.
A) Full Text Searching
B) Indexed views
C) Cascading Referential Integrity Constraints
D) Remote administration of servers
When is it important to use the WITH RECOMPILE option when creating a stored procedure?
A) Always use WITH RECOMPILE.
B) On servers that aren’t busy, WITH RECOMPILE should be used all the time.
C) Only if the query plans used by the stored procedure change frequently.
D) When any tables that are going to be used by the stored procedure are routinely dropped and re-created.
Given the following partial function definition, which SET statement shown below would correctly accept the returned value? create function Area (l1 int, l2 int) returns int
A) set @A = dbo.area(5, 4)
B) set @A = area(5,4)
C) exec area(5, 4, @A OUTPUT)
D) set @A = dbo.@Area(5, 4)
Consider the following table and trigger definitions:
Table1: UserID int IDENTITY FirstName char(50) LastName char(50) DepartmentID int BillingID int CREATE TRIGGER Table1_InsertUpdate ON Table1 FOR INSERT, UPDATE AS BEGIN IF UPDATE(DepartmentID) IF (Select count(*) from Table1 inner join Deleted on Table1.DepartmentID = deleted.departmentid) = 0 BEGIN RAISERROR (’Cannot remove the last member from a department.’, 16, 1) ROLLBACK END END.What does the RAISERROR statement in the trigger do?
A) It provides the connection with an error message.
B) It provides the connection and the SQL Server error log with an error message.
C) It provides the connection, the SQL Server error log file, and the Windows NT application event log with an error message.
D) It causes a server-wise severity one message, stopping SQL Server.
Diane needs to enforce referential integrity on one of her tables. The data in one of the columns should contain key values from a table residing in a database on the corporate server, as opposed to her departmental server where her application database resides. She decides to use constraints to enforce data integrity. How would you rate this solution?
A) This is an optimal solution. Using constraints to validate data entry is the best way to verify referential integrity.
B) This is a fair solution. Although using constraints will work, it would be better to use triggers to accomplish this goal.
C) This is a poor solution. It won’t perform well, but it will work.
D) This solution won’t work.
Choose the statement that best describes a composite index.
A) It physically sorts the rows in a table.
B) It contains multiple keys.
C) It logically sorts the rows in a table in both ascending and descending order.
D) It contains multiple columns in its key.
You need to install SQL Server Developer Edition on a spare machine to deliver to a new developer in your company so he can study for his certification exam. Of the following machines that can be spared, what is the least powerful machine you can use for this purpose?
A) Pentium 266MHz, 32MB memory
B) Pentium 266MHz, 64MB memory
C) Pentium 166MHz, 64MB memory
D) Pentium 90MHz, 32MB Memory
Which of the following types of columns would be good candidates for an index? Choose all that apply.
A) Columns that make up the Primary Key
B) Columns that contain Foreign Keys
C) Columns that contain data such as gender for a large population.
D) Columns that contain data such as a tax ID or address for a large population
What is the maximum number of rows that a table can store in SQL Server 2000?
A) 255
B) 1,048,516
C) 2,147,483,647
D) No limit besides physical storage size
An UPDATE trigger typically accesses which of the following?
A) The updated table
B) The inserted table only
C) The INSERTED and DELETED tables
D) The DELETED table only
Which of the following commands can best assist in diagnosing locking problems?
A) sp_lock
B) sp_who
C) DBCC SHOWLOCKS
D) SET SHOWLOCKS
Which of the following commands can be used to interrupt processing of a While loop?
A) BREAK
B) HALT
C) EXIT
D) CONTINUE
Choose all the statements that you could use in the WHERE clause to find only the rows where the first name is Bobby or Bobbi. Choose all that apply.
A) WHERE name = ‘Bobby’ or name = ‘Bobbi’
B) WHERE name LIKE ‘Bobb_’
C) WHERE name LIKE ‘Bobb%’
D) WHERE name LIKE ‘Bobb[iy]’
What are the space requirements for views?
A) Views require as much space as all the tables they are created from.
B) Views require as much space as would a table that presented the same data.
C) Views do not store data and therefore use no space.
D) Views require the space used to store a few records in various system tables.
You have written a stored procedure that takes several parameters and uses them to issue appropriate queries to the database. Most of the parameters are optional, and if all are passed the resulting query you have to run can be quite complex. There is a great deal of conditional logic in the procedure based on the parameters passed. When testing this procedure you found
that when you first created it, it worked great even though you started with a rather complicated set of parameters. Since then performance has been disappointing. Every time you re-create it,it works fast once, but rarely shows such speed on later calls. What is the most likely cause of the problem?
A) You have specified the With Encryption option, which is causing additional overhead because the procedure has to be decrypted each time it is run.
B) You have specified the With Recompile option, which is causing additional overhead because the procedure has to recompile a new query plan every time.
C) You have forgotten to specify the With Recompile option, which is causing an inappropriate query plan to be used with subsequent runs.
D) Your stored procedure cannot be helped. Stored procedures weren’t intended to handle complex conditional logic.
How does a TRUNCATE TABLE statement differ from an unrestricted DELETE? Select all that apply.
A) A TRUNCATE TABLE cannot be rolled back, even if it occurs within a transaction.
B) An unrestricted DELETE resets an Identity column to its original seed, whereas the TRUNCATE TABLE does not.
C) If the table is referenced by a FOREIGN KEY constraint, only the DELETE may be used.
D) The TRUNCATE TABLE causes a DELETE trigger to be fired, whereas the DELETE does not.
What is a valid GROUP BY clause for the following SELECT list? SELECT Pub_ID, Type, Max(Price)
A) GROUP BY Pub_ID, Type, Max(Price)
B) GROUP BY Pub_ID, Type, Price
C) GROUP BY Pub_ID, Type
D) GROUP BY max(Price)
Jesse’s company has a central office and three remote locations. Each remote location has three to five employees that run an order-taking application; they don’t generate any reports or need any additional data beyond their order-taking application. Each site has a modest but
reliable network connection to the central office. Which of the following is the best way for Jesse to provide these users with access to the database?
A) Set up snapshot replication to each remote site.
B) Use transactional replication to replicate data to the remote site.
C) Use merge replication to replicate data to the remote site.
D) Don’t use replication; just connect the users directly to the remote database.
Eric needs to build a stored procedure to count the number of snack food vendors within his zip code. Which of the following strategies would be the easiest to implement for passing and returning values?
A) Pass the zip code in as a parameter; pass the number of vendors out as a return value.
B) Pass the zip code in as a parameter; pass the number of vendors out as an output parameter.
C) Use the stored procedure to call a scalar-valued user-defined function.
D) Pass the zip code in as a parameter; pass the output back in a temporary table.
Carol wants to distribute the Personnel table, but needs to leave out a couple of columns from the replication, such as the AnnualSalary column. What’s the best way to do this?
A) Implement horizontal partitioning.
B) Use SQL Server security to keep people out of that column.
C) Use vertical partitioning to turn off replication for that article.
D) Use union partitioning.
Which of the following are good uses for the I-SQL utility? Choose 2.
A) Execution of Data Definition Language statements
B) Monitor queries issued by one or more users
C) Examine a graphical query plan
D) Schedule execution of a T-SQL script
What role do CHECK constraints play in partitioned views?
A) CHECK constraints are required to ensure that an inserted row goes to the correct table.
B) CHECK constraints are not required but can increase performance for inserts to the partitioned view.
C) CHECK constraints serve no purpose for partitioned views.
D) CHECK constraints could conflict with the definition of the partitioned view and therefore cannot exist on the tables that make up a partitioned view.
Which of the following options will create a composite unique index on the CustomerID and ProjectID fields in the CP table?
A) create unique composite index CPidx on CP(CustomerID, ProjectID)
B) create unique index CPidx on CP.CustomerID, CP.ProjectID
C) create unique index CPidx on CP(CustomerID, ProjectID)
D) create clustered index CPidx on CP(CustomerID, ProjectID)
Sam needs to set up her stored procedure so that when invalid data values are passed into the stored procedure, the stored procedure will cause the application to see an error and have SQL Server log an event into the error log. Which of the following will allow this to happen?
A) ON ERROR RESUME NEXT
B) RAISERROR ‘Invalid data’, 50000, 1, LOG
C) RAISERROR (’Invalid Data’, 50000, 1) WITH LOG
D) RAISERROR(’Invalid Data’, 50000, 1)
Roger wants to create an index on a read-only table. What is the best option
he should use when creating the index?
A) FILLFACTOR = 100
B) FILLFACTOR = 0
C) PAD_INDEX, FILLFACTOR = 100
D) PAD_INDEX, FILLFACTOR = 0
When using BCP to transfer data out of a table, which of the following statements apply? Choose 3.
A) Database users will not be able to access the table because BCP will lock it.
B) You must have SELECT permissions on the table.
C) Data changes made by other users during the BCP will not be reflected in the data file.
D) The contents of the data file are replaced if the data file already exists.
Insensitive cursors provider what functionality?
A) They enable users to see data inserted since the time the cursor was opened.
B) They allow faster updates because the data for the cursor is stored in tempdb.
C) They cannot be scrolled backward because the data is discarded from the temporary storage after it is fetched.
D) They ensure an unchanging view of the data as it was when the cursor was opened.
What is the lifetime of a user-defined variable?
A) Duration of the script
B) Duration of the statement block
C) Duration of the batch
D) Duration of the current SQL Server connection
To use full-text searching and find all rows containing forms of the verb “swim,” you should use which CONTAINS predicate?
A) CONTAINS(columname, FORMSOF(INFLECTIONAL, ‘Swim’))
B) CONTAINS(columnname, ’swim’, ’swims’)
C) CONTAINS(columnname, FINDALL(”Swims”))
D) CONTAINS(columnname, ’swim*’)
Which of the following will help reduce deadlocks in your database?
A) Keeping the transaction isolation level as high as possible without hurting user concurrency
B) Always accessing tables in the same order in all programs
C) Never completing transactions until a user can confirm that the changes are correct
D) Always checking the state of @@TRANCOUNT before issuing a ROLLBACK command
Sarah needs to figure out how to replicate data from all of her warehouses back to the corporate office. She wants to store all the inventory information in one table, and all of the information needs to be accessible to all of the warehouses and the corporate office, and the information should be updateable at any location. The warehouses do not have reliable
network connections back to the corporate office. Which type of replication should Sarah use?
A) Snapshot replication
B) Merge replication
C) Transactional replication
D) Snapshot replication with Updating Subscribers
When creating a database with the CREATE DATABASE command, in what units can the file size be specified? Choose all that apply.
A) MB (Megabytes)
B) Number of pages
C) Number of extents
D) KB (Kilobytes)
Eddie needs to have a database that is replicated to other locations. They have highly redundant network connectivity to all of the other locations, and a very large central server. Changes to the database need to be made at every site, and need to be done instantaneously at every site, with no delay. Which type of replication would work best for Eddie?
A) Merge replication
B) Transactional replication
C) Snapshot replication
D) Snapshot replication with updates
Which of the following are aggregate functions? Choose 3.
A) Sum
B) ABS
C) Max
D) Count
Barney wrote this stored procedure to manage inserts to his Sales table: CREATE PROCEDURE InsertSale @SalesPersonID int, @ProductID int, @Quantity int, @CustomerID int AS If @Quantity > 0 Insert Sales (SalesPersonID, ProductID, Quantity, CustomerID) VALUES
(@SalesPersonID, @ProductID, @Quantity, @CustomerID) else RAISERROR
(’Unable to enter negative or 0 quantity into Sales table.’, 16, 1) GO
If there are no constraints on the table, how can Barney make sure that the value of @SalesPersonID is valid?
A) Check the Sales table and see whether there are any other rows in that table for that SalesPersonID.
B) Check the table in which SalesPersonID is a Primary Key to ensure that the value is valid.
C) Attempt the insert and check to see whether the foreign key constraint causes an error.
D) It’s not possible to access more than one table in a stored procedure.
Which queries will return all the names in the Authors table sorted by first name, then last? Choose 2.
A) SELECT au_fname, au_lname FROM Authors SORT BY 1, 2
B) SELECT au_fname, au_lname FROM Authors ORDER BY au_fname, au_lname
C) SELECT au_fname, au_lname FROM Authors SORT BY au_fname, au_lname
D) SELECT au_fname, au_lname FROM Authors ORDER BY 1, 2
When using an INSERT statement, data to be inserted may come from which of the following? Select all that apply.
A) The VALUES clause
B) A stored procedure
C) Another database
D) A SELECT statement
Which of the following are reasons to choose SQL Server 2000? Choose all that apply.
A) Internet integration
B) Scalability and availability
C) Enterprise-Level Database features
D) Data warehousing
You were recently hired to oversee the installation of SQL Server to support a new accounting package for a small business. The company is cost-conscious, so you need to make a conservative recommendation about where to install SQL Server in the company’s existing structure. Which of the following makes the best choice to support SQL Server?
A) Dual-processor machine with 512MB memory currently acting as an Exchange server
B) A single-processor 800MHz Pentium with 256MB memory currently acting as a Primary Domain Controller.
C) A spare Pentium 90MHz laptop with 128MB of memory
D) Pentium 1GHz machine with 512MB memory recently purchased to replace the president’s workstation
How is a NOT NULL column added to an existing table?
A) By using the ALTER TABLE statement.
B) Dropping and recreating the table.
C) By using ALTER TABLE to add a nullable column, and then using sp_changenull to change the column’s NULL option.
D) By using the sp_addnullablecolumn system stored procedure.
Omitting the WHERE clause of an UPDATE or DELETE statement has what effect?
A) All rows in the specified table are affected.
B) The query returns an error because the WHERE clause is required.
C) Only the current row is affected.
D) Only the rows with the correct data type are affected.
What statement could you use in the WHERE clause to select all the rows in a table where no price is defined?
A) WHERE price IS NOT NULL
B) WHERE price IS < 0
C) WHERE price != 0
D) WHERE price IS NULL
Consider the following table and trigger definitions: Table1: UserID int IDENTITY FirstName char(50) LastName char(50) DepartmentID int BillingID int CREATE TRIGGER Table1_InsertUpdate ON Table1 FOR INSERT, UPDATE AS BEGIN IF UPDATE(DepartmentID) IF (Select count(*) from Table1 inner join Deleted on Table1.DepartmentID = deleted.departmentid) = 0 BEGIN RAISERROR (’Cannot remove the last member from a department.’, 16, 1) ROLLBACK END END Assuming that this is the only trigger bound to the table, is it possible for the last member of a department to be deleted?
A) No; the trigger prevents that from happening.
B) Yes; the trigger has not been activated yet.
C) Yes, if a new record is inserted on top of the existing one.
D) Yes, by using the DELETE command.
Referential integrity refers to what?
A) The enforced uniqueness of a row in a table
B) The enforced uniqueness of a column in a table
C) Ensuring that a Foreign Key attribute cannot be NULL
D) The enforced synchronization of Primary Key and Foreign Key values
Barney wrote this stored procedure to manage inserts to his Sales table:
CREATE PROCEDURE InsertSale @SalesPersonID int, @ProductID int, @Quantity int, @CustomerID int AS If @Quantity > 0 Insert Sales (SalesPersonID, ProductID, Quantity, CustomerID) VALUES (@SalesPersonID, @ProductID, @Quantity, @CustomerID) else RAISERROR
(’Unable to enter negative or 0 quantity into Sales table.’, 16, 1) GO What does the RAISERROR statement do?
A) The RAISERROR will cause the row to not be inserted into the database.
B) It provides feedback to the calling application so it can diagnose why the insert failed.
C) It will cause SQL Server to shut down because a severity 1 error occurred.
D) It will do nothing.
SQL Sever maintains what types of information about a column in the table definition?
A) Name, NULL option, and constraints
B) Name, data type, and NULL option
C) Name, data type, NULL option, and bytes of overhead.
D) Name, data type, NULL option, and constraint information
DTS Package Designer tasks can be set to run in what ways? Choose all that apply.
A) On completion
B) On failure
C) On error
D) On success
No comments:
Post a Comment