Kasheruka Interview Question for SDE-2s


Country: India
Interview Type: Written Test




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

#Language: Python
s = "Hello world Please"
refString = "Help"
print({i:s.count(i) for i in refString if i in s})

- Anonymous June 03, 2021 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

// Online Java Compiler
// Use this editor to write, compile and run your Java code online

HelloWorld {
public static void main(String[] args) {

String s = "Hello world Please";
char[] ref = "Help".toCharArray();
for(char e: ref){
String val = s.replaceAll(" ", "");
int count= val.length();
String removeCount = val.replaceAll(Character.toString(e), "");
int current = removeCount.length();
System.out.print(e+":"+ (count-current));
if(e != 'p'){
System.out.print(",");
}
}

}
}

- Johnpaul Raphel June 04, 2021 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

####Python
string1 = input("Enter Sentance : ").capitalize()
string2 = input("Enter Refrence String :").capitalize()
for i in string2:
if i in string1:
st3 = string1.count(i)
print({i:st3})

- Sagar Bhadauria June 20, 2021 | 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