3.6 of 5 7,029 reviews Redmond, WA 5000+ Employees

Microsoft Software Development Engineer In Test (SDET) Interview Question

"Given a string, find whether it has any permutation of another string. Need to be efficient"
Tags: technical
Add Tags [?]
Answer Flag Question

Part of a Software Development Engineer In Test (SDET) Interview Review - one of 3,171 Microsoft Interview Reviews

Answers & Comments

of 0
isnt it enough if we find out whether the characters in the second string is present in the first?
(also the number of times each character appears).?
- Anonymous on Feb 27, 2013 Flag Response
of 0
The characters need to be consecutive. For example, if the second string is "abc", we need to find out whether the first string has one of the following: "abc" , "acb" , "bac" , "bca" , "cab" or "cba"
- Anonymous on Feb 27, 2013 Flag Response
This post has been removed. Please see our Community Guidelines or Terms of Service for more information.
of 1
public boolean test(String main, String sub){
        char[] a = main.toCharArray();
        char[] b = sub.toCharArray();
        char[] c = sub.toCharArray();

        for(int i = 0; i<a.length-b.length+1; i++){
            int k=i;
            for(int j=0; j<b.length; j++){
                c[j] = a[k++];
                return true;
        return false;
- Rachana Koneru on Mar 07, 2013 Flag Response

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

Microsoft – Why Work for Us?

What do you want in a job? Do you want more than a paycheck? At Microsoft, you can discover potential you didn’t know you had, push your limits, turn your ideas into reality and make a real impact on the industry and… Full Overview

Provided by employer [?]

Tags are like keywords, helping to categorise interview questions that have something in common.

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