Capgemini
20+ IREP Credit Capital Interview Questions and Answers
Q1. what are the different types of datatypes in python?
Python has several built-in datatypes including numeric, sequence, and mapping types.
Numeric types include integers, floating-point numbers, and complex numbers.
Sequence types include lists, tuples, and range objects.
Mapping types include dictionaries.
Other datatypes include boolean, bytes, and sets.
Q2. how do you concatenate a string and integer? is it possible ?
Yes, it is possible to concatenate a string and integer using type conversion.
Convert the integer to a string using str() function and then concatenate with the string.
Use format() method to insert the integer value into the string.
Use f-strings to directly insert the integer value into the string.
Q3. what is xpath ? How do you find an element ? what is the difference between absolute xpath and relative xpath?
XPath is a language used to locate elements in an XML or HTML document. Absolute and relative XPaths differ in their starting point.
XPath is used to navigate through elements and attributes in an XML or HTML document
Elements can be located using absolute or relative XPaths
Absolute XPaths start from the root node and are more specific but less flexible
Relative XPaths start from the current node and are more flexible but less specific
Q4. if some data is not found on the page, do page refresh and how do you validate a data after page refresh in selenium?
To validate data after page refresh in Selenium, we can refresh the page and then use explicit wait to validate the data.
Refresh the page using driver.navigate().refresh() method
Use explicit wait to wait for the element to be visible on the page
Validate the data using getText() or getAttribute() method
Example: driver.navigate().refresh(); WebDriverWait wait = new WebDriverWait(driver, 10); wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("xpath_of_element")))...read more
Q5. how do you generate random emails in python? gmail.com is constant
Generating random emails in Python with constant domain
Use the random module to generate random strings for the username part of the email
Combine the random username with the constant domain name
Ensure the generated email is unique if required
Q6. how do you achieve synchronization? what are the differences between the synchronization ways?
Synchronization is the process of coordinating the execution of multiple threads to ensure proper order of execution.
Synchronization can be achieved using techniques like locks, semaphores, and monitors.
Locks are used to ensure that only one thread can access a shared resource at a time.
Semaphores are used to control access to a shared resource by limiting the number of threads that can access it at once.
Monitors are used to ensure that only one thread can execute a critical ...read more
Q7. how do you open a file and read repeating words from a file ?
To open a file and read repeating words, use file handling and string manipulation techniques.
Open the file using file handling techniques in the programming language of your choice.
Read the contents of the file and store it in a string variable.
Split the string into an array of words using a delimiter such as space or comma.
Loop through the array and use a dictionary or hash table to count the frequency of each word.
Print out the repeating words along with their frequency.
Cl...read more
Q8. how do you run a test suite using robotframework command line ?
To run a test suite using robotframework command line, use the 'robot' command followed by the path to the test suite file.
Open the command prompt or terminal
Navigate to the directory containing the test suite file
Enter the command 'robot' followed by the name of the test suite file
Add any additional options or arguments as needed
Press enter to execute the command
Example: robot my_test_suite.robot
Example with options: robot --variable ENV:prod --outputdir results my_test_suit...read more
Q9. how do you select a value from dropdown in selenium?
To select a value from dropdown in Selenium, use the Select class and its methods.
Locate the dropdown element using any of the locators like ID, name, class name, etc.
Create an object of the Select class and pass the dropdown element as a parameter.
Use the Select class methods like selectByVisibleText(), selectByValue(), or selectByIndex() to select the desired option.
Finally, use the assert statement to verify if the selected option is correct.
Q10. how do you generate random data / number in python ?
Python provides random module to generate random data and numbers.
Import random module
Use random.randint() to generate random integer within a range
Use random.choice() to select a random element from a list
Use random.random() to generate a random float between 0 and 1
Use random.uniform() to generate a random float within a range
Q11. what is the difference between findelement and findelements?
findelement returns the first matching element while findelements returns a list of all matching elements.
findelement is used to locate the first matching element on a web page
findelements is used to locate all matching elements on a web page
findelement throws NoSuchElementException if no matching element is found
findelements returns an empty list if no matching element is found
Q12. what is the difference between break continue and pass?
Break, continue and pass are control statements used in loops. Break terminates the loop, continue skips an iteration and pass does nothing.
Break is used to terminate a loop when a certain condition is met
Continue is used to skip an iteration of a loop when a certain condition is met
Pass is used as a placeholder when a statement is required syntactically but no action is needed
Q13. Write an SQL query to find names of employees start with ‘A’?
SQL query to find names of employees starting with 'A'
Use the SELECT statement to retrieve data from the employee table
Use the LIKE operator to match the names starting with 'A'
Use the % wildcard to match any number of characters after 'A'
Q14. What are different locators supported in selenium?
Selenium supports various locators such as ID, Name, Class Name, Tag Name, Link Text, Partial Link Text, CSS Selector and XPath.
ID locator is the most efficient and reliable locator
Name locator is used for locating elements by their name attribute
Class Name locator is used for locating elements by their class attribute
Tag Name locator is used for locating elements by their tag name
Link Text locator is used for locating elements by their link text
Partial Link Text locator is u...read more
Q15. what is the difference between array and a list ?
Arrays are fixed in size, while lists can grow or shrink dynamically.
Arrays are a collection of elements of the same data type, while lists can contain elements of different data types.
Arrays are accessed using an index, while lists are accessed using an iterator.
Arrays are faster for accessing elements, while lists are faster for inserting or deleting elements.
Examples of arrays include int[] and char[], while examples of lists include ArrayList and LinkedList.
Q16. how do you fetch unique elements from a column?
To fetch unique elements from a column, use the DISTINCT keyword in SQL.
Use the SELECT statement with the DISTINCT keyword.
Specify the column name from which you want to fetch unique elements.
Example: SELECT DISTINCT column_name FROM table_name;
You can also use GROUP BY clause to group the unique elements based on another column.
Example: SELECT column_name, COUNT(*) FROM table_name GROUP BY column_name;
Q17. what is your current and expected CTC ?
I prefer not to disclose my current CTC. As for my expected CTC, I am looking for a competitive salary based on my experience and skills.
I am open to negotiation based on the job responsibilities and company's budget
I have researched the market rates for similar positions and have a realistic expectation
I am looking for a salary that reflects my experience and skills
I am also interested in other benefits such as health insurance, retirement plans, and paid time off
Q18. what are the exceptions in selenium?
Exceptions in Selenium are errors that occur during test execution.
Some common exceptions in Selenium are NoSuchElementException, TimeoutException, StaleElementReferenceException, and ElementNotVisibleException.
NoSuchElementException occurs when an element cannot be found on the page.
TimeoutException occurs when a command takes too long to execute.
StaleElementReferenceException occurs when an element is no longer attached to the DOM.
ElementNotVisibleException occurs when an e...read more
Q19. how to fetch 1st 5 records in sql?
To fetch 1st 5 records in SQL, use the LIMIT clause.
Use the SELECT statement to specify the columns to retrieve.
Use the FROM clause to specify the table to retrieve data from.
Use the LIMIT clause to specify the number of records to retrieve.
The syntax is: SELECT column1, column2, ... FROM table_name LIMIT 5;
The first 5 records will be returned.
Q20. how do you copy a table in mysql?
To copy a table in MySQL, use the CREATE TABLE statement with the SELECT statement.
Use the CREATE TABLE statement with the SELECT statement to copy a table.
Specify the new table name after the CREATE TABLE statement.
Specify the original table name after the SELECT statement.
Add any additional conditions or clauses as needed.
Example: CREATE TABLE new_table SELECT * FROM original_table WHERE condition;
Q21. Write a Query to Find Second Highest Salary in SQL
Query to find second highest salary in SQL
Use the ORDER BY clause to sort the salaries in descending order
Use the LIMIT clause to select the second highest salary
Use a subquery to exclude the highest salary from the results
Q22. what is full join ?
Full join is a type of SQL join that returns all the rows from both tables, matching rows from both tables and nulls where there is no match.
Full join is also known as a full outer join.
It is used to combine data from two tables where some of the data may not match.
The result set includes all the rows from both tables, with nulls where there is no match.
Full join is represented by the keyword 'FULL OUTER JOIN' in SQL.
Example: SELECT * FROM table1 FULL OUTER JOIN table2 ON tab...read more
More about working at Capgemini
Interview Process at IREP Credit Capital
Reviews
Interviews
Salaries
Users/Month