Rootstock Software interview experience Real time questions & tips from candidates to crack your interview

Software Developer

Rootstock Software
upvote
share-icon
3 rounds | 5 Coding problems

Interview preparation journey

expand-icon
Journey
When I joined college, I was unaware of data structures and algorithms, which made my journey to getting an internship way more complicated. From that point, I started doing questions on Code Studio.
Application story
This company visited my college for placements. I got to know about this company through my college placement cell.
Why selected/rejected for the role?
I was rejected because i was not able to provide a good approach to the DSA question which are being asked.
Preparation
Duration: 4 months
Topics: Data Structures, Pointers, OOPS, System Design, Algorithms, Dynamic Programming
Tip
Tip

Tip 1 : Practice medium-level problems from coding platforms.
Tip 2 : Brush up computer fundamentals from subjects like OS, DBMS and CN.
Tip 3 : Have a good project or good internship experience and have in-depth knowledge regarding what you have done.

Application process
Where: Campus
Eligibility: Above 7 CGPA
Resume Tip
Resume tip

Tip 1: A well-organized and visually appealing format is crucial for your resume. Use clear headings, bullet points, and appropriate spacing to structure the content. Make sure the font is legible and consistent throughout the document.

Tip 2: Customize the content of your resume to match the requirements of the job you're applying for. Highlight experiences, skills, and achievements that directly relate to the position. Use keywords from the job description to demonstrate your suitability for the role.

Interview rounds

01
Round
Medium
Video Call
Duration60 minutes
Interview date16 Jul 2023
Coding problem2

It was online coding assessment round on the hackerrank platform. It consists of two coding questions of hard and medium level.

1. Wildcard Pattern Matching

Hard
50m average time
30% success
0/120
Asked in companies
FreshworksWalmartSamsung R&D Institute

Given a text and a wildcard pattern of size N and M respectively, implement a wildcard pattern matching algorithm that finds if the wildcard pattern is matched with the text. The matching should cover the entire text not partial text.

The wildcard pattern can include the characters ‘?’ and ‘*’

 ‘?’ – matches any single character 
 ‘*’ – Matches any sequence of characters(sequence can be of length 0 or more)
Problem approach

This Solution use 2D DP. beat 90% solutions, very simple.

Here are some conditions to figure out, then the logic can be very straightforward.

1, If p.charAt(j) == s.charAt(i) : dp[i][j] = dp[i-1][j-1];
2, If p.charAt(j) == '.' : dp[i][j] = dp[i-1][j-1];
3, If p.charAt(j) == '*': 
here are two sub conditions:
1 if p.charAt(j-1) != s.charAt(i) : dp[i][j] = dp[i][j-2] //in this case, a* only counts as empty
2 if p.charAt(i-1) == s.charAt(i) or p.charAt(i-1) == '.':
dp[i][j] = dp[i-1][j] //in this case, a* counts as multiple a 
or dp[i][j] = dp[i][j-1] // in this case, a* counts as single a
or dp[i][j] = dp[i][j-2] // in this case, a* counts as empty
Here is the solution

public boolean isMatch(String s, String p) {

if (s == null || p == null) {
return false;
}
boolean[][] dp = new boolean[s.length()+1][p.length()+1];
dp[0][0] = true;
for (int i = 0; i < p.length(); i++) {
if (p.charAt(i) == '*' && dp[0][i-1]) {
dp[0][i+1] = true;
}
}
for (int i = 0 ; i < s.length(); i++) {
for (int j = 0; j < p.length(); j++) {
if (p.charAt(j) == '.') {
dp[i+1][j+1] = dp[i][j];
}
if (p.charAt(j) == s.charAt(i)) {
dp[i+1][j+1] = dp[i][j];
}
if (p.charAt(j) == '*') {
if (p.charAt(j-1) != s.charAt(i) && p.charAt(j-1) != '.') {
dp[i+1][j+1] = dp[i+1][j-1];
} else {
dp[i+1][j+1] = (dp[i+1][j] || dp[i][j+1] || dp[i+1][j-1]);
}
}
}
}
return dp[s.length()][p.length()];
}

