StartUp Interview Question for Developer Program Engineers


Country: India
Interview Type: In-Person




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

You can create a HashMap like HashMap<String, HashMap<String, String>> and store key and (user, value).

class Main {
	static HashMap<String, HashMap<String, String>>  map = new HashMap<>();
	
	static void add(String user, String key, String value) {
		if (map.get(key) == null) {	
			HashMap<String, String> map2 = new HashMap<>();
			map2.put(user, value);
			map.put(key, map2);
		} else {
			map.get(key).put(user, value);
		}
	}

	static List<String> getUsers(String key) {
		if (map.get(key) != null) {
			return map.get(key).keySet();
		}
		return new ArrayList<String>();
	}
}

- tazo February 04, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

We can have 2 tables. One that stores the customer information and one that store the Key, Value pair along with and ID column. This ID column should be a foreign key in the customer table , so its possible to query all customers whose Id equals a certain value.

- Tasneem.Yusuf February 18, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

It is stated that "There is a restriction on the entered keys and values.". What is that restriction?

- Paippad February 24, 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