Amazon Interview Question for Front-end Software Engineers


Country: India
Interview Type: In-Person




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

if(str[i]=='T'&&str[i+1]=='U'
{
str[i]='K';
str[i+1]='O'
}

- shoban September 20, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

We can use "Knuth Morris" algorithm to find the pattern index and then replace the whole required word ("TU" in this case) by required string..

- vishal2947 September 20, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

I told 2 every1 tat use simple logic,,jst look at ths..

cpy and paste in browxy site

import java.io.*;
public class Test{
public static void main(String args[]){
String Str="STUN";



System.out.print("Return Value :" );
System.out.println(Str.replaceFirst("TU", "KO" ));
}
}

OUTPUT:
Return Value :SKON

- Shaki September 21, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

It's so interesting that for the same position from same companies... some ppl get easy questions some ppl get crazy ones (that require specific knowledge of things like Fenwick trees).

No wonder Peter Norvig said when he reviewed Google's hiring process and claimed it was very random (actually he said the ppl who scored the best were worse employees than the ones who barely got in).

- bigphatkdawg September 20, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

var result = 'STUN'.replace('TU', 'KO');
alert(result);

- shikolay December 13, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

var string = "fklj";

for(var i=0; i < string.length; i++){
    if(string[i] === "k" && string[i+1] === "l"){
        string = string.slice(0, i) + 'zy' + string.slice(i+2);
    }
}

console.log(string)

- Anonymous January 24, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

function popString(string, find, replace){
	return string.replace(find, replace);
}
popString('STUN','TU','KO');

- David December 30, 2017 | 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