Apple Interview Question for Software Engineer / Developers


Country: United States




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

O(1) expected time.

- eugene.yarovoi April 10, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

o q method defines a secure way to alternate

- Anonymous August 31, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Actually it should be O(N)

consider the worst hashing function, where all objects are in single basket.

To find the last element in the basket (let assume linked list traversal) it would take N compares.

- Amit January 06, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

yes, it is O(n/h), and so ideal hash has O(1)

- hytgbn January 29, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Short answer is O(1).
If the buckets of the hash table are not efficiently created then insert/delete worst case is O(n). But that is rarely the case, that's why we say that amortized time O(1).

- noni June 26, 2018 | 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