Oracle Interview Question for Site Reliability Engineers


Team: GGN
Country: India
Interview Type: In-Person




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

Can u descibe the question more?

Does it want an implementation oh hashing technique?

- Siddharth Das July 06, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

there is one hashset class in java already available.
So interviewer wanted me to design own hashset class,he did not mention whether he want same hashset or want to see some new class which can do the same functionality.

- sujita July 06, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

he wants u to write an implementation as:

1. Write a hash function as:

unsigned int Hash(int num) {
return num * 63563 % MAXBUCKET;
}

2. Insert into buckets according to hash value and maintain a link list at the point of collision,


If u want i can write a code for it (but in C language as i'm much more comfortable in C)

- Siddharth Das July 06, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

what datastructure are you using ?

- sujita July 06, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

unsigned long and arrays (hash values equal to number of buckets which is fixed by MAXBUCKETS)

- Siddharth Das July 06, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

It could be an array of linked lists.
. Each array index will be mapped with a hash value. Each array index holds the head of a linked list.
. If hash value is same for more than 1 element then they are appended to the linked list on that array index. Then we have to use equals() method to identify the correct element.

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

import java.util.HashMap;
import java.util.Map;
import java.util.Set;


public class OwnHashSet <E>
{
Map<E,Object> map = new HashMap<E,Object>();

void add(E e)
{
map.put(e,null);
}
Set<E> get()
{
return map.keySet();
}
int size()
{
return get().size();
}
}

- raghava.javvaji September 21, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Actually they are asking to design the similar class with all the methods so that to check whether u know the following.
1. What HashSet extends and implements
2. What are the core methods in HashSet.

- Anonymous November 08, 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