Ebay Interview Question for Software Developers


Country: United States




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

The usage of equals and hashcode functions are used widely in hashing an object into any hash store such as hashmap.

equals function is used to compare two objects of the same type.
hashcode function is used to generate the unique location to be used to insert the object into a hashmap.

- Prashanth July 14, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
1
of 1 vote

Equals() is a 'standard' method of the 'object' class. Default implementation for reference types is reference equality. If you need a smarter way of equality comparison, you need to override it and, probably, implement complex and expensive equality comparison.
In addition to hash table data structure, hash codes also might be used for easier objects comparison. However it doesn't substitute it completely (because of collisions): so, if the hash values are equal you could call a real 'full' equality comparison.

- Alex M. February 04, 2017 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Equals function is used to compare string object to a specified object. If returns true if the string object consist of same character sequence as specified object.
Initially hashcode returns hexadecimal location of the object. It also uses computation formula to calculate hashcode for string object.

- deepakdezire23 August 10, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

equals function is for object comparison and not string comparison specifically. Its a method defined in Object class and all other class inherit from it so you can override it for other classes as well.

- Abhi August 19, 2015 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Hash function is used to locate the object faster i.e. searching is fast.
Equals method is used to compare equality of object. You can define which attributes of objects need to be equal in order to consider an object as equal.

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

Hash function is used to locate the object faster i.e. searching is fast.
Equals method is used to compare equality of object. You can define which attributes of objects need to be equal in order to consider an object as equal.

- Anonymous September 17, 2015 | 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