Friday, June 17, 2011

Questions to ask during HR interview

Usually by the end of the interview the HR person would ask you whether you have any questions. Under the stress of the job interview sometimes nothing comes to mind, but here’s a list of useful questions to ask.
  1. Why do you enjoy working for this company?
  2. What attracted you to this organization?
  3. Can you describe the work environment here?
  4. How do you describe the philosophy of the company or organization?
  5. What do you consider to be the organization’s strengths and weaknesses?
  6. Can you tell me more about my day-to-day responsibilities?
  7. How soon are you looking to fill this position?
  8. How do my skills compare with those of the other candidates you have interviewed?
  9. I have really enjoyed meeting with you and your team, and I am very interested in the opportunity. I feel my skills and experience would be a good match for this position. What is the next step in your interview process?
  10. Before I leave, is there anything else you need to know concerning my ability to do this job?
  11. In your opinion, what is the most important contribution that this company expects from its employees?
  12. Is there a structured career path at the company?
  13. What are my prospects for advancement? If I do a good job, what is a logical next step?
  14. Assuming I was hired and performed well for a period of time, what additional opportunities might this job lead to?
  15. Do the most successful people in the company tend to come from one area of the company, such as sales or engineering, or do they rise from a cross section of functional areas?
  16. I know that for the position for which I am interviewing, the company decided to recruit from outside the organization. How do you decide between recruiting from within and going outside?
  17. How does this position relate to the bottom line?
  18. What advice would you give to someone in my position?
  19. What major problems are we facing right now in this department or position?
  20. Can you give me a formal, written description of the position? I’m interested in reviewing in detail the major activities involved and what results are expected.
  21. Does this job usually lead to other positions in the company? Which ones?
  22. Can you please tell me a little bit about the people with whom I’ll be working most closely?
  23. As I understand the position, the title as ________, the duties are _______, and the department is called ________. I would report directly to __________. Is that right?
  24. Can you talk about the company’s commitment to equal opportunity and diversity?
  25. Who are the company’s stars, and how was their status determined?
  26. How are executives addressed by their subordinates?
  27. What can you tell me about the prevailing management style?
  28. If you hired me, what would be my first assignment?
  29. Does the company have a mission statement? May I see it? Does the company have a mission statement? May I see it?

.NET interview questions at Wipro

A reader recently interviewed for C# position at Wipro and sent the following questions:
  1. Difference between directcast and ctype.
  2. An example of a ctype and directcast.
  3. ctype(123.34,integer) - should it throw an error? Why or why not?
  4. directcast(123.34,integer) - should it throw an error? Why or why not?
  5. Difference between a sub and a function.
  6. Explain manifest & metadata.
  7. Scope of public/private/friend/protected/protected friend.
  8. Different kinds of methods.
  9. Difference between imperative and interrogative code.
  10. Difference between value and reference type.
  11. What are the two kinds of properties.
  12. What is the raise event used for?
  13. Explain constructor.
  14. What is a resource? Provide an example from your recent project.
  15. What is a system lock?
  16. Describe ways of cleaning up objects.
  17. Where does the dispose method lie and how can it be used to clean up resources?
  18. How can you clean up objects holding resources from within the code?

Questions to ask your future boss and colleagues

Some job interviews result in meeting the group manager and team that you’ll be working for. Here’s a useful collection of questions to ask.
  1. Could you explain the company’s organizational structure?
  2. What is the organization’s plan for the next five years, and how does this department or division fit in?
  3. What specific skills from the person you hire would make your life easier?
  4. Will we be expanding or bringing on new products or new services that I should be aware of?
  5. What are some of the problems that keep you up at night?
  6. What are some of the skills and abilities you see as necessary for someone to succeed in this job?
  7. What would be a surprising but positive thing the new person could do in first 90 days?
  8. What challenges might I encounter if I take on this position?
  9. How does upper management perceive this part of the organization?
  10. What are your major concerns that need to be immediately addressed in this job?
  11. What do you see as the most important opportunities for improvement in the area I hope to join?
  12. What are the attributes of the job that you’d like to see improved?
  13. What are the organization’s three most important goals?
  14. What is your company’s policy on attending seminars, workshops, and other training opportunities?
  15. How do you see this position impacting the achievement of those goals?
  16. What is the budget this department operates with?
  17. What attracted you to working for this organization?
  18. What committees and task forces will I be expected to participate in?
  19. What have you liked most about working here?
  20. How will my leadership responsibilities and performance be measured? By whom?
  21. What are the day-to-day responsibilities I’ll be assigned?
  22. Are there any weaknesses in the department that you are particularly looking to improve?
  23. What are the department’s goals, and how do they align with the company’s mission?
  24. What are the company’s strengths and weaknesses compared with the competition? (name one or two companies)
  25. How does the reporting structure work here? What are the preferred means of communication?
  26. What goals or objectives need to be achieved in the next six months?
  27. Can you give me an ideal of the typical day and workload and the special demands the job has?
  28. This a new position. What are the forces that suggested the need for this position?
  29. What areas of the job would you like to see improvement in with regard to the person who was most recently performing these duties?
  30. 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?
  31. How does this position contribute to the company’s goals, productivity, or profits?
  32. What is currently the most pressing business issue or problem for the company or department?
  33. Would you describe for me the actions of a person who previously achieved success in this position?
  34. Would you describe for me the action of a person who previously performed poorly in this position?
  35. How would you describe your own management style?
  36. What are the most important traits you look for in a subordinate?
  37. How do you like your subordinates to communicate with you?
  38. What personal qualities or characteristics do you most value?
  39. Could you describe to me your typical management style and the type of employee who works well with you?
  40. 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?
  41. How would you characterize the organization? What are its principal values? What are its greatest challenges?
  42. How would you describe the experience of working here?
  43. If I were to be employed here, what one piece of wisdom would you want me to incorporate into my work life?
  44. What are a couple of misconceptions people have about the company?
  45. Work-life balance is an issue of retention as well as productivity.
  46. Can you talk about your own view of how to navigate the tensions between getting work done and encouraging healthy lives outside the office?
  47. How does the company support and promote personal and professional growth?
  48. What types of people seem to excel here?
  49. 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?
  50. What have I yet to learn about this company and opportunity that I still need to know?
  51. 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?
  52. What are the organization’s primary financial objectives and performance measures?
  53. What operating guidelines or metrics are used to monitor the planning process and the results?
  54. To what extent are those objectives uniform across all product lines?
  55. How does the company balance short-term performance versus long-term success?
  56. What kinds of formal strategic planning systems, if any, are in place?
  57. Can you describe the nature of the planning process and how decisions concerning the budgeting process are made?
  58. Can you identify the key corporate participants in the planning process?
  59. How often and in what form does the company report its results internally to its employees?
  60. In the recent past, how has the company acknowledged and rewarded outstanding performance?
  61. What are the repercussions of having a significant variance to the operating plan?
  62. Are budgeting decisions typically made at corporate headquarters, or are the decisions made in a more decentralized fashion?
  63. 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?
  64. 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?
  65. How does the company contribute to thought leadership in its market?
  66. How advanced is the company’s commitment to knowledge management?
  67. I was pleased to hear you describe the company’s branding strategy.
  68. How does branding fit into the overall marketing mix?
  69. How does this position contribute to the company’s goals, productivity, or profits?
  70. 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?
  71. 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?
  72. How accessible is the CEO (name him or her) to people at my level of the organization?
  73. Does the CEO (name him or her) publish his or her email address?
  74. I understand that the CEO is really approachable. Are there ground rules for approaching him or her?
  75. Staff development is mentioned in your annual report as a measure on which executives are evaluated. What kinds of training experiences might I expect?
  76. Is the department a profit center?
  77. Can you please tell me about the people who will look to me for supervision?
  78. Would I encounter any coworker or staff person who’s proved to be a problem in the past?
  79. What happened to the person who previously held this job?
  80. The incumbent was dismissed? How could the problems have been avoided?
  81. The incumbent was promoted? I’m delighted to hear it. Would it be possible for me to talk to him or her?
  82. What is the company customer-service philosophy?
  83. Could you tell me about a time when the team/company went out of its way to provide knock-your-socks-off service?
  84. The best companies rely on rich customer data to fuel personalized content and services. How is the company doing in personalizing its offerings?
  85. 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?
  86. 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?
  87. How often would I come into direct contact with real, living, breathing, paying customers?
  88. What are the success factors that will tell you if the decision to bring me on board was the right one?
  89. 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?
  90. If you and I were developing some sort of philosophical difference, how would you want to go about resolving it?

eBay interview questions and answers

