The most basic Java Script Interview Questions
 

JavaScript developed by Netscape. JS is a client side as well as a server-side scripting language. It is interpreted programming language as well with object orientated capabilities.

1. How do you create a class in JavaScript?

Answer – There are multiple ways you can create a class in JS. For example

Method 1 – Using functions

// This is a class name

function Flat(aptName, location){

// You can define object properties

this.aptName = aptName;

this.location = location;

this.getLocation = getLocationInfo

}

// The method can be defined as

function getLocationInfo{

return “The location is “ + this.location;

}I

// You can even define function of a class like this

Flat.prototype.getFlatInfo = function() {

alert (“The apartment name is” +   this.aptName + “ and the location is “ + this.location = location);

// Instantiate new object of Flat class

var myFlat = new Flat(“Manjeera”, “Kukatpally”);

// Invoke methods like this

alert myFlat.getLocationInfo();

Method 2 – Using object literals

Var Flat = {

this.aptName = “manjeera”;

this.location = “kukatpally”;

this.getLocation = function() {

return “The location is “ + this.location;

}

}

Apart from using functions, and object literals, you can use object constructor as well to create JavaScript class.

2. What is the difference between ‘==’ and ‘===’?

Answer –       ‘==’ checks for equality only

‘===’ checks for equality and type

For example

false == 0 returns TRUE

false === 0 returns FALSE

3. What is isNan? Give example?

Answer – This would return true of the argument is not a number. For example

isNaN(23) returns false

isNaN(“2/3/2017”) returns true

4. What are the difference comments available in JavaScript?

Answer – There are two types of comments available in JavaScript

A. Single line comments

// This is a single line comment

B. Block comments

/*

This can be used

For block comments

..

*/

5. What are the types used by JavaScript?

Answer – There are six types used in Java Script

Boolean (True and False)

Null (null)

Undefined (undefined)

Number (Integers, floating etc.)

String

Object (Objects, Array, Functions etc.)

6. Is JavaScript a case sensitive?

Answer – Yes, JavaScript is case-sensitive.

7. How can you create an object in JavaScript

Answer – You can use object literal as shown below

var student  = {

name: “Sandeep”,

age: 36

};

Alternatively, you can use below (As explained in question number 1)

var myFlat = new Flat(“Manjeera”, “Kukatpally”);

8. Does JavaScript support exception handling?

Answer – Yes, it does support exception handling by means of try and catch. It supports try, catch, finally, throw etc. keywords to handle exceptions.

9. What is the difference between break and continue?

Answer – Break statement causes program control to exit from the loop.

The continue statement causes program control to continue with next statement.

10. What is the primary difference between ViewState and SessionState?

Answer – ViewState represents a page in session while SessionState is specific to user specific data which can be accessed all across in the web application.

 

 

 

 

 

 

 

 

Most frequently asked .NET interview questions for 5 years or less
 
  1. What is the difference between System.Array.CloneTo() and System.Array.CopyTo()?
  2. What is the difference between an interface and an abstract class? Give examples of their use in real life?
  3. Can you use “this” with the static class?
  4. What is the primary difference between “read-only” and “constants”?
  5. What is a garbage collector? Can we force the garbage collector to run? Is that guaranteed that it would run?
  6. What is public, static, void and main?
  7. Can we execute multiple catch blocks written for same try block?
  8. What is the difference between Finalize() and Dispose() method?
  9. What is a sealed class in C#? Explain with examples?
  10. What is the difference between a HashTable and a dictionary? When to use what? Give an example of each?
  11. What is “out” and “ref” parameter in C#?
  12. What is “protected internal” in C#?
  13. What is a “finally” in exception handling? How does it differ from finalize?
  14. What is generics?
  15. What is the difference between a connection pooling and an object pooling? How and where do you set the connection pooling parameter?  What is the default value?
  16. What is multiple inheritence? Is it allowed in C#? How do you achieve that?
  17. What is boxing and unboxing? Give examples of each?
  18. What is a copy constructor?
  19. What is a static constrictor?
  20. What is the difference between overriding and overloading? Give examples?
  21. What do you mean by virtual method?
  22. What types of commets are used in C#?
  23. What is abstraction, inheritence, polymorphism and encapsulation?
  24. What is the relation between data hiding and encapsulation?
  25. What all the access modifiers you have in C#?
Top 20 leadership interview questions which you must prepare in advance
 

Have you ever noticed that the questions asked during leadership interviews are so easy and everything went so well but still you were not selected? Or probably you could have answered slightly different then what you did. The questions seem so easy but your selection would be decided not based on how many questions you answered but the quality of your responses.  The key is to prepare well and that’s something many of us don’t do it very well. Whenever you go for an interview, you must write down all the questions post that interview and think through that what you could have answered or how would you have responded. The preparation is most important. If you attend 10 interviews, you would find, a majority of the questions are keep getting repeated. I am not providing an answer to any of the questions listed below as the answer depends on your role, the company you are going for an interview, culture, future expectations etc. etc.  There is nothing wrong or right in leadership interview. It is all about how do you articulate and respond to different situations. Following are must prepare questions well in advance in order to increase your chances of not only higher success rate but getting better role and money.

1. Tell me something about yourself?

Tip: You know too much about yourself and it is quite tough to articulate the most important part upfront. Prepare well for this question. This is something you would hear almost all the times in some or other form.

2. Explain your current project/s and your role?

Follow up question – Sell your product to me.

Tip: Preparation is key here as well. What you are talking should show your knowledge and strengths. Don’t forget to get that aligned for your job you have come for an interview. If you can answer “what is there for me” from interviewer perspective, you have won half the battle.

3. What is your biggest weakness?

Follow up question – What did you do to overcome your weakness?

Tip: This is the question where interviewer expects you to open up and further wants to know what you did about it. It’s not a perfect world.  It’s highly impossible that individual doesn’t have a weakness.

4. What is your biggest strength?

Follow up question – How did you leverage it to support your organization?

Tip: How can you align that with your upcoming job needs?  You’re a great cook but does it really help?

5. How do you motivate your team?

Tip: Provide your answer with an example.

6. How do you manage conflicts between two members or among the team?

Tip: Answer the question and justify with an example. Everyone can talk bookish theories while implementation gets more priority in this case.

7. Why should we hire you? What is that you could do which others can’t?

Tip: You should know your prospective company where you are going for an interview well in advance. Moreover, you should talk about how your success and knowledge align with interview company’s expectations.

8. Did you ever fail? Did you make a blunder? A decision what you have taken and you regret it?

Follow up question – How did you later get that corrected?  What did you learn from it?

Tip: Fail faster succeed sooner. If you have never failed either you are a god which is highly unlikely or you are faking it. Talk about the situation and be ready for follow-up question as an interviewer is more interested in knowing what did you learn and how would you avoid that situation in future.

9. Where do you see yourself in next 5/10 years? How are your short terms and long term goals?

Follow up question – What are you doing to achieving them?

Tip: You must be able to justify for what you say. I have seen people saying software development or managing a larger team but unable to align that with their future goals.

10. What is your passion? How do you keep that alive?

Tip: I say, my passion is reading and when asked what the last book you read is, you don’t have a concrete answer. Weird? Off course yes.

11. What are your salary expectations?

Tip: If you don’t plan this question or prepare to answer in advance, it is highly unlikely that you will be able to convince your interviewer with real expectations.

12. What do people criticize about you?

13. Why are you looking for a change?

Tip: No company is perfect and there are always challenges. Don’t talk ill about your current organization.  

14. What is the most difficult part of being a leader?

15. Tell me a situation where you had to make a tough decision which was supporting your company’s goal while that had a short-term financial impact?

Tip: Leaders take big decisions and you are one among them. If you are instruction follower you are not a leader.

16. Would you compromise your team member pride over company’s purpose?

Tip: There is no perfect answer for this. It all depends. To you, what is right is more important. You should have an example else you are in deep trouble.

17. What are three most critical things for you as a leader?

Tip: As a leader, one of the best things which I learned are people, business alignment and building relationships.

18. Did you ever fire anybody?

Follow up question – What is the process? How did you go about it?

Tip: Be honest about whether you have done or not. In this competitive world, you have to let go non-performers. You must know the process around it. (Read about Performance Improvement Plan)

19. How do you handle stress and pressure?

Tip: It is very obvious that you will have challenges. You can’t say that everything is great and I manage them so good. If that’s the case, you may not be even looking for a change.

20. What is your biggest achievement in your career as a leader?

Tip: If you don’t prepare, you may answer right but chances are slim that you would be articulate it well.

In case if you encounter any other question/s which you found it interesting, please post it in the comment below. Thanks in advance!!