Publicis Sapient Recent Interview Questions and Answers
Publicis Sapient Recent Interview Questions and Answers
1.What is Polymorphism?
Example:
class Animal {
}
}
2.What is Exception Handling?
Key keywords:
throws: Used in the method signature to declare exceptions the method might throw.
int data;
out.write(data);
in.close();
out.close();
5.Explain Abstract Class and Interface with Example?
Abstract Class: Can have abstract and concrete methods. Used for partial
abstraction.
Example:
interface Color {
void fill();
}
class Circle extends Shape implements Color {
}
6.Write a Program for Factorial Using Recursion?
if (n == 0) return 1;
return n * factorial(n - 1);
}
Automation Questions:
Selenium comprises:
Selenium WebDriver: Communicates with the browser using JSON Wire Protocol.
Selenium Grid allows parallel execution of tests across multiple machines and
browsers.
Setup:
Example XPath:
//input[@id='fromCity']
//div[@class='makeFlex column'].
5.Execute Multiple Test Cases at a Time?
Use TestNG:
Parameters: Provides single configuration data from the test suite XML.
7.Difference Between @BeforeTest and @BeforeClass?
Test Plan: Document specifying scope, resources, schedule, and test objectives.
Ceremonies: