Amazon Interview Question






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

Functions for which there are no side effects.

- Shailesh November 07, 2006 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Functions for which there are no side effects.

- Shailesh November 07, 2006 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

A pure function in C++ is a member function of a class that is not implemented in that class. In C++ all pure functions must be declared as virtual. For this reason C++ programmers talk about pure virtual functions rather than abstract functions.

The concrete classes derived from the abstract class must overload all the pure functions and so define what the function does on objects in the derived class

An abstract class is a class that has one or more abstract operations[, i.e. pure function]. An abstract operation is not implemented in its [abstract] class but in classes that are derived from it.

Ref: http://www.csci.csusb.edu/dick/cs202/abstraction.html

- Fusedentropy March 07, 2007 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

In Java, you can use the abstract keyword to define a class as abstract. You don't always need abstract methods for an abstract class in Java.

- Jim May 03, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

In computer programming, a function may be described as pure if both these statements about the function hold:
The function always evaluates the same result value given the same argument value(s). The function result value cannot depend on any hidden information or state that may change as program execution proceeds or between different executions of the program, nor can it depend on any external input from I/O devices.
Evaluation of the result does not cause any semantically observable side effect or output, such as mutation of mutable objects or output to I/O devices.

- weiwuwei November 09, 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