Try solving now

2. Scramble String

Hard
15m average time
85% success
0/120
Asked in companies
PostmanAmazonInfo Edge India (Naukri.com)

You are given an integer ‘N’ and two strings ‘S’ and 'R' each having size = ‘N’. You can scramble the string ‘S’ to obtain string 'R' using the following operations:

1. If the length of the string is greater than 1:

  • Select any random index and split the string into two non-empty substrings. For e.g: if the string is ‘S’, then divide it into two non-empty substrings ‘A’ and ‘B’ such that ‘S’ = ‘A’ + ‘B’.
  • You can choose to swap the two substrings or keep them in the same order, i.e., after this operation string ‘S’ may become either ‘S’ = ‘A’ + ‘B’ or ‘S’ = ‘B’ + ‘A’.
  • Apply the first step recursively on each of the two strings ‘A’ and ‘B’.
  • 2. If the length of the string is equal to 1 then stop.

    Your task is to return true if 'R' is a scrambled string of ‘S’ else return false.

    Note:

    1. Both the strings are non-empty and are of the same length.
    
    2. You can apply the above operations any number of times on ‘S’.
    
    3. The operations can only be applied on the string ‘S’.
    
    4. ‘S’ and 'R' consist of lowercase letters only.
    
    Problem approach

    class Solution {
    public:
    //for storing already solved problems
    unordered_map mp;


    bool isScramble(string s1, string s2) {
    //base cases

    int n = s1.size();

    //if both string are not equal in size
    if(s2.size()!=n)
    return false;

    //if both string are equal
    if(s1==s2)
    return true; 



    //if code is reached to this condition then following this are sure:
    //1. size of both string is equal
    //2. string are not equal
    //so size is equal (where size==1) and they are not equal then obviously false
    //example 'a' and 'b' size is equal ,string are not equal
    if(n==1)
    return false;

    string key = s1+" "+s2;

    //check if this problem has already been solved
    if(mp.find(key)!=mp.end())
    return mp[key];

    //for every iteration it has two conditions 
    //1. we should proceed without swapping
    //2. we should swap before looking next
    for(int i=1;i {

    //ex of without swap: gr|eat and rg|eat
    bool withoutswap = (
    //left part of first and second string
    isScramble(s1.substr(0,i),s2.substr(0,i)) 

    &&

    //right part of first and second string.
    isScramble(s1.substr(i),s2.substr(i))
    );



    //if without swap give us right answer then we do not need 
    //to call the recursion with swap
    if(withoutswap)
    return true.

    //ex of withswap: gr|eat rge|at
    //here we compare "gr" with "at" and "eat" with "rge"
    bool withswap = (
    //left part of first and right part of second 
    isScramble(s1.substr(0,i),s2.substr(n-i)) 

    &&

    //right part of first and left part of second
    isScramble(s1.substr(i),s2.substr(0,n-i)) 
    );



    //if with swap give us right answer then we return true
    //otherwise the for loop do it work
    if(withswap)
    return true;
    //we are not returning false in else case 
    //because we want to check further cases with the for loop
    }


    return mp[key] = false;

    }
    };

    Try solving now
    02
    Round
    Easy
    Video Call
    Duration60 minutes
    Interview date17 Jul 2023
    Coding problem2

    This was 1st technical round taken by the software engineer. Interviewer was very friendly, he started with his introduction and then asked me to introduce myself.

    1. Longest Palindromic Substring

    Moderate
    20m average time
    80% success
    0/80
    Asked in companies
    WalmartIBMSamsung

    You are given a string ('STR') of length 'N'. Find the longest palindromic substring. If there is more than one palindromic substring with the maximum length, return the one with the smaller start index.

    Note:
    A substring is a contiguous segment of a string.
    

    For example : The longest palindromic substring of "ababc" is "aba", since "aba" is a palindrome and it is the longest substring of length 3 which is a palindrome, there is another palindromic substring of length 3 is "bab" since "aba" starting index is less than "bab", so "aba" is the answer.

    Problem approach

    class Solution {
    public String longestPalindrome(String s) {
    //Approach : treat each character as mid of the palindromic string and check if its left and right character are same or not if they are same then decrement left and increment right and after checking it for each character determine maximum length which is maximum length of palindromic string 
    // To get palindromic substring return substring from start to start + maximum length
    int n = s.length();
    if(n <= 1) return s;
    int maxLen = 1;
    int start = 0;
    //for odd length 
    for(int i=0;i= 0 && r < n && s.charAt(l) == s.charAt(r)){
    l--;
    r++;
    }
    int len = r-l-1;
    if(len > maxLen){
    maxLen = len;
    start = l+1;
    }
    }
    //for Even length 
    for(int i=0;i= 0 && r maxLen){
    maxLen = len;
    start = l+1;
    }
    }
    return s.substring(start,start+maxLen);
    }
    }

    Try solving now

    2. Find 3Sum of elements in a vectors

    Moderate
    15m average time
    85% success
    0/80
    Asked in companies
    IntuitSamsungGrofers

    You are given an array/list ARR consisting of N integers. Your task is to find all the distinct triplets present in the array which adds up to a given number K.

    An array is said to have a triplet {ARR[i], ARR[j], ARR[k]} with sum = 'K' if there exists three indices i, j and k such that i!=j, j!=k and i!=j and ARR[i] + ARR[j] + ARR[k] = 'K'.

    Note:
    1. You can return the list of values in any order. For example, if a valid triplet is {1, 2, -3}, then {2, -3, 1}, {-3, 2, 1} etc is also valid triplet. Also, the ordering of different triplets can be random i.e if there are more than one valid triplets, you can return them in any order.
    2. The elements in the array need not be distinct.
    3. If no such triplet is present in the array, then return an empty list, and the output printed for such a test case will be "-1".
    
    Problem approach

    Intuition
    Approach
    Only used two loops and for removing duplicate triplets used simple JavaScript objects.

    Complexity
    Time complexity:
    Space complexity:
    Code
    /**
    * @param {number[]} nums
    * @return {number[][]}
    */
    var threeSum = function(nums) {

    let obj={}
    nums=nums.sort((a,b)=>a-b)
    // console.log(nums)
    for(let start=0;start0){
    right--
    }else if(nums[left]+nums[right]+nums[start]<0){
    left++
    }
    }
    }
    return (Object.values(obj))
    };

    Try solving now
    03
    Round
    Easy
    HR Round
    Duration30 minutes
    Interview date17 Jul 2023
    Coding problem1

    1. Basic HR Questions

    Introduce yourself briefly.

    Why do you want to join us?

    Where do you see yourself in 5 years?

    Here's your problem of the day

    Solving this problem will increase your chance to get selected in this company

    Skill covered: Programming

    What is recursion?

    Choose another skill to practice
    Similar interview experiences
    SDE - 1
    3 rounds | 6 problems
    Interviewed by Rootstock Software
    753 views
    0 comments
    0 upvotes
    SDE - 1
    2 rounds | 4 problems
    Interviewed by Rootstock Software
    1066 views
    0 comments
    0 upvotes
    company logo
    SDE - 1
    4 rounds | 8 problems
    Interviewed by Amazon
    8518 views
    0 comments
    0 upvotes
    company logo
    SDE - Intern
    1 rounds | 3 problems
    Interviewed by Amazon
    3320 views
    0 comments
    0 upvotes
    Companies with similar interview experiences
    company logo
    Software Developer
    5 rounds | 14 problems
    Interviewed by Microsoft
    3931 views
    1 comments
    0 upvotes
    company logo
    Software Developer
    6 rounds | 12 problems
    Interviewed by SAP Labs
    2806 views
    0 comments
    0 upvotes
    company logo
    Software Developer
    3 rounds | 3 problems
    Interviewed by Amazon
    1134 views
    0 comments
    0 upvotes