Amazon Interview Question for Software Engineer / Developers


Country: United States
Interview Type: Phone Interview




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

overrinding requires same method signature (name name parameter) and same return type.
super class having non-final instance methods that are directly accessible from the subclass are applicable for overriding.
While
Overloading occurs when the method names are same but different parameter(in order,type or number).

- Sam March 08, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

In overriding/overloading return type may be covariant. mean return type may be subtype of base return type.

- viratlakshya March 09, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Overriding:
A method with same name, signature, arguments, return type defined in Super class and Sub class. Out of the two methods the subclass method is executed. This is achieved by declaring VIRTUAL the function Virtual.
Example:
class Parent{
virtual int child(){};
}

class Child: Parent {
int child(){};
}

Overloading:
This is basically overloading of a particular function achieved by varying the number/data type of arguments.

Example :
int area (int r) {};
int area(int a, int b) {};

- HuggableAtol March 11, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Overriding:
1. Late Binding
2. signature must be same

Overloading:
1. Early Binding
2. signature should be different

- suman_csm09 March 12, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Overloading - Having different behavior for function names/operators depending on the context in which they are used.
Overriding - In inheritance, the child class having its own definition of a function, instead of using the one defined in the parent class.

- rkt March 13, 2012 | 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