ITC Infotech
Belco Pharma Interview Questions and Answers
Q1. Difference between String builder and String buffer
String builder is not synchronized, while String buffer is synchronized.
String builder is faster than String buffer because it is not synchronized.
String buffer is thread-safe, while String builder is not.
String builder is preferred for single-threaded applications, while String buffer is preferred for multi-threaded applications.
Q2. Select 3 rd highest salary from employee table
To select the 3rd highest salary from the employee table, you can use a SQL query with the 'LIMIT' and 'OFFSET' keywords.
Use a SQL query like 'SELECT salary FROM employee ORDER BY salary DESC LIMIT 1 OFFSET 2' to get the 3rd highest salary.
The 'ORDER BY' clause sorts the salaries in descending order, 'LIMIT 1' limits the result to 1 row, and 'OFFSET 2' skips the first two rows.
Make sure to adjust the 'OFFSET' value if you want to find the nth highest salary.
Q3. difference between == and equals in string
The == operator checks for reference equality, while the equals method checks for value equality in strings.
Use == to check if two string variables refer to the same object in memory.
Use equals() method to check if two string variables have the same sequence of characters.
Example: String str1 = "hello"; String str2 = "hello"; str1 == str2 will return false, but str1.equals(str2) will return true.
Q4. Difference between put and patch
Put is used to create or replace a resource, while patch is used to update a resource partially.
Put is idempotent, meaning multiple identical requests will have the same effect as a single request
Patch is not idempotent, as multiple identical requests may have different effects
Put requires the client to send the entire updated resource, while patch only requires the specific changes to be sent
Q5. Difference way of declaring String
String can be declared using double quotes, single quotes, or the String constructor.
Declare using double quotes: String str1 = "Hello";
Declare using single quotes: String str2 = 'World';
Declare using String constructor: String str3 = new String("Java");
Q6. Convert array into arraylist
Convert array to ArrayList of strings
Create a new ArrayList
Use Arrays.asList() method to convert array to ArrayList
Example: String[] array = {"apple", "banana", "orange"}; ArrayList
list = new ArrayList<>(Arrays.asList(array));
Interview Process at Belco Pharma
Top Quality Assurance Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month