Interview Experience at Publicis Sapient | Automation Testing Profile

In this article, we will cover interview experience at Sapient for Automation Testing profile. We will be sharing questions and answers that is asked often by Sapient recruitment team.

Interview Experience at Publicis  Sapient | Automation Testing Profile

First Round - Written
Second round - Technical Interview
Third round - Managerial

First round - Written.
Mode of test - quizme
Questions - 30
Time - 1 hour

If you are appearing for the written test of Publicis Sapient company, you will be receiving an email from Publicis Sapient HR from quizme. Before attempting the test, please make sure you know the basic of nested loops, carry a pen and paper along with you because lot of the questions are MCQ based where a program will be written and candidate is asked to predict the output.
  • Practice Java and Selenium: Collections, file handling and loops, etc.
  • Understand the basics of programming.
  • Visit geeksforgeeks to practice mcq and output based questions
  • Access specifiers, object creation, overloading, variables and collections.
Technical round

  • How do you run feature files parallel in cucumber?
  • How do you share states between scenarios. Write code.
  • WAP in Java to rotate the elements of an array by N.
  • Exceptions faced by you and how you resolved it?
  • What do you understand by Page Object Model?
  • What do you understand by Stream API in Java and have you used it?
  • Explain the integration of Selenium, Cucumber and TestNG step by step?
  • How to serialize and deserialize JSON objects?
    • By converting the JSON into POJO, we can serialize JSON objects.
  • What is JWT?
    • Stands for JSON web tokens
  • Difference between POST, PUT and Patch?
  • What is POJO?
    • Stands for plain old java object.
  • Based on your answers, they will be ask more answers. You are the driver :)
  • Write a program to remove unnecessary whitespace from a string, for an example"I       love     testing"
 Logic
There is no inbuilt logic to perform this. We have trim method but it wouldn't be useful in this situation.
To Achieve this, we will follow below steps
  • Convert given string to char array
  • Create a new empty string
  • Will apply a loop to char array such that if it's next element is non- spaced, add that character in the empty string which we had declared earlier
            Scanner sc = new Scanner(System.in);
            String str = sc.nextLine();
            char c[] = str.toCharArray();
            String withoutWhiteSpace = " ";
 
            for(int i = 0; i<=str.length(); i++ )
                {
                 // if current char is a whitespace, check for next character
                    if(c[i] == '  ' ) 
                    {
                        if(!(withoutWhiteSpace.length() == 0)) 
                        {
                            //checking if next character is non-space, if it is append it in the string
                            if(c[i+1] !=  '  ' ) 
                            {
                               withoutWhiteSpace = withoutWhiteSpace + c[i] ;
                            }
                        }
                    } 
                    else
                        withoutWhiteSpace = withoutWhiteSpace + c[i] ;
                }

Round 2  - Technical Interview
Date of interview - 9th March 2021
Location - Virtual/ Gurgaon
Interviewer - Priyanka and Vibhu Aggarwal
Duration of the interview - 1 hour and 10 mins

  • Tell me about your projects?
  • They asked me to share my screen and open one url - https://codeshare.io/2EAWyo
  • Shared a DOM structure
    • <form>
    •          <input>name="login"</input>
    •         <input>id= "hwuh787"</input> 
    • </form>
  • Find xpath for input 1.
  • Find xpath for input 2 with respect to parent.
  • Explain below commands
    • mvn clean install
      • Mvn clean install clears the compiled files you have. so that you can compile from scratch.
    • mvn clean install -DskipTests
      • Helps in skipping the projects for a particular module. 
  • Lifecycle of Maven(VCT PVID)
    • Validate
    • Compile
    • test
    • Package
    • Verify
    • Install
    • Deploy
  • Lifecycle for defect
    • Open
    • Assigned
    • Fixed
    • L2 Validation/ L3 validation/ Pending Test
    • Closed
    • Re-open
    • Cancelled
    • Returned
  • Lifecycle for STLC
    • Requirement gathering
    • Test planning
    • Environment setup
    • Test execution
    • Test summary report
  • What will be the output for below code-
    • try { 
                          }
                    Catch(Exception e) {
                    System.out.println("a");
                    }
                    Catch(NullPointerException ee) {
                    System.out.println("b");
                    }
  • Can we initialize the interface?
    • We cannot initialize an interface.
  • Can we instantiate an interface ?
    • No we cannot instantiate an interface or an abstract class because it would defy the object oriented model. However an interface can be implemented using ímplements keyword
  • Can Abstract classes have a Constructor?
    • Yes, an Abstract class can have a constructor. We cannot instantiate an Abstract class though.
  • Can the methods in Interface be declared protected?
    • All methods in interfaces should be public because they don't have any implementation at all. For interfaces all the members are public static final by default.
  • Can we create an object of static class?
    • No, we cannot create objects for static class. A static class has static members, static methods and a static constructor. 
  • Can we create an object of Final class?
    • We can create an object of final class. For example, String is a final class Final restricts the class to be inherited.
  • Can we override static methods?
    • We cannot override a static method because method overriding is based on dynamic binding at runtime and the static methods are bonded using static binding at compile time. So, we cannot override static methods.
  • Why would you declare a class as static?
    • For memory utilization, we declare class as static since we don't have to create objects to call methods.
  • What is the difference between below 2 commands?
    • WebDriver driver = new WebDriver() ; // incorrect
    • Firefox driver = new FirefoxDriver();
      • SearchContext is the supermost interface in selenium. WebDriver extends SearchContext interface.
      • Now to understand that why WebDriver driver = new WebDriver() is incorrect, we know WebDriver is an interface and we cannot create object of an interface.
      • We can use either
        • WebDriver driver = new FirefoxDriver() ;
          • or
        • FirefoxDriver driver = new FirefoxDriver();
      • Where FirefoxDriver is a Constructor which implements all the methods of interface WebDriver.
  • Why do we need Finally block?
    • Finally block is needed when try block is exited.
  • What is the difference between Drop, delete and truncate in SQL?
    • Delete
      • Data Manipulation Language(DML)
      • Delete command is used to delete the rows from a table
      • We can use Rollback command to restore the deleted rows.
      • We can use WHERE clause with Delete to filter out the rows.
    • Drop
      • Data Definition Language(DDL)
      • Can be used to drop the entire table at once.
      • We cannot restore once we used drop command
    • Truncate
      • Data Definition Language(DDL)
      • Performs same action as Delete command, can be used to delete rows from the table.
      • We cannot restore the data once truncated
      • It is faster than Delete.
      • We cannot use WHERE clause with Truncate.
  • What do you understand by Union in SQL?
    • Union is used to combine results from two or more select statements
    • Columns must have same data types
    • Union selects only distinct values
    • Syntax of UNION
      • select * from table 1
      • UNION
      • select * from table 2;
    • The only difference between UNION and UNION ALL is that UNION ALL returns back duplicate values.
  • What do you understand by MINUS operator?
    • MINUS operator when used returns all the results from first table which are non-matching with the second table.
  • Interview Experience at Publicis Sapient



           





Syntax of MINUS operator
Select * from table1
MINUS
Select * from table2;

  • What do you understand by Intersect in SQL?
    • Intersect commands works in the same way as UNION. It returns the common records from table 1 and table2.
    • Interview Experience at Publicis Sapient









  • What is the difference between UNION and Intersect in SQL?
    • Consider an example where query 1 returns A and B and query 2 returns B and C.
    • UNION will return A, B and C
    • Intersect will return return B.


Comments

Popular posts from this blog

Azure Tutorials Series - Azure Networking

Coforge Interview Questions | Automation Testing profile

Testing in CI/CD