Virtusa Consulting Services
Recipharm Pharmaservices Interview Questions and Answers
Q1. Can you write code for printing a star in java
Yes, I can write code for printing a star in Java.
Create an array of strings to represent the star
Use a loop to iterate through each row of the array
Use another loop to iterate through each column of the array
Print the value at each row and column position
Example: String[] star = {" * ", " *** ", "*****", " *** ", " * "};
Example: for (String row : star) { System.out.println(row); }
Q2. When to use GET, POST, PUT, DELETE (Rest methods)
GET for retrieving data, POST for creating data, PUT for updating data, DELETE for deleting data
GET: Used to retrieve data from a server
POST: Used to create new data on a server
PUT: Used to update existing data on a server
DELETE: Used to delete data on a server
Example: GET request to fetch user information, POST request to create a new user, PUT request to update user details, DELETE request to delete a user
Q3. Write SQL query to join 2 tables (inner join)
SQL query to perform inner join on 2 tables
Use the JOIN keyword to combine rows from two tables based on a related column
Specify the columns to select from each table
Use the ON keyword to specify the join condition
Q4. Write SQL query to get second highest salary
SQL query to retrieve the second highest salary from a table
Use the ORDER BY clause to sort the salaries in descending order
Use the LIMIT clause to retrieve the second row
Q5. Differentiate between Sessions and Cookies
Sessions store data on the server side while cookies store data on the client side.
Sessions store data on the server side, while cookies store data on the client side
Sessions are more secure as the data is stored on the server and not visible to the client
Cookies are stored on the client's browser and can be accessed and modified by the client
Sessions are typically used to store sensitive information like user credentials, while cookies are used for tracking user behavior or ...read more
Q6. Lifecycle hook of angular
Lifecycle hooks in Angular are methods that allow you to tap into the lifecycle of a component or directive.
Lifecycle hooks include ngOnInit, ngOnChanges, ngDoCheck, ngOnDestroy, etc.
ngOnInit is used for initialization logic, ngOnChanges is used for reacting to input changes, ngOnDestroy is used for cleanup tasks, etc.
Example: ngOnInit() { console.log('Component initialized'); }
More about working at Virtusa Consulting Services
Top HR Questions asked in Recipharm Pharmaservices
Interview Process at Recipharm Pharmaservices
Top Associate Consultant Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month