- 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.
- Can you store multiple data types in System.Array? No.
- 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.
- How can you sort the elements of the array in descending order? By calling Sort() and then Reverse() methods.
- What’s the .NET datatype that allows the retrieval of data by a unique key?HashTable.
- What’s class SortedList underneath? A sorted HashTable.
- Will finally block get executed if the exception had not occurred? Yes.
- 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 {}.
- 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.
- 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.
- What’s a delegate? A delegate object encapsulates a reference to a method. In C++ they were referred to as function pointers.
- What’s a multicast delegate? It’s a delegate that points to and eventually fires off several methods.
- 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.
- What are the ways to deploy an assembly? An MSI installer, a CAB archive, and XCOPY command.
- 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.
- What namespaces are necessary to create a localized application?System.Globalization, System.Resources.
- What’s the difference between // comments, /* */ comments and /// comments? Single-line, multi-line and XML documentation comments.
- How do you generate documentation from the C# file commented properly with a command-line compiler? Compile it with a /doc switch.
- What’s the difference between <c> and <code> XML documentation tag? Single line code example and multiple-line code example.
- Is XML case-sensitive? Yes, so <Student> and <student> are different elements.
- 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.
- 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.
- 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.
- 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.
- 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.
- Where is the output of TextWriterTraceListener redirected? To the Console or a text file depending on the parameter passed to the constructor.
- How do you debug an ASP.NET Web application? Attach the aspnet_wp.exe process to the DbgClr debugger.
- 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).
- 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.
- Explain the three services model (three-tier application). Presentation (UI), business (logic and underlying code) and data (from storage or other sources).
- 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.
- 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.
- 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%’.
- 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).
- What connections does Microsoft SQL Server support? Windows Authentication (via Active Directory) and SQL Server authentication (via Microsoft SQL Server username and passwords).
- 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.
- Why would you use untrusted verificaion? Web Services might use it, as well as non-Windows applications.
- What does the parameter Initial Catalog define inside Connection String?The database name to connect to.
- What’s the data provider name to connect to Access database? Microsoft.Access.
- What does Dispose method do with the connection object? Deletes it from the memory.
- 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.
Showing posts with label JOBS. Show all posts
Showing posts with label JOBS. Show all posts
Tuesday, 7 August 2012
Java interview questions and answers
- What is garbage collection? What is the process that is responsible for doing that in java? - Reclaiming the unused memory by the invalid objects. Garbage collector is responsible for this process
- What kind of thread is the Garbage collector thread? - It is a daemon thread.
- What is a daemon thread? - These are the threads which can run without user intervention. The JVM can exit when there are daemon thread by killing them abruptly.
- How will you invoke any external process in Java? - Runtime.getRuntime().exec(….)
- What is the finalize method do? - Before the invalid objects get garbage collected, the JVM give the user a chance to clean up some resources before it got garbage collected.
- What is mutable object and immutable object? - If a object value is changeable then we can call it as Mutable object. (Ex., StringBuffer, …) If you are not allowed to change the value of an object, it is immutable object. (Ex., String, Integer, Float, …)
- What is the basic difference between string and stringbuffer object? - String is an immutable object. StringBuffer is a mutable object.
- What is the purpose of Void class? - The Void class is an uninstantiable placeholder class to hold a reference to the Class object representing the primitive Java type void.
- What is reflection? - Reflection allows programmatic access to information about the fields, methods and constructors of loaded classes, and the use reflected fields, methods, and constructors to operate on their underlying counterparts on objects, within security restrictions.
- What is the base class for Error and Exception? - Throwable
- What is the byte range? -128 to 127
- What is the implementation of destroy method in java.. is it native or java code? - This method is not implemented.
- What is a package? - To group set of classes into a single unit is known as packaging. Packages provides wide namespace ability.
- What are the approaches that you will follow for making a program very efficient? - By avoiding too much of static methods avoiding the excessive and unnecessary use of synchronized methods Selection of related classes based on the application (meaning synchronized classes for multiuser and non-synchronized classes for single user) Usage of appropriate design patterns Using cache methodologies for remote invocations Avoiding creation of variables within a loop and lot more.
- What is a DatabaseMetaData? - Comprehensive information about the database as a whole.
- What is Locale? - A Locale object represents a specific geographical, political, or cultural region
- How will you load a specific locale? - Using ResourceBundle.getBundle(…);
- What is JIT and its use? - Really, just a very fast compiler… In this incarnation, pretty much a one-pass compiler — no offline computations. So you can’t look at the whole method, rank the expressions according to which ones are re-used the most, and then generate code. In theory terms, it’s an on-line problem.
- Is JVM a compiler or an interpreter? - Interpreter
- When you think about optimization, what is the best way to findout the time/memory consuming process? - Using profiler
- What is the purpose of assert keyword used in JDK1.4.x? - In order to validate certain expressions. It effectively replaces the if block and automatically throws the AssertionError on failure. This keyword should be used for the critical arguments. Meaning, without that the method does nothing.
- How will you get the platform dependent values like line separator, path separator, etc., ? - Using Sytem.getProperty(…) (line.separator, path.separator, …)
- What is skeleton and stub? what is the purpose of those? - Stub is a client side representation of the server, which takes care of communicating with the remote server. Skeleton is the server side representation. But that is no more in use… it is deprecated long before in JDK.
- What is the final keyword denotes? - final keyword denotes that it is the final implementation for that method or variable or class. You can’t override that method/variable/class any more.
- What is the significance of ListIterator? - You can iterate back and forth.
- What is the major difference between LinkedList and ArrayList? - LinkedList are meant for sequential accessing. ArrayList are meant for random accessing.
- What is nested class? - If all the methods of a inner class is static then it is a nested class.
- What is inner class? - If the methods of the inner class can only be accessed via the instance of the inner class, then it is called inner class.
- What is composition? - Holding the reference of the other class within some other class is known as composition.
- What is aggregation? - It is a special type of composition. If you expose all the methods of a composite class and route the method call to the composite method through its reference, then it is called aggregation.
- What are the methods in Object? - clone, equals, wait, finalize, getClass, hashCode, notify, notifyAll, toString
- Can you instantiate the Math class? - You can’t instantiate the math class. All the methods in this class are static. And the constructor is not public.
- What is singleton? - It is one of the design pattern. This falls in the creational pattern of the design pattern. There will be only one instance for that entire JVM. You can achieve this by having the private constructor in the class. For eg., public class Singleton { private static final Singleton s = new Singleton(); private Singleton() { } public static Singleton getInstance() { return s; } // all non static methods … }
- What is DriverManager? - The basic service to manage set of JDBC drivers.
- What is Class.forName() does and how it is useful? - It loads the class into the ClassLoader. It returns the Class. Using that you can get the instance ( “class-instance”.newInstance() ).
- Inq adds a question: Expain the reason for each keyword of
public static void main(String args[])
10 mistakes managers make during job interviews
Hiring is one of the hardest parts of managing a team. A lot is riding on the initial meeting, and if you're nervous or ill-prepared -- or both -- it can make you do strange things. The following mistakes are all too common, but they're easy to avoid with some advance preparation.
#1: You talk too much
When giving company background, watch out for the tendency to prattle on about your own job, personal feelings about the company, or life story. At the end of the conversation, you'll be aflutter with self-satisfaction, and you'll see the candidate in a rosy light -- but you still won't know anything about his or her ability to do the job.
#2: You gossip or swap war stories
Curb your desire to ask for dirt on the candidate's current employer or trash talk other people in the industry. Not only does it cast a bad light on you and your company, but it's a waste of time.
#3: You're afraid to ask tough questions
Interviews are awkward for everyone, and it's easy to over-empathize with a nervous candidate. It's also common to throw softball questions at someone whom you like or who makes you feel comfortable. You're better off asking everyone the same set of challenging questions -- you might be surprised what they reveal. Often a Nervous Nellie will spring to life when given the chance to solve a problem or elaborate on a past success.
#4: You fall prey to the halo effect (or the horns effect)
If a candidate arrives dressed to kill, gives a firm handshake, and answers the first question perfectly, you might be tempted to check the imaginary "Hired!" box in your mind. But make sure you pay attention to all the answers and don't be swayed by a first impression. Ditto for the reverse: The mumbler with the tattoos might have super powers that go undetected at first glance.
#5: You ask leading questions
Watch out for questions that telegraph to the applicant the answer you're looking for. You won't get honest responses from questions like, "You are familiar with Excel macros, aren't you?"
#6: You invade their privacy
First of all, it's illegal to delve too deeply into personal or lifestyle details. Second, it doesn't help you find the best person for the job. Nix all questions about home life ("Do you have children?" "Do you think you'd quit if you got married?"), gender bias or sexual preference ("Do you get along well with other men?"), ethnic background ("That's an unusual name, what nationality are you?"), age ("What year did you graduate from high school?"), and financials ("Do you own your home?")
#7: You stress the candidate out
Some interviewers use high-pressure techniques designed to trap or fluster the applicant. While you do want to know how a candidate performs in a pinch, it's almost impossible to re-create the same type of stressors an employee will encounter in the workplace. Moreover, if you do hire the person, he or she may not trust you because you launched the relationship on a rocky foundation.
#8: You cut it short
A series of interviews can eat up your whole day, so it's tempting to keep them brief. But a quick meeting just doesn't give you enough time to gauge a candidate's responses and behavior. Judging candidates is nuanced work, and it relies on tracking lots of subtle inputs. An interview that runs 45 minutes to an hour increases your chances of getting a meaningful sample.
#9: You gravitate toward the center
If everyone you talk to feels like a "maybe," that probably means you aren't getting enough useful information -- or you're not assessing candidates honestly enough. Most "maybes" are really "no, thank yous." (Face it: The candidate didn't knock your socks off.) Likewise, if you think the person might be good for some role at some point in the future, he or she is really a "no."
#10: You rate candidates against each other
Mediocre candidates may look like superstars when they follow a dud, but that doesn't mean they're the most qualified for the job. The person who comes in tomorrow may smoke all of them, but you won't be able to tell if you rated mediocre candidates too highly in your notes. Evaluate each applicant on your established criteria -- don't grade on a curve.
Wednesday, 11 July 2012
Job Interview Questions?
Why should you be hired for this job?
Point out how your talents and how they meet what the organization needs. Do not mention any other job candidates and try to make a comparison. Try to tie a few things to your career path and how it is a good fit. Answer this question with confidence. Do not waffle. You show already know why you should be hired. If you have doubts or are tentitive about this answer, your interviewer might also have doubts.
Why did you leave (or want to leave) your last job?
Stay positive regardless of the circumstances. Never refer to a major problem with management and never speak ill of supervisors, co-workers or the organization. If you do, you will be the one looking bad. Keep smiling and talk about leaving for a positive reason such as an opportunity, a chance to do something special or other forward-looking reasons.
What do you know about this company/organization?
This question is one reason to do some research on the organization before the interview. Find out where they have been and where they are going. What are the current issues and who are the major players?
What have you done to improve your knowledge in the last year?
Try to include improvement activities that relate to the job. A wide variety of activities can be mentioned as positive self-improvement. Have some good ones handy to mention.
Do you have any weaknesses?
Trick question. If you know about weakness, they are no longer blind spots. Do not reveal any personal areas of concern here. Let them do their own discovery on your bad points. Do not hand it to them.
What is your greatest strength?
Numerous answers are good, just stay positive. A few good examples: Your ability to prioritize, Your problem-solving skills, Your ability to work under pressure, Your ability to focus on projects, Your professional expertise, Your leadership skills, Your positive attitude.
What have you learned from mistakes on the job?
Here you have to come up with something or you strain credibility. Make it small, well intentioned mistake with a positive lesson learned. An example would be working too far ahead of colleagues on a project and thus throwing coordination off.
Have you ever had to fire anyone? How did you feel about that?
This is serious. Do not make light of it or in any way seem like you like to fire people. At the same time, you will do it when it is the right thing to do. When it comes to the organization versus the individual who has created a harmful situation, you will protect the organization. Remember firing is not the same as layoff or reduction in force.
Are you a team player?
You are, of course, a team player. Be sure to have examples ready. Specifics that show you often perform for the good of the team rather than for yourself are good evidence of your team attitude. Do not brag, just say it in a matter-of-fact tone. This is a key point.
Describe your management style.
Try to avoid labels. Some of the more common labels, like progressive, salesman or consensus, can have several meanings or descriptions depending on which management expert you listen to. The situational style is safe, because it says you will manage according to the situation, instead of one size fits all.
Would you be willing to relocate if required?
You should be clear on this with your family prior to the interview if you think there is a chance it may come up. Do not say yes just to get the job if the real answer is no. This can create a lot of problems later on in your career. Be honest at this point and save yourself future grief.
Are you willing to work overtime? Nights? Weekends?
This is up to you. Be totally honest.
What motivates you to do your best on the job?
This is a personal trait that only you can say, but good examples are:
Challenge, Achievement, Recognition
What motivates you to do your best on the job?
This is a personal trait that only you can say, but good examples are:
Challenge, Achievement, Recognition
What would your previous manager say your strongest point is?
There are numerous good possibilities:
Loyalty, Energy, Positive attitude, Leadership, Team player, Expertise, Initiative, Patience, Hard work, Creativity, Problem solver.
What kind of salary are you asking for?
A common loaded question. A tricky little game that you will probably lose if you answer first. So, do not answer it. Instead, say something like, That’s a tough question. Can you tell me the range for this position? In most cases, the interviewer, taken off guard, will tell you. If not, say that it can depend on the details of the job. Then give a wide range.
Stay away from a specific job. You cannot win. If you say the job you are contending for is it, you strain credibility. If you say another job is it, you plant the suspicion that you will be dissatisfied with this position if hired. The best is to stay genetic and say something like: A job where I love the work, like the people, can contribute and can’t wait to get to work.
Do you think you are overqualified for this position?
Regardless of your qualifications, state that you are very well qualified for the position.
How do you propose to compensate for your lack of experience?
First, if you have experience that the interviewer does not know about, bring that up: Then, point out (if true) that you are a hard working quick learner.
What qualities do you look for in a Manager?
Be generic and positive. Safe qualities are knowledgeable, a sense of humor, fair, loyal to subordinates and holder of high standards. All bosses think they have these traits.
Tell me about a time when you helped resolve a dispute between coworkers.
Pick a specific incident. Concentrate on your problem solving technique and not the dispute you settled.
Describe your work ethic.
Emphasize benefits to the company and the hiring manager. Things like, determination to get the job done and work hard but enjoy your work are good.
Subscribe to:
Posts (Atom)