A reader went through an interview at eBay and shared the questions asked.
  1. Let’s say you have 100,000 records and you want to delete 95,000 at a time and keep only 5 thousand. But in local memory you don’t have enough space for 95,000 records. What do you do in this case? How do you delete without any problem with time and performance?
  2. I need data on eBay customers in Chicago who can did bid on certain item? I dont have access to eBay database directly. How I get the information?
  3. With DTS packaging I can store tables in Excel and convert them back to SQL. But once I copied tables to Excel I want to modify some info. How you do that without editing the Excel file?
  4. What is cursor and where do you use them?

Visual Basic interview questions

  1. How do you center a form?
  2. Can I send keystrokes to a DOS application?
  3. Convert an RGB value to a long, or a long to RGB.
  4. Implement smooth scrolling for either text, graphics or controls across a form.
  5. Implement some quick and easy encryption (can be something primitive).
  6. 4 different types of sorts: advantages and disadvantages.
  7. Compute CRC32 checksum, write a quick piece of code that accepts the packet of data and returns the CRC.
  8. How do you use the Mouse OFF event?
  9. How do I call Windows Help files from a VB program?
  10. How do I create a textbox that lets you insert tabs?
  11. How do I make text box that displays asterisks when the user types in data such as password?
  12. How do I create multi-column combo box?
  13. How do I make a menu popup from a CommandButton?
  14. How to create menus at run time in VB?
  15. Write a generic error handling routine.
  16. How to copy text to the Windows clipboard and from it.
  17. How can I call a Command button without clicking it?
  18. Write a simple app with Encrypt and Decrypt buttons and Textbox where the user can enter text for encryption and decryption.
  19. 3 main differences between flexgrid control and dbgrid control
  20. ActiveX and Types of ActiveX Components in VB
  21. Advantage of ActiveX Dll over ActiveX Exe .
  22. Advantages of disconnected recordsets . Benefit of wrapping database calls into MTS transactions 6. Benefits of using 23 MTS
  23. Can database schema be changed with DAO, RDO or ADO?
  24. Can you create a tabletype of recordset in Jet-connected ODBC database engine?
  25. Constructors and destructors
  26. Controls which do not have events
  27. Default property of datacontrol
  28. Define the scope of Public, Private, Friend procedures?
  29. Describe Database Connection pooling relative to MTS
  30. Describe: In of Process vs. Out of Process component. Which is faster?
  31. Difference between a function and a subroutine, Dynaset and Snapshot, early and late binding, image and picture controls, linked object and embedded Object,listbox and combo box,Listindex and Tab index,modal and moduless window, Object and Class, query unload and unload in form, declaration and instantiation of an object?
  32. Draw and explain Sequence Model of DAO
  33. How can objects on different threads communicate with one another?
  34. How can you force new objects to be created on new threads?
  35. How does a DCOM component know where to instantiate itself?
  36. How do I register a component?
  37. How do I set a shortcut key for label?
  38. What kind of components can be used as DCOM servers?
  39. Name of the control used to call a Windows application
  40. Name the four different cursor and locking types in ADO and describe them briefly
  41. Need of zorder method, no of controls in form, Property used to add a menus at runtime, Property used to count number of items in a combobox,resize a label control according to your caption.
  42. Return value of callback function, The need of tabindex property
  43. Thread pool and management of threads within a thread pool
  44. To set the command button for ESC, Which property needs to be changed?
  45. Type Library and what is it’s purpose?
  46. Types of system controls, container objects, combo box
  47. Under the ADO Command Object, what collection is responsible for input to stored procedures?
  48. What are the ADO objects? Explain them.
  49. What are the different compatibility types when we create a COM component?
  50. What do ByVal and ByRef mean and which is the default?
  51. What does Option Explicit refer to? 36. What does the Implements statement do?
  52. What is OLE and DDE? Explain.
  53. What is the difference between Msgbox Statement and MsgboxQ function?
  54. What keyword is associated with raising system level events in VB?
  55. What methods are called from the ObjectContext object to inform MTS that the transaction was successful or unsuccessful?
  56. What types of data access have you used.
  57. What was introduced to Visual Basic to allow the use of Callback Functions?
  58. Which controls can not be placed in MDI?
  59. Which controls have refresh method, clear method
  60. Which Property is used to compress a image in image control?
  61. Which property of menu cannot be set at run time?
  62. Which property of textbox cannot be changed at runtime?
  63. What is the maximum size of a textbox?
  64. Which tool is used to configure the port range and protocols for DCOM communications?

Good questions to ask during management interview

  1. Could you please describe the management team to me?
  2. Does the company have a Net-use policy?
  3. Will I receive my assignments from IT or from the business unit?
  4. Do developers have little contact with the business unit or significant contact?
  5. Can you show or sketch me an organizational chart?
  6. If for any reason you were unable to function as CEO, how would you like to see the company managed?
  7. To whom does the chief information or technology officer report?
  8. 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?
  9. What are you hoping to accomplish, and what will be my role in those plans?
  10. May I see a job description? What are the most important responsibilities of the job?
  11. How much time should be devoted to each area of responsibility?
  12. What is my spending/budget authority?
  13. What initial projects would I be tackling?
  14. What are the biggest technical challenges ahead for this department/ company?
  15. Presuming that I’m successful on this assignment, where else might I be of service to the company?
  16. Traditionally, companies have used IT to reduce bottom-line costs. But
  17. 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?
  18. What structured strategies for software testing have you found effective here?
  19. Does the company use an IT steering committee?
  20. 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?
  21. Can you describe the performance of the sales team?
  22. What is the commission structure, and what is my earning potential in 1, 3, 5, or 10 years?
  23. What percentage of salespeople attain objectives?
  24. What percentage of the current people are above and below their set goals?

WinRunner interview questions and answers

  1. Describe the process of planning a test in WinRunner?
  2. How do you record a new script? Can you e-mail a WinRunner script? How can a person run a previously saved WinRunner script?
  3. How can you synchronize WinRunner scripts?
  4. What is a GUI map? How does it work?
  5. How can you verify application behavior?
  6. Explain in detail how WinRunner checkpoints work. What are standard checkpoints?
  7. What is a data-driven test? What are the benefits of a data-driven test?
  8. How do you modify logical names on GUI map?
  9. Why would you use batch testing under WinRunner? Explain advantages and disadvantages. Give an example of one project where you used batch testing.
  10. How do you pass parameter values between the tests?
  11. Have you used WinRunner Recovery Manager?
  12. What is an exception handler? Wny would you define one in WinRunner?
  13. We’re testing an application that returns a graphical object (i.e., a map) as a result of the user query. Explain how you’d teach WinRunner to recognize and analyze the returned object.
  14. What is a TSL? Write a simple script in TSL.

Questions to ask HR between the interviews

  1. How do you like me so far?
  2. Do you have any concerns about my ability to do the job and fit in?
  3. Is there anything standing in the way of us coming to an agreement?
  4. Do you have any concerns about my experience, education, skills?
  5. How do I compare with the other candidates you have interviewed?
  6. Describe your ideal candidate. What do my qualifications lack compared to those of the theoretical ideal candidate?
  7. I’m ready to make a decision based on the information I have. Is there anything else I can elaborate on so that you would have a better understanding of my qualifications and suitability for this position?
  8. Are there any areas in which you feel I fall short of your requirements?
  9. Can you give me any feedback that would make me more attractive to the company in the future or that I could benefit from next time?
  10. Is there anything else you need from me to have a complete picture of my qualifications?
  11. Is there anything personally or professionally that you believe would prevent my being a solid contributor in this role?
  12. Your search is over. You will not find anyone else more qualified to do this job than I. If I were you, I’d cancel all the other interviews and make me an offer.
  13. I’m not going to keep it a secret. I really want this job, and I know I will be fantastic in it.
  14. Until I hear from you again, what particular aspects of the job and this interview should I be considering?
  15. I know I can meet the demands of the position and would make an outstanding contribution. Can I have the offer?
  16. What will be your recommendation to the hiring committee?
  17. I’m ready to make a decision based on the information I have. Is there anything else you need to make me an offer?
  18. I am very interested in this job, and I know your endorsement is key to my receiving an offer. May I have your endorsement?
  19. It sounds to me as if we have a great fit here. What do you think?
  20. It has been an interesting and fruitful discussion. l would very much like to take it to the next step.

