Platform9

Drive was of total 5 rounds

  1. Task Submission
  2. Technical Interview 1
  3. Technical Interview 2
  4. Technical Interview 3
  5. Behavioural Interview

Task Given:

Problem:

Implement a type ahead with a regex “*”. For e.g sample input queries could be suggest all words starting with “wa”, “st*t”, “ra*ct”.
This is an open ended question, while the obvious answer for type ahead is with trie data structure the regex makes it a bit complex. The answer should optimize on the amount of memory and the number of times the tree is traversed up and down in an effort to match the regex. Will also test design considerations about setting up an in-memory data structure and ways to traverse it.


Solution code: (language C++)
        #include
    using namespace std;
    struct Trie{
        struct Trie* child[26];
        bool wordend;
    };
    void insert(struct Trie* head,string name){
        struct Trie* temp=head;
        for(int i=0;ichild[val]){
                struct Trie* temp2=new Trie;
                temp2->wordend=false;
                for(int j=0;j<26;j++)temp2->child[j]=NULL;
                temp->child[val]=temp2;
            }
            temp=temp->child[val];
        }
        temp->wordend=true;
    }
    
    bool islast(struct Trie* head){
        for(int i=0;i<26;i++){
            if(head->child[i])return 0;
        }
        return 1;
    }
    void suggestion(struct Trie* head,string curr){
        if(head->wordend){
            cout<child[i]){
                curr.push_back(97+i);
                suggestion(head->child[i],curr);
                curr.pop_back();
            }
        }
    }
    int printsuggestion(struct Trie* head,string query){
        struct Trie* temp=head;
        for(int i=0;ichild[query[i]-'a'])return 0;
            temp=temp->child[query[i]-'a'];
        }
        bool isWord = (temp->wordend == true);
      bool isLastt = islast(temp);
        if (isWord && isLastt)
        {
            cout << query << endl;
            return -1;
        }
        if(!isLastt){
            string prefix=query;
            suggestion(temp,prefix);
            return 1;
        }
    }
    bool isposs(struct Trie* head,string query){
        struct Trie* temp=head;
        for(int i=0;ichild[val])return 0;
            temp=temp->child[val];
        }
        return 1;
    }
    
    void printresult(struct Trie* head,string query,int n,string curr){
        if(n==query.length()){
            printsuggestion(head,curr);
            return ;
        }
        if(query[n]=='*'){
            for(int i=0;i<26;i++){
                curr.push_back(97+i);
                if(isposs(head,curr)){
                    printresult(head,query,n+1,curr);
                }
                curr.pop_back();
            }
        }else{
            curr.push_back(query[n]);
            if(isposs(head,curr)){
                printresult(head,query,n+1,curr);
            }
            curr.pop_back();
        }
    }
    int main(){
        struct Trie* head=new Trie;
        head->wordend=false;
        for(int i=0;i<26;i++)head->child[i]=NULL;
        insert(head,"wastern");
        insert(head,"waffer");
        insert(head,"stat");
        insert(head,"strt");
        insert(head,"rakct");
        insert(head,"rahct");
        insert(head,"raxct");
        string query;
        cin>>query;
        printresult(head,query,0,"");
    }
    

Technical Interview 1

About projects and internships DNS concepts IPV4 and IPV6 Subnet Mask Process and thread If you time platform.com then what happens in background and how it gives page content Coding ques1 write a program to find duplicate character in a string Coding question 2 write a program in C++ to reverse a string What is Rest API

Technical Interview 2

  1. About project
  2. DNS concepts
  3. Source and Destination address
  4. how to find ip address of source and destination
  5. Linux commands ls, PS
  6. private and public address
  7. write a code for overlapping LinkedList and how to find intersection points.

Technical Interview 3

  1. About your team project
  2. how you divided the work
  3. have you done any project using linux
  4. Question regarding your skills mentioned in CV
  5. Regarding your certification
  6. They were asking for some linux pacakages
  7. Your Achievements and Strengths