Workday
4.1 of 5 113 reviews
www.workday.com Pleasanton, CA 1000 to 5000 Employees

Workday Associate Software Engineer Interview Question

I interviewed in Pleasanton, CA and was asked:
"How would you reverse a the words in a string? (Be able to defend answer)"
Add Tags [?]
Answer Flag Question

Part of a Associate Software Engineer Interview Review - one of 101 Workday Interview Reviews

Answers & Comments

0
of 0
votes
String reverse(String s){
length = s.length()-1;
s1 = "";
while(length >=0){
s1 += s[length];
length--;
}

return s1;
}
//wrote the code in 1 minute, did not test it or walk through it, use at your own risk
- Jason Peng on Nov 11, 2012 Flag Response
0
of 0
votes
I got the other idea of not using a buffer (a better solution)
String reverseWithoutBuffer(String s){
if (s.length() == 0 || s.length() == 1){return s;}
length = s.length()-1;
i = 0;
while (i != length){
String s1 = s[i];
s[i] = s[length];
s[length] = s1;
i--;
length--;
}

return s;
}
//did not test it or walk through it, use at your own risk
- Jason Peng on Nov 11, 2012 Flag Response
0
of 0
votes
I mean i++ (not i--), sorry
- Jason Peng on Nov 11, 2012 Flag Response
0
of 0
votes
Sorry for another error,
it should be while (i < length)
- Jason Peng on Nov 11, 2012 Flag Response

To comment on this question, Sign In with Facebook or Sign Up


Workday – Why Work for Us?

The Enterprise Cloud for HR and Finance In 2005, longtime friends and software visionaries Dave Duffield and Aneel Bhusri set out to change an industry. They started with a clean sheet of paper and combined decades of… Full Overview

Provided by employer [?]

Tags are like keywords that help categorize interview questions that have something in common.

Glassdoor is your free inside look at Workday interview questions and advice. All interview reviews posted anonymously by Workday employees and interview candidates.