ASP.NET interview questions and answers

  1. Describe the difference between a Thread and a Process?
  2. What is a Windows Service and how does its lifecycle differ from a “standard” EXE?
  3. What is the maximum amount of memory any single process on Windows can address? Is this different than the maximum virtual memory for the system? How would this affect a system design?
  4. What is the difference between an EXE and a DLL?
  5. What is strong-typing versus weak-typing? Which is preferred? Why?
  6. What’s wrong with a line like this? DateTime.Parse(myString
  7. What are PDBs? Where must they be located for debugging to work?
  8. What is cyclomatic complexity and why is it important?
  9. Write a standard lock() plus double check to create a critical section around a variable access.
  10. What is FullTrust? Do GAC’ed assemblies have FullTrust?
  11. What benefit does your code receive if you decorate it with attributes demanding specific Security permissions?
  12. What does this do? gacutil /l | find /i “about”
  13. What does this do? sn -t foo.dll
  14. What ports must be open for DCOM over a firewall? What is the purpose of Port 135?
  15. Contrast OOP and SOA. What are tenets of each
  16. How does the XmlSerializer work? What ACL permissions does a process using it require?
  17. Why is catch(Exception) almost always a bad idea?
  18. What is the difference between Debug.Write and Trace.Write? When should each be used?
  19. What is the difference between a Debug and Release build? Is there a significant speed difference? Why or why not?
  20. Does JITting occur per-assembly or per-method? How does this affect the working set?
  21. Contrast the use of an abstract base class against an interface?
  22. What is the difference between a.Equals(b) and a == b?
  23. In the context of a comparison, what is object identity versus object equivalence?
  24. How would one do a deep copy in .NET?
  25. Explain current thinking around IClonable.
  26. What is boxing?
  27. Is string a value type or a reference type?
Visit Scott Hanselman’s blog for more ASP.NET interview questions he asks.

C and C++ questions for the interview

  1. What is the output of printf(”%d”)
  2. What will happen if I say delete this
  3. Difference between “C structure” and “C++ structure”.
  4. Diffrence between a “assignment operator” and a “copy constructor”
  5. What is the difference between “overloading” and “overridding”?
  6. Explain the need for “Virtual Destructor”.
  7. Can we have “Virtual Constructors”?
  8. What are the different types of polymorphism?
  9. What are Virtual Functions? How to implement virtual functions in “C”
  10. What are the different types of Storage classes?
  11. What is Namespace?
  12. What are the types of STL containers?.
  13. Difference between “vector” and “array”?
  14. How to write a program such that it will delete itself after exectution?
  15. Can we generate a C++ source code from the binary file?
  16. What are inline functions?
  17. What is “strstream” ?
  18. Explain “passing by value”, “passing by pointer” and “passing by reference”
  19. Have you heard of “mutable” keyword?
  20. What is a “RTTI”?
  21. Is there something that I can do in C and not in C++?
  22. What is the difference between “calloc” and “malloc”?
  23. What will happen if I allocate memory using “new” and free it using “free” or allocate sing “calloc” and free it using “delete”?
  24. Difference between “printf” and “sprintf”.
  25. What is “map” in STL?
  26. When shall I use Multiple Inheritance?
  27. Explain working of printf.
  28. Talk sometiming about profiling?
  29. How many lines of code you have written for a single program?
  30. How to write Multithreaded applications using C++?
  31. Write any small program that will compile in “C” but not in “C++”
  32. What is Memory Alignment?
  33. Why preincrement operator is faster than postincrement?
  34. What are the techniques you use for debugging?
  35. How to reduce a final size of executable?
  36. Give 2 examples of a code optimization.

Some PC and networking questions


  1. Workers can not print from the printer, there user log on are correct and are allowed to print from that printer in active directory. How would you resolve this issue?
  2. What is the difference between hub and switch?
  3. Your hard drive is partitioned as follows: 8 gigs for OS drive C, 8 gigs for Hot Swappable dirve D and rest is free as dirve E. Your drive C crashes, how would you reboot your system without installing a new operating system?
  4. Your computer gives you “non-disk error” before you log on what would you do to make your computer work?

Network developer interview questions

  1. How does TCP handshake work?
  2. How does SSL handshake work?
  3. What is the difference between passive FTP and active FTP?
  4. What is the difference between socket and session?
  5. How does network management station work?
  6. What are the different phases in VPN establishment?
  7. How does DH (deffie helman) work?
  8. What is TCP window sizing?
  9. What is MTU?

Newbie Java questions


  1. If Runnable interface is better than Thread class, than why we are using Thread class? What is the need for Thread class?
  2. Why we are calling System.gc() method to garbage collection of unused object, if garbage collection is automatically done in Java by daemon thread in background process with regular interval?
  3. What is the significance of Marker interface? Why are we using, even though it has no method?
  4. Why we are always doing rs.next() in first line of while loop in retrieving data from database through result set?
  5. Please give me the details of synchronization? And which are the methods and elements used in it and why only that methods and variables?
  6. Why we are not using Java in real time based application, but instead we are using C or C++?
  7. Detail difference between 4 types of driver and their use in different different applications?
  8. Is Java code with native methods platform-independent?
  9. Why is the compiler platform-independent, while JVM is platform-dependent?\
  10. Mention different type of compilers and interpreters in Java?

General Java Servlet questions

  1. What is the servlet?
  2. What are the JSP atrributes?
  3. What is the need of super.init(config) in servlets?
  4. How to know whether we have to use jsp or servlet in our project?
  5. Can we call destroy() method on servlets from service method?
  6. What is the Servlet Interface?
  7. What is the difference between GenericServlet and HttpServlet?
  8. How we can check in particular page the session will be alive or not?
  9. What is the importance of deployment descriptor in servlet?
  10. When we increase the buffer size in our project using page directive attribute ‘buffer’ what changes we observe?
  11. What is the difference between ServetConfig and ServletContext..?
  12. When a servlet accepts a call from a client, it receives two objects. What are they?
  13. What are the differences between GET and POST service methods?
  14. In which conditions we have to use the ServletContext?
  15. What methods will be called in which order?((i.e)service(),doget(),dopost())
  16. Servlet is Java class. Then why there is no constructor in Servlet? Can we write the constructor in Servlet
  17. What is the use of ServletConfig and ServletContext..?
  18. What information that the ServletRequest interface allows the servlet access to?
  19. What is the difference between ServletContext and ServletConfig?
  20. When do you have action=get?
  21. What is a Singleton class. How do you write it?
  22. What is difference between sendRedirect() and forward()..? Which one is faster then other and which works on server?
  23. What information that the ServletResponse interface gives the servlet methods for replying to the client?
  24. Can I invoke a JSP error page from a servlet?
  25. Can a init(ServletConfig config) method be overrided in servlets?
  26. How many ServletConfig and servlet context objects are present in one application?
  27. Do we have a constructor in servlet? can we explictly provide a constructor in servlet programme as in java program?
  28. What are the uses of Servlets?
  29. Can I just abort processing a JSP?
  30. Is servlet is used to create a dynamic webpage or Static webpage or both?
  31. If you want a servlet to take the same action for both GET and POST request, what should you do?
  32. What is the difference between JSP and SERVLETS?
  33. What are the advantages using servlets than using CGI?
  34. What is a better approach for enabling thread-safe servlets and JSPs? SingleThreadModel Interface or synchronization?
  35. We have two applications in that we have two servlets each.How they(servlets) communicate with each other?
  36. How the server will know (i.e) when it can invoke init, service,destroy methods of servlet life cycle?
  37. How to communicate between two servlets?
  38. What is the difference between servlets and applets?
  39. How will u pass the argument from one servlet to another servlet?
  40. What method used to add a jsp to the servlet?
  41. How HTTP Servlet handles client requests?
  42. How to get one Servlet’s Context Information in another Servlet?
  43. Difference between single thread and multi thread model servlet
  44. What is the super class of All servlets?
  45. How are Servlet Applet communication achieved?
  46. What is servlet context and what it takes actually as parameters?
  47. What is the servlet life cycle?
  48. Types of Servlets?
  49. Why is that we deploy servlets in a webserver.What exactly is a webserver?
  50. Which code line must be set before any of the lines that use the PrintWriter?

PHP interview questions and answers


  1. What does a special set of tags <?= and ?> do in PHP? - The output is displayed directly to the browser.
  2. What’s the difference between include and require? - It’s how they handle failures. If the file is not found by require(), it will cause a fatal error and halt the execution of the script. If the file is not found by include(), a warning will be issued, but execution will continue.
  3. I am trying to assign a variable the value of 0123, but it keeps coming up with a different number, what’s the problem? - PHP Interpreter treats numbers beginning with 0 as octal. Look at the similar PHP interview questions for more numeric problems.
  4. Would I use print "$a dollars" or "{$a} dollars" to print out the amount of dollars in this example? - In this example it wouldn’t matter, since the variable is all by itself, but if you were to print something like "{$a},000,000 mln dollars", then you definitely need to use the braces.
  5. How do you define a constant? - Via define() directive, like define ("MYCONSTANT", 100);
  6. How do you pass a variable by value? - Just like in C++, put an ampersand in front of it, like $a = &$b
  7. Will comparison of string "10" and integer 11 work in PHP? - Yes, internally PHP will cast everything to the integer type, so numbers 10 and 11 will be compared.
  8. When are you supposed to use endif to end the conditional statement? - When the original if was followed by : and then the code block without braces.
  9. Explain the ternary conditional operator in PHP? - Expression preceding the ? is evaluated, if it’s true, then the expression preceding the : is executed, otherwise, the expression following : is executed.
  10. How do I find out the number of parameters passed into function? - func_num_args() function returns the number of parameters passed in.
  11. If the variable $a is equal to 5 and variable $b is equal to character a, what’s the value of $$b? - 100, it’s a reference to existing variable.
  12. What’s the difference between accessing a class method via -> and via ::? - :: is allowed to access methods that can perform static operations, i.e. those, which do not require object initialization.
  13. Are objects passed by value or by reference? - Everything is passed by value.
  14. How do you call a constructor for a parent class? - parent::constructor($value)
  15. What’s the special meaning of __sleep and __wakeup? - __sleep returns the array of all the variables than need to be saved, while __wakeup retrieves them.
  16. Why doesn’t the following code print the newline properly?    <?php
                $str = ‘Hello, there.nHow are you?nThanks for visiting TechInterviews’;
                print $str;
        ?>
    Because inside the single quotes the n character is not interpreted as newline, just as a sequence of two characters - and n.
  17. Would you initialize your strings with single quotes or double quotes? - Since the data inside the single-quoted string is not parsed for variable substitution, it’s always a better idea speed-wise to initialize a string with single quotes, unless you specifically need variable substitution.
  18. How come the code <?php print "Contents: $arr[1]"; ?> works, but <?php print "Contents: $arr[1][2]"; ?> doesn’t for two-dimensional array of mine? - Any time you have an array with more than one dimension, complex parsing syntax is required. print "Contents: {$arr[1][2]}" would’ve worked.
  19. What is the difference between characters 23 and x23? - The first one is octal 23, the second is hex 23.
  20. With a heredoc syntax, do I get variable substitution inside the heredoc contents? - Yes.
  21. I want to combine two variables together:
    $var1 = 'Welcome to ';
     $var2 = 'TechInterviews.com';
    
    What will work faster? Code sample 1:
    $var 3 = $var1.$var2;
    
    Or code sample 2:

    $var3 = "$var1$var2";
    
    Both examples would provide the same result - $var3 equal to "Welcome to TechInterviews.com". However, Code Sample 1 will work significantly faster. Try it out with large sets of data (or via concatenating small sets a million times or so), and you will see that concatenation works significantly faster than variable substitution.
  22. For printing out strings, there are echo, print and printf. Explain the differences. - echo is the most primitive of them, and just outputs the contents following the construct to the screen. print is also a construct (so parentheses are optional when calling it), but it returns TRUE on successful output and FALSE if it was unable to print out the string. However, you can pass multiple parameters to echo, like:
    <?php echo 'Welcome ', 'to', ' ', 'TechInterviews!'; ?>
    and it will output the string "Welcome to TechInterviews!" print does not take multiple parameters. It is also generally argued that echo is faster, but usually the speed advantage is negligible, and might not be there for future versions of PHP. printf  is a function, not a construct, and allows such advantages as formatted output, but it’s the slowest way to print out data out of echo, print and printf.
  23. I am writing an application in PHP that outputs a printable version of driving directions. It contains some long sentences, and I am a neat freak, and would like to make sure that no line exceeds 50 characters. How do I accomplish that with PHP? - On large strings that need to be formatted according to some length specifications, use wordwrap() or chunk_split().
  24. What’s the output of the ucwords function in this example?
    $formatted = ucwords("TECHINTERVIEWS IS COLLECTION OF INTERVIEW QUESTIONS");
     print $formatted;
    What will be printed is TECHINTERVIEWS IS COLLECTION OF INTERVIEW QUESTIONS.
    ucwords() makes every first letter of every word capital, but it does not lower-case anything else. To avoid this, and get a properly formatted string, it’s worth using strtolower() first.
  25. What’s the difference between htmlentities() and htmlspecialchars()? - htmlspecialchars only takes care of <, >, single quote ‘, double quote " and ampersand. htmlentities translates all occurrences of character sequences that have different meaning in HTML.
  26. What’s the difference between md5(), crc32() and sha1() crypto on PHP? - The major difference is the length of the hash generated. CRC32 is, evidently, 32 bits, while sha1() returns a 128 bit value, and md5() returns a 160 bit value. This is important when avoiding collisions.
  27. So if md5() generates the most secure hash, why would you ever use the less secure crc32() and sha1()? - Crypto usage in PHP is simple, but that doesn’t mean it’s free. First off, depending on the data that you’re encrypting, you might have reasons to store a 32-bit value in the database instead of the 160-bit value to save on space. Second, the more secure the crypto is, the longer is the computation time to deliver the hash value. A high volume site might be significantly slowed down, if frequent md5() generation is required.

.NET interview questions - Windows Forms

Questions mainly relate to drawing and graphics programming in Windows Forms, when programming C# under .NET.

  1. I am constantly writing the drawing procedures with System.Drawing.Graphics, but having to use the try and dispose blocks is too time-consuming with Graphics objects. Can I automate this?
    Yes, the code
    System.Drawing.Graphics canvas = new System.Drawing.Graphics();
    try
    {
     //some code
    }
    finally
     canvas.Dispose();
    
    is functionally equivalent to
    using (System.Drawing.Graphics canvas = new System.Drawing.Graphics())
    {
     //some code
    } //canvas.Dispose() gets called automatically
    

  2. How do you trigger the Paint event in System.Drawing?Invalidate the current form, the OS will take care of repainting. The Update method forces the repaint.
  3. With these events, why wouldn’t Microsoft combine Invalidate and Paint, so that you wouldn’t have to tell it to repaint, and then to force it to repaint? Painting is the slowest thing the OS does, so usually telling it to repaint, but not forcing it allows for the process to take place in the background.
  4. How can you assign an RGB color to a System.Drawing.Color object? Call the static method FromArgb of this class and pass it the RGB values.
  5. What class does Icon derive from? Isn’t it just a Bitmap with a wrapper name around it? No, Icon lives in System.Drawing namespace. It’s not a Bitmap by default, and is treated separately by .NET. However, you can use ToBitmap method to get a valid Bitmap object from a valid Icon object.
  6. Before in my VB app I would just load the icons from DLL. How can I load the icons provided by .NET dynamically? By using System.Drawing.SystemIcons class, for example System.Drawing.SystemIcons.Warning produces an Icon with a warning sign in it.
  7. When displaying fonts, what’s the difference between pixels, points and ems? A pixel is the lowest-resolution dot the computer monitor supports. Its size depends on user’s settings and monitor size. A point is always 1/72 of an inch. An em is the number of pixels that it takes to display the letter M.

Mathematical puzzles for call center interviews

These questions were asked by Indian call center outsourcing company TISL. Generally the applicant for Support Technician or Call Center Operator is given the sheet with the problems below (calculators allowed) and 30 minutes to complete the written test. The answers are usually supplied in multiple-choice format, however, the format that I got had the answers filled in.
  1. A boy multiplied a number with 10 and got 100. If he divided it by 10, what would be the answer? Answer is 1
  2. If a 12 shell cupboard requires 18 ft of wall space then how much wall space would a 30 cup shelf require? Answer is 45
  3. The average salary of three employee is $950 per week. If one employee earns $1150 and other earns $650 rupees, how much will third be earn? Answer is $1050
  4. During a given week a programmer spend 1/4 of his time preparing charts,3/8 of his time for coding,rest of his time for debugging the programs.If he had 48 hrs during the week how many hours did he spend debugging the program. Answer is 18hrs
  5. A 16 story building has 12000ft on each floor. Company A rents 7 floors and company B rents 4 floors. What is the number of square feet of unrented floor space? Answer is 60000 sqft
  6. A man owns 2/3 of a computer service buroue business and sells 3/4 of his share for $75000.What is the value of the business. Answer is 150,000
  7. A computer printer produces 176400 lines in a given day. If the printer is in operation for 7 hrs during the day how many lines did it print per minute? Answer is 420
  8. From its total income a company spent $20000 for advertising, half of the remainder on bonuses and had $6000 left.What was the total income? Answer is $32000
  9. In a certain company 20% of the men and 40% of the women attended the annual company picnic.If 35% of all the employees are men .What % of all the employee went to the picnic? Answer is 33%
  10. If a card punch operator can process 80 cards in half an hour How many cards can this process in 7hr30min? Answer is 1200
  11. In a computer tape library there are two racks with 40 tapes per rack.In a given day 30 tapes are in use . What fraction remains in the rack? Answer is 5/8.

Telecommunications interview questions

A well-known telecommunications company uses this pop quiz for oral and written examinations of applicants for engineering positions.
1. A 2MB PCM(pulse code modulation) has…
a) 32 channels
b) 30 voice channels & 1 signaling channel.
c) 31 voice channels & 1 signaling channel.
d) 32 channels out of which 30 voice channels, 1 signaling channel, & 1 synchronization channel.
Ans: c

