is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.
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.
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.
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.
package DS.BasicProgrammingJava.interviewsspecial;
- kapilkumar080 March 02, 2018import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class P4 {
public static void main(String args []){
P4 p4 = new P4();
List<String> data = new ArrayList<String>();
HashMap<String,Integer> map = new HashMap<>();
data.add("aaa");
data.add("bbb");
data.add("ccc");
data.add("aaa");
data.add("bbb");
data.add("aaa");
data.add("ccc");
//data.add("ccc");
//find the count of words
for(String entry:data){
System.out.println(entry);
}
String secondHigh = null;
int first = Integer.MIN_VALUE;
int second =Integer.MIN_VALUE;
int val = 0;
for(String value:data){
if(!map.containsKey(value))
{
map.put(value,1);
}
else {
map.put(value, map.get(value)+1);
}
val = map.get(value);
if(val > first) {
second = first;
first = val;
}
}
for( Map.Entry<String,Integer> entry : map.entrySet()){
if(second==entry.getValue()){
secondHigh = entry.getKey();
break;
}
}
System.out.println("second repeating word is "+secondHigh);
}
}