Amazon Interview Question for Software Engineer in Tests






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

add vowels to a Hash
read string and check if char is in Hash
if yes, increment counter

- R May 01, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

public int numOfVowels(String s){
     int val = 0;
     char[] vowels = {'a','e','i','o','u'};
     for(int i=0;i<s.length()-1;i++){
          for(int j=0;j<vowels.length-1;j++){
	       if(s.charAt(i)==vowels[j]){
	            val++;
	       	}
	  }
     }
     return val;
}

- nada June 04, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

int VowelsCount( char *str)
{

int count=0,i=0;
while(str[i]!='\0')
{
if(str[i]=='a' || str[i]=='e' || str[i]=='i' || str[i]=='o'|| str[i]=='u')
count++;

i++;

}

return count;

}

- Fresher June 07, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

@all: u can use the following code
String i="amazon";
String j=i.replaceAll("[aeiou]", "");
System.out.println(j);
System.out.println(i.length()-j.length());

- Anonymous June 12, 2011 | 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