Sonoa Systems Interview Question for Testing / Quality Assurances






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

str_rev(char *str)
{
while(*str)
{
str_rev( str+1);
printf("%c",*str);
}
}

- noob_programmer December 25, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

void str_rev(char *str,int len)
{
     if(len>0)
      {
            str_rev( str+1,len-1);
            printf("%c",*str);
      }
}

- Anonymous December 25, 2009 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

static int j=0;
if(*pString+1)
{
ReverseStringRecursive(pString+1);
pString[j++] = *pString;
}

- Venkata December 25, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Here's Python:

def reverse(s):
    if len(s) < 2:
        return s
    return ''.join([s[-1], reverse(s[1:-1]), s[0]])

- Bullocks December 29, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

reverse_str(char *s)
{
static int i=0;static int j=0;char ch;
if(*(s+1))
{
j++;s++;
reverse_str(s);
}
if(j>i)
{
ch=s[i];s[i]=s[j];s[j]=ch;
i++;j--;
}
}

- DinakaranGct December 30, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Code is not working.
I have verified with GCC Compiler.

- Naga Samrat Chowdary, Narla June 23, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

// Java version
static String revStr(StringBuffer buf, String data, int length){
if(length == 0){
return buf.append("").toString();
} else {
return revStr(buf.append(data.charAt(length-1)),data, length-1).toString();
}
}

- Sanjeev Kulkarni January 11, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

void reverse(char* str, int start, int end){
if(start > end)return;
char tmp = str[start];
str[start] = str[end];
str[end] = tmp;
return reverse(str,start+1, end-1)
}

- LOL January 31, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

void strReverse(string::iterator start ,string::iterator end , int count){

if(count == 0 ) return;
else{
char temp;
temp = *end;
*end = *start;
*start = temp;
strReverse(start+1,end-1,count - 1);
}
}
int main( )
{
string str("abcde");

strReverse(str.begin(),str.end() -1 ,str.length()/2);

}

- sachin February 26, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

in Java

public static void main(String[] args){
String stringToReverse = "abcdef";
StringBuffer buf = new StringBuffer();
for(int i = stringToReverse.length -1; i>0; i--){
buf.append(stringToReverse.charAt(i));
}
System.out.println(buf.toString());

}

- Anonymous May 11, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Its not an recursive solution to the problem...

- CR January 11, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

public static void main(String[] args) {
String one="zero";
reverse((char[])one.toCharArray(),one.length());
}
public static void reverse(char[] one, int len) {
if (len == 1) {
System.out.print(one[0]);
} else {
System.out.print(one[len - 1]);
reverse(one, len - 1);
}
}

- Vinit Patwa May 12, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

public static void main(String[] args) {
String one="zero";
reverse((char[])one.toCharArray(),one.length());
}
public static void reverse(char[] one, int len) {
if (len == 1) {
System.out.print(one[0]);
} else {
System.out.print(one[len - 1]);
reverse(one, len - 1);
}
}

- Vinit May 12, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

in C#

private void Reverse(String myString)
    {
        String next = myString.Substring(myString.Length - 1, 1);

        Page.Response.Write(next);

        if (myString.Length > 1)
            Reverse(myString.Substring(0, myString.Length - 1));

}

- Yul August 12, 2016 | 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