2. Time taken for 1 satellite hop in voice communication is…
a) 1/2 second
b) 1 seconds
c) 4 seconds
d) 2 seconds
Ans: (a)
3. Max number of satellite hops allowed in voice communication is:
a) only one
b) more han one
c) two hops
d) four hops
Ans: (c)
4. What is the maximal decimal number that can be accommodated in a byte?
a) 128
b) 256
c) 255
d) 512
Ans: (c)
5. Conditional results after execution of an instruction in a micro processor is stored in…
a) register
b) accumulator
c) flag register
d) flag register part of PSW(Program Status Word)
Ans: (d)
6. Frequency at which VOICE is sampled is…
a) 4 KHz
b) 8 KHz
c) 16 KHz
d) 64 KHz
Ans: (a)
7. Line of sight is…
a) Straight Line
b) Parabolic
c) Tx & Rx should be visible to each other
d) none of the above
Ans: (c)
8. Purpose of PC(Program Counter) in a MicroProcessor is…
a) To store address of TOS(Top Of Stack)
b) To store address of next instruction to be executed.
c) count the number of instructions.
d) to store base address of the stack.
Ans: (b)
9. What action is taken when the processor under execution is interrupted by a non-maskable interrupt?
a) Processor serves the interrupt request after completing the execution of the current instruction.
b) Processor serves the interrupt request after completing the current task.
c) Processor serves the interrupt request immediately.
d) Processor serving the interrupt request depends upon the priority of the current task under execution.
Ans: (a)
10. The status of the Kernel is…
a) task
b) process
c) not defined.
d) none of the above.
Ans: (b)
11. What is the nominal voltage required in subscriber loop connected to local exchange?
a) +48 volts
b) -48 volts
c) 230 volts
d) 110 volts
12. To send a data packet using datagram , connection will be established…
a) before data transmission.
b) connection is not established before data transmission.
c) no connection is required.
d) none of the above.
Ans: (c)
13. Word alignment is…
a) aligning the address to the next word boundary of the machine.
b) aligning to an even boundary.
c) aligning to a word boundary.
d) none of the above.
Ans: (a)
14. When a C function call is made, the order in which parameters passed to the function are pushed into the stack is…
a) left to right
b) right to left
c) bigger variables are moved first than the smaller variales.
d) smaller variables are moved first than the bigger ones.
e) none of the above.
Ans: (b)
15. What is the type of signaling used between two exchanges?
a) inband
b) common channel signaling
c) any of the above
d) none of the above.
Ans: (a)
16. Buffering is…
a) the process of temporarily storing the data to allow for small variation in device speeds
b) a method to reduce cross talks
c) storage of data within transmitting medium until the receiver is ready to receive.
d) a method to reduce routing overhead.
Ans: (a)
17. Memory allocation of variables declared in a program is…
a) allocated in RAM.
b) allocated in ROM.
c) allocated on stack.
d) assigned to registers.
Ans: (c)
18. A software that allows a personal computer to pretend as a computer terminal is …
a) terminal adapter
b) bulletin board
c) modem
d) terminal emulation
Ans: (d)

