Message on Whatsapp 8879355057 for DSA(OA + Interview) + Fullstack Dev Training + 1-1 Personalized Mentoring to get 10+LPA Job
0 like 0 dislike
753 views
in Online Assessments by Expert (108,110 points) | 753 views

2 Answers

0 like 0 dislike
Best answer

Education: Btech from Tier 3 College, India
Years of Experience: 1+ Years
Current Role: Software Engineer in an Startup
Position: Software Engineer (Analyst) Role
Location: Bangalore, India

 

I applied with raferral from my friend and received the call from HR after 2 days asking for basic information and received the Hacker Rank OA link on the same day.
Initially in the mail it was mentioned that last date of submission is 25th July but on 23rd received another mail as reminder for test and last date was mentioned 24th July. Gave the test on same day.

 

Round 1 (Hacker Rank)
Difficulty level was medium and there were 2 question and duration of test is 2 hrs (more than enough).

 

Question 1https://www.csestack.org/coding-challenge-special-elements-in-matrix/
Question 2https://leetcode.com/problems/remove-all-adjacent-duplicates-in-string-ii/

 

I solved 1st question completely and for 2nd Question only 1 testcase was failing I tried multiple approaches but didn't helped.
I'm hoping to clear this round. Fingers crossed.

by Expert (108,110 points)
0 like 0 dislike
Q2

  string removeDuplicates(string s, int k) {
    int i, j;
    stack<int> st;
    st.push(0);
    for (i = 1, j = 1; j < s.size(); i++, j++) {
        s[i] = s[j];
        if (i == 0 || s[i] != s[i-1]) st.push(i);
        else if (i - st.top() + 1 == k) {
            i = st.top() - 1;
            st.pop();
        }
    }
    return s.substr(0, i);
}
by Expert (108,110 points)