Barclays
Zones Corporate Solutions Interview Questions and Answers
Q1. How you will find the smallest of 4 numbers without using >.< and min function using java
Finding smallest of 4 numbers without using >.< and min function in Java.
Initialize a variable with the first number
Compare it with the remaining numbers using if-else statements
If a smaller number is found, update the variable
Repeat until all numbers are compared
The final value of the variable will be the smallest number
Q2. Swap two number without using temperory variable
Swap two numbers without using a temporary variable.
Use addition and subtraction to swap the values
Use XOR operator to swap the values
Use multiplication and division to swap the values
Q3. How you will add 2 table
To add 2 tables, we need to use a join operation on a common column.
Identify the common column between the tables
Choose the appropriate join type (inner, outer, left, right)
Write the SQL query to join the tables
Example: SELECT * FROM table1 INNER JOIN table2 ON table1.column = table2.column
Q4. Difference between union and union all
Union combines and removes duplicates, Union All combines all rows including duplicates.
Union is used to combine the result sets of two or more SELECT statements and remove duplicates.
Union All is used to combine the result sets of two or more SELECT statements and includes all rows, including duplicates.
Union is slower than Union All as it has to remove duplicates.
Union requires the same number of columns in all SELECT statements, while Union All does not.
Example: SELECT col...read more
Q5. Write a code for palindrome
Code for palindrome checking
Convert the input to lowercase to ignore case sensitivity
Use two pointers, one at the start and one at the end of the string
Compare the characters at both pointers and move them towards each other
If all characters match, it's a palindrome
Q6. Write any javascript code
Javascript code to display 'Hello World!' on the webpage
Create a new HTML file
Add a script tag with 'type' attribute set to 'text/javascript'
Inside the script tag, use document.write() to display 'Hello World!'
Q7. How does polymorphism work?
Polymorphism allows objects of different classes to be treated as objects of a common superclass.
Polymorphism allows for methods to be called on objects of different classes that share a common superclass.
It enables flexibility and extensibility in object-oriented programming.
Examples include method overriding in inheritance and interfaces in Java.
Q8. Sort an array rotated at some pivot
Sort an array that has been rotated at some pivot point.
Find the pivot point where the array is rotated.
Split the array into two subarrays based on the pivot point.
Sort each subarray individually.
Merge the sorted subarrays back together to get the final sorted array.
Interview Process at Zones Corporate Solutions
Top Software Engineer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month