C++ Interview questions and answers

Some good C++ questions to ask a job applicant.
  1. How do you decide which integer type to use?
  2. What should the 64-bit integer type on new, 64-bit machines be?
  3. What’s the best way to declare and define global variables?
  4. What does extern mean in a function declaration?
  5. What’s the auto keyword good for?
  6. I can’t seem to define a linked list node which contains a pointer to itself.
  7. How do I declare an array of N pointers to functions returning pointers to functions returning pointers to characters?
  8. How can I declare a function that returns a pointer to a function of its own type?
  9. My compiler is complaining about an invalid redeclaration of a function, but I only define it once and call it once. What’s happening?
  10. What can I safely assume about the initial values of variables which are not explicitly initialized?
  11. Why can’t I initialize a local array with a string?
  12. What is the difference between char a[] = “string”; and char *p = “string”; ?
  13. How do I initialize a pointer to a function?

QTP interview questions and answers

  1. What are the Features & Benefits of Quick Test Pro (QTP 8.0)? - Operates stand-alone, or integrated into Mercury Business Process Testing and Mercury Quality Center. Introduces next-generation zero-configuration Keyword Driven testing technology in Quick Test Professional 8.0 allowing for fast test creation, easier maintenance, and more powerful data-driving capability. Identifies objects with Unique Smart Object Recognition, even if they change from build to build, enabling reliable unattended script execution. Collapses test documentation and test creation to a single step with Auto-documentation technology. Enables thorough validation of applications through a full complement of checkpoints.
  2. How to handle the exceptions using recovery scenario manager in QTP? - There are 4 trigger events during which a recovery scenario should be activated. A pop up window appears in an opened application during the test run: A property of an object changes its state or value, A step in the test does not run successfully, An open application fails during the test run, These triggers are considered as exceptions.You can instruct QTP to recover unexpected events or errors that occurred in your testing environment during test run. Recovery scenario manager provides a wizard that guides you through the defining recovery scenario. Recovery scenario has three steps: 1. Triggered Events 2. Recovery steps 3. Post Recovery Test-Run
  3. What is the use of Text output value in QTP? - Output values enable to view the values that the application talks during run time. When parameterized, the values change for each iteration. Thus by creating output values, we can capture the values that the application takes for each run and output them to the data table.
  4. How to use the Object spy in QTP 8.0 version? - There are two ways to Spy the objects in QTP: 1) Thru file toolbar, In the File Toolbar click on the last toolbar button (an icon showing a person with hat). 2) True Object repository Dialog, In Object repository dialog click on the button object spy. In the Object spy Dialog click on the button showing hand symbol. The pointer now changes in to a hand symbol and we have to point out the object to spy the state of the object if at all the object is not visible. or window is minimized then, hold the Ctrl button and activate the required window to and release the Ctrl button.
  5. How Does Run time data (Parameterization) is handled in QTP? - You can then enter test data into the Data Table, an integrated spreadsheet with the full functionality of Excel, to manipulate data sets and create multiple test iterations, without programming, to expand test case coverage. Data can be typed in or imported from databases, spreadsheets, or text files.
  6. What is keyword view and Expert view in QTP? - Quick Test’s Keyword Driven approach, test automation experts have full access to the underlying test and object properties, via an integrated scripting and debugging environment that is round-trip synchronized with the Keyword View. Advanced testers can view and edit their tests in the Expert View, which reveals the underlying industry-standard VBScript that Quick Test Professional automatically generates. Any changes made in the Expert View are automatically synchronized with the Keyword View.
  7. Explain about the Test Fusion Report of QTP? - Once a tester has run a test, a Test Fusion report displays all aspects of the test run: a high-level results overview, an expandable Tree View of the test specifying exactly where application failures occurred, the test data used, application screen shots for every step that highlight any discrepancies, and detailed explanations of each checkpoint pass and failure. By combining Test Fusion reports with Quick Test Professional, you can share reports across an entire QA and development team.
  8. Which environments does QTP support? - Quick Test Professional supports functional testing of all enterprise environments, including Windows, Web,..NET, Java/J2EE, SAP, Siebel, Oracle, PeopleSoft, Visual Basic, ActiveX, mainframe terminal emulators, and Web services.
  9. What is QTP? - Quick Test is a graphical interface record-playback automation tool. It is able to work with any web, java or windows client application. Quick Test enables you to test standard web objects and ActiveX controls. In addition to these environments, Quick Test Professional also enables you to test Java applets and applications and multimedia objects on Applications as well as standard Windows applications, Visual Basic 6 applications and.NET framework applications
  10. Explain QTP Testing process? - Quick Test testing process consists of 6 main phases:
  11. Create your test plan - Prior to automating there should be a detailed description of the test including the exact steps to follow, data to be input, and all items to be verified by the test. The verification information should include both data validations and existence or state verifications of objects in the application.
  12. Recording a session on your application - As you navigate through your application, Quick Test graphically displays each step you perform in the form of a collapsible icon-based test tree. A step is any user action that causes or makes a change in your site, such as clicking a link or image, or entering data in a form.
  13. Enhancing your test - Inserting checkpoints into your test lets you search for a specific value of a page, object or text string, which helps you identify whether or not your application is functioning correctly. NOTE: Checkpoints can be added to a test as you record it or after the fact via the Active Screen. It is much easier and faster to add the checkpoints during the recording process. Broadening the scope of your test by replacing fixed values with parameters lets you check how your application performs the same operations with multiple sets of data. Adding logic and conditional statements to your test enables you to add sophisticated checks to your test.
  14. Debugging your test - If changes were made to the script, you need to debug it to check that it operates smoothly and without interruption.
  15. Running your test on a new version of your application - You run a test to check the behavior of your application. While running, Quick Test connects to your application and performs each step in your test.
  16. Analyzing the test results - You examine the test results to pinpoint defects in your application.
  17. Reporting defects - As you encounter failures in the application when analyzing test results, you will create defect reports in Defect Reporting Tool.
  18. Explain the QTP Tool interface. - It contains the following key elements: Title bar, displaying the name of the currently open test, Menu bar, displaying menus of Quick Test commands, File toolbar, containing buttons to assist you in managing tests, Test toolbar, containing buttons used while creating and maintaining tests, Debug toolbar, containing buttons used while debugging tests. Note: The Debug toolbar is not displayed when you open Quick Test for the first time. You can display the Debug toolbar by choosing View — Toolbars — Debug. Action toolbar, containing buttons and a list of actions, enabling you to view the details of an individual action or the entire test flow. Note: The Action toolbar is not displayed when you open Quick Test for the first time. You can display the Action toolbar by choosing View — Toolbars — Action. If you insert a reusable or external action in a test, the Action toolbar is displayed automatically. Test pane, containing two tabs to view your test-the Tree View and the Expert View ,Test Details pane, containing the Active Screen. Data Table, containing two tabs, Global and Action, to assist you in parameterizing your test. Debug Viewer pane, containing three tabs to assist you in debugging your test-Watch Expressions, Variables, and Command. (The Debug Viewer pane can be opened only when a test run pauses at a breakpoint.) Status bar, displaying the status of the test
  19. How does QTP recognize Objects in AUT? - Quick Test stores the definitions for application objects in a file called the Object Repository. As you record your test, Quick Test will add an entry for each item you interact with. Each Object Repository entry will be identified by a logical name (determined automatically by Quick Test), and will contain a set of properties (type, name, etc) that uniquely identify each object. Each line in the Quick Test script will contain a reference to the object that you interacted with, a call to the appropriate method (set, click, check) and any parameters for that method (such as the value for a call to the set method). The references to objects in the script will all be identified by the logical name, rather than any physical, descriptive properties.
  20. What are the types of Object Repositories in QTP? - Quick Test has two types of object repositories for storing object information: shared object repositories and action object repositories. You can choose which type of object repository you want to use as the default type for new tests, and you can change the default as necessary for each new test. The object repository per-action mode is the default setting. In this mode, Quick Test automatically creates an object repository file for each action in your test so that you can create and run tests without creating, choosing, or modifying object repository files. However, if you do modify values in an action object repository, your changes do not have any effect on other actions. Therefore, if the same test object exists in more than one action and you modify an object’s property values in one action, you may need to make the same change in every action (and any test) containing the object.
  21. Explain the check points in QTP? - A checkpoint verifies that expected information is displayed in an Application while the test is running. You can add eight types of checkpoints to your test for standard web objects using QTP. A page checkpoint checks the characteristics of an Application. A text checkpoint checks that a text string is displayed in the appropriate place on an Application. An object checkpoint (Standard) checks the values of an object on an Application. An image checkpoint checks the values of an image on an Application. A table checkpoint checks information within a table on a Application. An Accessibilityy checkpoint checks the web page for Section 508 compliance. An XML checkpoint checks the contents of individual XML data files or XML documents that are part of your Web application. A database checkpoint checks the contents of databases accessed by your web site
  22. In how many ways we can add check points to an application using QTP? - We can add checkpoints while recording the application or we can add after recording is completed using Active screen (Note : To perform the second one The Active screen must be enabled while recording).
  23. How does QTP identify objects in the application? - QTP identifies the object in the application by Logical Name and Class.
  24. What is Parameterizing Tests? - When you test your application, you may want to check how it performs the same operations with multiple sets of data. For example, suppose you want to check how your application responds to ten separate sets of data. You could record ten separate tests, each with its own set of data. Alternatively, you can create a parameterized test that runs ten times: each time the test runs, it uses a different set of data.
  25. What is test object model in QTP? - The test object model is a large set of object types or classes that Quick Test uses to represent the objects in your application. Each test object class has a list of properties that can uniquely identify objects of that class and a set of relevant methods that Quick Test can record for it. A test object is an object that Quick Test creates in the test or component to represent the actual object in your application. Quick Test stores information about the object that will help it identify and check the object during the run session.
  26. What is Object Spy in QTP? - Using the Object Spy, you can view the properties of any object in an open application. You use the Object Spy pointer to point to an object. The Object Spy displays the selected object’s hierarchy tree and its properties and values in the Properties tab of the Object Spy dialog box.
  27. What is the Diff between Image check-point and Bit map Check point? - Image checkpoints enable you to check the properties of a Web image. You can check an area of a Web page or application as a bitmap. While creating a test or component, you specify the area you want to check by selecting an object. You can check an entire object or any area within an object. Quick Test captures the specified object as a bitmap, and inserts a checkpoint in the test or component. You can also choose to save only the selected area of the object with your test or component in order to save disk Space. For example, suppose you have a Web site that can display a map of a city the user specifies. The map has control keys for zooming. You can record the new map that is displayed after one click on the control key that zooms in the map. Using the bitmap checkpoint, you can check that the map zooms in correctly. You can create bitmap checkpoints for all supported testing environments (as long as the appropriate add-ins are loaded). Note: The results of bitmap checkpoints may be affected by factors such as operating system, screen resolution, and color settings.
  28. How many ways we can parameterize data in QTP? - There are four types of parameters: Test, action or component parameters enable you to use values passed from your test or component, or values from other actions in your test. Data Table parameters enable you to create a data-driven test (or action) that runs several times using the data you supply. In each repetition, or iteration, Quick Test uses a different value from the Data Table. Environment variable parameters enable you to use variable values from other sources during the run session. These may be values you supply, or values that Quick Test generates for you based on conditions and options you choose. Random number parameters enable you to insert random numbers as values in your test or component. For example, to check how your application handles small and large ticket orders, you can have Quick Test generate a random number and insert it in a number of tickets edit field.
  29. How do u do batch testing in WR & is it possible to do in QTP, if so explain? - Batch Testing in WR is nothing but running the whole test set by selecting Run Test set from the Execution Grid. The same is possible with QTP also. If our test cases are automated then by selecting Run Test set all the test scripts can be executed. In this process the Scripts get executed one by one by keeping all the remaining scripts in Waiting mode.
  30. If I give some thousand tests to execute in 2 days what do u do? - Adhoc testing is done. It Covers the least basic functionalities to verify that the system is working fine.
  31. What does it mean when a check point is in red color? what do u do? - A red color indicates failure. Here we analyze the cause for failure whether it is a Script Issue or Environment Issue or a Application issue.
  32. What is Object Spy in QTP? - Using the Object Spy, you can view the properties of any object in an open application. You use the Object Spy pointer to point to an object. The Object Spy displays the selected object’s hierarchy tree and its properties and values in the Properties tab of the Object Spy dialog box.
  33. What is the file extension of the code file & object repository file in QTP? - Code file extension is.vbs and object repository is.tsr
  34. Explain the concept of object repository & how QTP recognizes objects? - Object Repository: displays a tree of all objects in the current component or in the current action or entire test (depending on the object repository mode you selected). We can view or modify the test object description of any test object in the repository or to add new objects to the repository. Quicktest learns the default property values and determines in which test object class it fits. If it is not enough it adds assistive properties, one by one to the description until it has compiled the unique description. If no assistive properties are available, then it adds a special Ordinal identifier such as objects location on the page or in the source code.
  35. What are the properties you would use for identifying a browser & page when using descriptive programming? - Name would be another property apart from title that we can use.
  36. Give me an example where you have used a COM interface in your QTP project? - com interface appears in the scenario of front end and back end. for eg:if you r using oracle as back end and front end as VB or any language then for better compatibility we will go for an interface. of which COM will be one among those interfaces. Create object creates handle to the instance of the specified object so that we program can use the methods on the specified object. It is used for implementing Automation(as defined by Microsoft).
  37. Explain in brief about the QTP Automation Object Model. - Essentially all configuration and run functionality provided via the Quick Test interface is in some way represented in the Quick Test automation object model via objects, methods, and properties. Although a one-on-one comparison cannot always be made, most dialog boxes in Quick Test have a corresponding automation object, most options in dialog boxes can be set and/or retrieved using the corresponding object property, and most menu commands and other operations have corresponding automation methods. You can use the objects, methods, and properties exposed by the Quick Test automation object model, along with standard programming elements such as loops and conditional statements to design your program.

