Amazon Interview Question for Software Engineer in Tests






Comment hidden because of low score. Click to expand.
1
of 1 vote

Overriding : Functions with the same definition have different behavior in different scopes. Used by a child class to change behavior it inherited from its parent.

Overloading : More than one definition for a function in the same scope that work on different inputs. Used to have one function that can operate on different data types, especially for operators. For example overloading add() would allow two integers to be added or two strings to be added.

- Anonymous June 22, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
1
of 1 vote

Let me explain this way:
Your dad has a bike and ur his son want to use his bike but it is outdated and u want to modify it the way you want to and ride it...that is, ur dad(class) has a function called Bike and ur using the same Bike(function) but modified/changed and ur using it(overriding). Same bike but now it is changed.... and when we say son it is ur modified bike that shud come into picture ..which has overriden ur dad's old bike

- sastry.soft November 02, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

super

- Anonymous October 01, 2017 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

to get dynamic polymorphism.....

- Anonymous April 30, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

overriding and overloading are concepts of OOPs and not language specific.
So overriding is dynamic polymorphism
overloading is static polymorphism.

A Language can implements these concepts as it wants to.

- Anonymous April 30, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Oops sorry for spam

- Anonymous June 08, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Overriding is useful when you want to change the functionality of some method based on a class. For example, by overriding the toString() method of Object class, we can use it with different classes.

Overloading is useful to add flexibility to a method. In general, if you want to create a method that adds two numbers then it only take either integer, double, or float but by overloading, you can add values of all data types.

- maxan May 29, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

overriding: same method name and same type signature
overloading: same method name but different type signature

- kamal bhatt July 20, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I am not good in english so please kind.

Function Overloading vs Function Overriding

Function Overloading : Same function name more than once in a same class but with differnet argument , like int add(int ,int); float float add(float,float);
Here function name is same but both take different argument.

Function Overriding : Same Function name with same argument(parameter and return type) but in different classes.
But why its needed?
If you want to add some more functionality in function at the same type you also must be needed the previous one , so add more functionality in sub-class funnction.

- shashank1790@gmail.com October 28, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

ssdsd

- Anonymous December 17, 2016 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

overloading-It has same function name and different arguments.
overriding-redifining the function

- sayali jadhav April 18, 2018 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

it depends on language you are using, overriding in Java is polymorphism (as non-static member functions are virtual by default), overriding in C++ is not, if you don't explicitly using "virtual" keyword. In C++ overriding without virtual will not give you dynamic dispatching, e.g. call of fucntion depending on "real" run-time type of pointer/reference you are calling, but instead will call function depending on static/declared type.

So you must ask first - what do you mean - virtual function overriding or just overloading.

- Anonymous April 30, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

A
          /  \
         B   C

- Anonymous June 08, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

A      
         / \
        B   C
           /  \
          D    E
         / \
        F   G
       /
      I

- Anonymous June 08, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

A      
         / \
        B   C
           /  \
          D    E
         / \
        F   G
       /
      I

- Anonymous June 08, 2010 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More