Microsoft Win32 interview questions

  1. Tell the differences between Windows 95 and Windows NT? Lack of Unicode implementation for most of the functions of Win95. Different extended error codes. Different number window and menu handles. Windows 95 implements some window management features in 16 bits. Windows 95 uses 16-bit world coordinate system and the coordinates restricted to 32K. Deletion of drawing objects is different. Windows 95 does not implement print monitor DLLs of Windows NT. Differences in registry. Windows 95 does not support multiprocessor computers. NT implementation of scheduler is quite different. Different driver models. Win95 was built with back-compatibility in mind and ill-behaving 16-bit process may easily corrupt the system. Win95 starts from real DOS, while WinNT uses DOS emulation when one needs a DOS. Win95’s FAT is built over 16-bit win3.1 FAT (not FAT32!, actually, Win95’s FAT contains two FATs).
  2. What is the effective way of DIB files management? A: Memory-mapped file is the best choice for device-independent bitmaps. MMF allows to map the file to RAM/SWAP addresses and to let Windows handle all load/unload operations for the file.
  3. What should you be aware of if you design a program that runs days/weeks/months/years? A: When your program should run for a long time, you should be careful about heap allocations, because if you use new/delete intensively in your application, the memory becomes highly fragmented with a time. It is better to allocate all necessary memory in this case that many times small blocks. You should be especially careful about CString class which allocates permanent DLL
  4. What are the advantages of using DLL’s? DLLs are run-time modular. DLL is loaded when the program needs it. Used as a code sharing between executables.
  5. What are the different types of DLL’s? A: Extension, Regular and pure Win32 DLL (without MFC)
  6. What are the differences between a User DLL and an MFC Extension DLL? A: Extension DLL supports a C++ interface, i.e. can export whole C++ classes and the client may construct objects from them. Extension DLL dynamically links to MFC DLLs (those which name starts with MFC??.DLL) and to be synchronous with the version it was developed for. Extension DLL is usually small (simple extension DLL might be around 10K) Regular DLL can be loaded by any Win32 environment (e.g. VB 5) Big restriction is that regular DLL may export only C-style functions. Regular DLLs are generally larger. When you build a regular DLL, you may choose a static link (in this case MFC library code is copied to your DLL) and dynamic (in this case you would need MFC DLLs to be presented on the target machine)
  7. What do you have to do when you inherit from two CObject-based classes? A: First of all, this is a bad idea does not matter what tells you interviewer. Secondly, if you forced to use condemned rhombus structure, read Technical Note 16 in MSDN, which discusses why MFC does not support multiple inheritance and what to do in case you still need it (there are a few problems with CObject class, such as incorrect information, returned by IsKindOf() of CObject for MI, etc.)
  8. What are the additional requirements for inheritance from CWnd-based classes? A: Again, this is the bad idea. Try to find alternative solution. Anyway, if you have to multiply inherit from CWnd-based class, the following are additional requirements to the above conditions (again, this is extremely bad question for interview!!!): There must be only one CWnd-derived base class. The CWnd-derived base class must be the first (or left-most) base class.
  9. What is a "mutex"? A: Mutexes are the mechanism of process synchronization that might be used to synchronize data across multiple processes. Mutex is a waitable object while a critical section is not. Mutexes are significantly slower than critical sections.
  10. What’s the difference between a "mutex" and a "critical section"? Critical section provides synchronization means for one process only, while mutexes allow data synchronization across processes.
  11. What might be wrong with the following pseudo-code:
    FUNCTION F
    BEGIN
    INT I=2
    DO
    I = I + 1
    IF I = 4 THEN BREAK
    END DO
    END
    A:This code is not thread safe. Suppose one thread increments I to 3 and then returns to the beginning of DO statement. Then it increments I to 4 and now context switch happens. Second thread increments I to 5. From this moment the code shown will execute forever until some external force intervention. Solution is obviously using some synchronization object to protect I from being changed by more than one thread.
  12. What is a deadlock ? A: A deadlock, very simply, is a condition in which two or more threads wait for each other to release a shared resource before resuming their execution. Because all threads participating in a deadlock are suspended and cannot, therefore, release the resources they own, no thread can continue, and the entire application (or, worse, more than one application if the resources are shared between threads in multiple applications) appears to hang.
  13. How can we create thread in MFC framework? A: Using AfxBeginThread.
  14. What types of threads are supported by MFC framework? A: Working thread and windows thread. Working thread usually does not have a user interface and easier to use. Windows thread has an user interface and usually used to improve responsiveness of the user input. Message Map
  15. When ON_UPDATE_COMMAND_UI is called? (message may vary) A: When a user of your application pulls down a menu, each menu item needs to know whether it should be displayed as enabled or disabled. The target of a menu command provides this information by implementing an ON_UPDATE_COMMAND_UI handler.
  16. What is a "hook"? A: A point in the Windows message-handling mechanism where an application can install a subroutine to monitor messages. You need hooks to implement your own Windows message filter.
  17. What are the difference between MFC Exception macros and C++ exception keywords? A:Actually, MFC macros may accept exception of only CException class or class, derived from CException, where as C++ exception mechanism accepts exception of ANY type Reusable Control Class
  18. How would you set the background of an edit control to a customized color? A: You have several choices, but the simplest one is subclassing. Kruglinski in his "Inside Visual C++" describes pretty well this process. Generally, you derive the class from none control class, override the messages you want (like WM_CTLCOLOR) and then in init function like OnInitialUpdate of CDialog, subclass the control with SubclassDlgItem().
  19. What is Message Reflection? How could you accomplish the above task using message reflection? A: See Technical Note 62 of MSDN. Usually, message is handled in the parent class that means you have to override message handler for each parent. Sometimes it is nice to handle a message in the control itself, without parent invocation. Such handling mechanism is called message reflection. Control "reflects" message to itself and then processes it. Use ON_<MESSAGE_NAME>_REFLECT macro to create a reflected message.
  20. What is the command routing in MFC framework? A: CView => CDocument => CFrameWnd => CWinApp
  21. What’s the purpose of CView class? CDocument class? What are relationships between them? A: The CView class provides the basic functionality for user-defined view classes. A view is attached to a document and acts as an intermediary between the document and the user: the view renders an image of the document on the screen or printer and interprets user input as operations upon the document. The CDocument class provides the basic functionality for user-defined document classes. A document represents the unit of data that the user typically opens with the File Open command and saves with the File Save command. Users interact with a document through the CView object(s) associated with it. A view is a child of a frame window. The relationship between a view class, a frame window class, and a document class is established by a CDocTemplate object. A view can be attached to only one document, but a document can have multiple views attached to it at once.
  22. What class is responsible for document template in MDI application? A: CMultiDocTemplate.
  23. What function must be used to add document template? A: AddDocTemplate.
  24. What the main objects are created for SDI and MDI applications? A: CWinApp - application object. For MDI application with New document implementation CDocTemplate, CDocument, CView, CMainFrame. If your application is SDI, your CMainFrame class is derived from class CFrameWnd. If your application is MDI, CMainFrame is derived from class CMDIFrameWnd. For MDI application CMDIChildWindow is also created.
  25. We have a loop for 800,000. It fails on 756,322. How can we get the information before it fails? A: You could think of several way to debug this: Set the condition in debugger to stop when loop is passed around 756321 times. Throw an exception within a loop (may be not the best idea since exception does not show you the exact location of the fail. Create a log file and to put detailed information within a loop.
  26. Our Debug version works fine, but Release fails. What should be done? A: There are four differences between debug and release builds:
    • heap layout (you may have heap overwrite in release mode - this will cause 90% of all problems),
    • compilation (check conditional compilation statements, assertion functions etc.),
    • pointer support (no padding in release mode which may increase chances of a pointer to point into sky)
    • optimization.
    Check the project settings.

C# interview questions and answers

  1. What’s the advantage of using System.Text.StringBuilder over System.String? StringBuilder is more efficient in the cases, where a lot of manipulation is done to the text. Strings are immutable, so each time it’s being operated on, a new instance is created.
  2. Can you store multiple data types in System.Array? No.
  3. What’s the difference between the System.Array.CopyTo() and System.Array.Clone()? The first one performs a deep copy of the array, the second one is shallow.
  4. How can you sort the elements of the array in descending order? By calling Sort() and then Reverse() methods.
  5. What’s the .NET datatype that allows the retrieval of data by a unique key? HashTable.
  6. What’s class SortedList underneath? A sorted HashTable.
  7. Will finally block get executed if the exception had not occurred? Yes.
  8. What’s the C# equivalent of C++ catch (…), which was a catch-all statement for any possible exception? A catch block that catches the exception of type System.Exception. You can also omit the parameter data type in this case and just write catch {}.
  9. Can multiple catch blocks be executed? No, once the proper catch code fires off, the control is transferred to the finally block (if there are any), and then whatever follows the finally block.
  10. Why is it a bad idea to throw your own exceptions? Well, if at that point you know that an error has occurred, then why not write the proper code to handle that error instead of passing a new Exception object to the catch block? Throwing your own exceptions signifies some design flaws in the project.
  11. What’s a delegate? A delegate object encapsulates a reference to a method. In C++ they were referred to as function pointers.
  12. What’s a multicast delegate? It’s a delegate that points to and eventually fires off several methods.
  13. How’s the DLL Hell problem solved in .NET? Assembly versioning allows the application to specify not only the library it needs to run (which was available under Win32), but also the version of the assembly.
  14. What are the ways to deploy an assembly? An MSI installer, a CAB archive, and XCOPY command.
  15. What’s a satellite assembly? When you write a multilingual or multi-cultural application in .NET, and want to distribute the core application separately from the localized modules, the localized assemblies that modify the core application are called satellite assemblies.
  16. What namespaces are necessary to create a localized application? System.Globalization, System.Resources.
  17. What’s the difference between // comments, /* */ comments and /// comments? Single-line, multi-line and XML documentation comments.
  18. How do you generate documentation from the C# file commented properly with a command-line compiler? Compile it with a /doc switch.
  19. What’s the difference between <c> and <code> XML documentation tag? Single line code example and multiple-line code example.
  20. Is XML case-sensitive? Yes, so <Student> and <student> are different elements.
  21. What debugging tools come with the .NET SDK? CorDBG – command-line debugger, and DbgCLR – graphic debugger. Visual Studio .NET uses the DbgCLR. To use CorDbg, you must compile the original C# file using the /debug switch.
  22. What does the This window show in the debugger? It points to the object that’s pointed to by this reference. Object’s instance data is shown.
  23. What does assert() do? In debug compilation, assert takes in a Boolean condition as a parameter, and shows the error dialog if the condition is false. The program proceeds without any interruption if the condition is true.
  24. What’s the difference between the Debug class and Trace class? Documentation looks the same. Use Debug class for debug builds, use Trace class for both debug and release builds.
  25. Why are there five tracing levels in System.Diagnostics.TraceSwitcher? The tracing dumps can be quite verbose and for some applications that are constantly running you run the risk of overloading the machine and the hard drive there. Five levels range from None to Verbose, allowing to fine-tune the tracing activities.
  26. Where is the output of TextWriterTraceListener redirected? To the Console or a text file depending on the parameter passed to the constructor.
  27. How do you debug an ASP.NET Web application? Attach the aspnet_wp.exe process to the DbgClr debugger.
  28. What are three test cases you should go through in unit testing? Positive test cases (correct data, correct output), negative test cases (broken or missing data, proper handling), exception test cases (exceptions are thrown and caught properly).
  29. Can you change the value of a variable while debugging a C# application? Yes, if you are debugging via Visual Studio.NET, just go to Immediate window.
  30. Explain the three services model (three-tier application). Presentation (UI), business (logic and underlying code) and data (from storage or other sources).
  31. What are advantages and disadvantages of Microsoft-provided data provider classes in ADO.NET? SQLServer.NET data provider is high-speed and robust, but requires SQL Server license purchased from Microsoft. OLE-DB.NET is universal for accessing other sources, like Oracle, DB2, Microsoft Access and Informix, but it’s a .NET layer on top of OLE layer, so not the fastest thing in the world. ODBC.NET is a deprecated layer provided for backward compatibility to ODBC engines.
  32. What’s the role of the DataReader class in ADO.NET connections? It returns a read-only dataset from the data source when the command is executed.
  33. What is the wildcard character in SQL? Let’s say you want to query database with LIKE for all employees whose name starts with La. The wildcard character is %, the proper query with LIKE would involve ‘La%’.
  34. Explain ACID rule of thumb for transactions. Transaction must be Atomic (it is one unit of work and does not dependent on previous and following transactions), Consistent (data is either committed or roll back, no “in-between” case where something has been updated and something hasn’t), Isolated (no transaction sees the intermediate results of the current transaction), Durable (the values persist if the data had been committed even if the system crashes right after).
  35. What connections does Microsoft SQL Server support? Windows Authentication (via Active Directory) and SQL Server authentication (via Microsoft SQL Server username and passwords).
  36. Which one is trusted and which one is untrusted? Windows Authentication is trusted because the username and password are checked with the Active Directory, the SQL Server authentication is untrusted, since SQL Server is the only verifier participating in the transaction.
  37. Why would you use untrusted verificaion? Web Services might use it, as well as non-Windows applications.
  38. What does the parameter Initial Catalog define inside Connection String? The database name to connect to.
  39. What’s the data provider name to connect to Access database? Microsoft.Access.
  40. What does Dispose method do with the connection object? Deletes it from the memory.
  41. What is a pre-requisite for connection pooling? Multiple processes must agree that they will share the same connection, where every parameter is the same, including the security settings.

C interview questions and answers

  1. What will print out? main()
    {
            char
    *p1=“name”;
            char
    *p2;
            p2=(char*)malloc(20);
            memset (p2, 0, 20);
            while(*p2++ = *p1++);
            printf
    (“%sn”,p2);
    }
    Answer:empty string.
  2. What will be printed as the result of the operation below:
    main()
    {
        int
    x=20,y=35;
        x=y++ + x++;
        y= ++y + ++x;
        printf
    (“%d%dn”,x,y); }
    Answer : 5794
  3. What will be printed as the result of the operation below:
    main()
    {
        int x=5;
        printf(“%d,%d,%dn”,x,x< <2,x>>2); }
    Answer: 5,20,1
  4. What will be printed as the result of the operation below:
    #define swap(a,b) a=a+b;b=a-b;a=a-b; void main()
    {
        int x=5, y=10;
        swap (x,y);
        printf(“%d %dn”,x,y);
        swap2(x,y);
        printf(“%d %dn”,x,y);
    }
    int swap2(int a, int b)
    {
        int temp;
        temp=a;
        b=a;
        a=temp;
        return 0;
    }
    Answer: 10, 5
    10, 5
  5. What will be printed as the result of the operation below:
    main()
    {
        char *ptr = ” Cisco Systems”;
        *ptr++; printf(“%sn”,ptr);
        ptr++;
        printf(“%sn”,ptr); }
    Answer:Cisco Systems
    isco systems
  6. What will be printed as the result of the operation below:
    main()
    {
        char s1[]=“Cisco”;
        char s2[]= “systems”;
        printf(“%s”,s1);
    }
    Answer: Cisco
  7. What will be printed as the result of the operation below:
    main()
    {
        char *p1;
        char *p2;     p1=(char *)malloc(25);
        p2=(char *)malloc(25);
        strcpy(p1,”Cisco”);
        strcpy(p2,“systems”);
        strcat(p1,p2);
        printf(“%s”,p1);
    }
    Answer: Ciscosystems
  8. The following variable is available in file1.c, who can access it?:
    static int average;
    
    Answer: all the functions in the file1.c can access the variable.
  9. WHat will be the result of the following code?
    #define TRUE 0 // some code while(TRUE)
    {
        // some code
    }
    Answer: This will not go into the loop as TRUE is defined as 0.
  10. What will be printed as the result of the operation below:
    int x;
    int modifyvalue()
    {
        return(x+=10);
    } int changevalue(int x)
    {
        return(x+=1);
    }
    void main()
    {
        int x=10;
        x++;
        changevalue(x);
        x++;
        modifyvalue();
        printf("First output:%dn",x);
        x++;
        changevalue(x);
        printf("Second output:%dn",x);
        modifyvalue();
        printf("Third output:%dn",x);
    }
    Answer: 12 , 13 , 13
  11. What will be printed as the result of the operation below:
    main()
    {
        int x=10, y=15;
        x = x++;
        y = ++y;
        printf(“%d %dn”,x,y); }
    Answer: 11, 16
  12. What will be printed as the result of the operation below:
    main()
    {
        int a=0;
        if(a==0)
            printf(“Cisco Systemsn”);
            printf(“Cisco Systemsn”); }
    Answer: Two lines with “Cisco Systems” will be printed.