Interview Questions and Answers - Order By Rating Q211. what is green threads
This question was recently asked at 'HSBC Technology India'.This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 1 Companies Q212. what is dynamic method dispatch
This question was recently asked at 'HSBC Technology India'.This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 1 Companies Ans. SNMP or Simple Network Management protocol is an application layer protocol for exchanging management information between network devices.
Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 15 Companies Q214. If you are given choice to either load object eagerly or lazily , which one would you use in case of singleton pattern ? Design
Ans. I would choose Eager as the cost for 1 additional object is too minute for any such consideration.
Eager Loading results in Faster access ( Object available at load time) at the cost of additional space.
Lazy loading results in space saving ( Object available at first use ) at the cost of access speed. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  design Pattern  Singleton  Lazy vs Eager Loading Q215. What can be done to protect the application from DDOS attack ? Security
Ans. We can set the max number of requests from a given IP or an IP range
We can set the time out so that a single request cannot hold on to resources for too long.
We can identify patterns ( like too many requests from single IP for single page ) and then block such requests. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  DDOS  security vulnerability Q216. how to switch to the parent webpage?
This question was recently asked at 'Walmart'.This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 1 Companies Q217. What is the programming language used to build Jenkins? Jenkins
Ans. There is a diverse set of programming languages used in Jenkins, including but not limited to: Java, JavaScript, Groovy, Golang, Ruby, Shell scripts Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 1 Companies Q218. Difference between merge and update in hibernate Hibernate
This question was recently asked at 'Nucleus Software'.This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 1 Companies Ans. class:- A class describe the contents of an object, an it describe the detail of data field called instance variable and defines the operations called method.
Object:-An object is an element of a class. Object have the behaviors of their class. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 1 Companies Q220. How to get collections from a Stream Core Java
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  Java 8 Q221. Explain switch and router
This question was recently asked at 'Reliance Jio'.This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 1 Companies Ans. Private, Public, Hybrid, Community Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  Google Cloud Platform (GCP) Asked in 1 Companies Q223. Can anonymous class implement interface and extend a class Core Java
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q224. What is ServerSocket in Java ? Core Java
Ans. This class implements server sockets. A server socket waits for requests to come in over the network. It performs some operation based on that request, and then possibly returns a result to the requester. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q225. What are the distinguished qualities in Java that no other language possess ? Core Java
Ans. Java is widely adopted as an enterprise standard technology across business domains and technical domains ( Web , Desktop , mobile , data science etc ) and has a vast ecosystem of frameworks and libraries. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q226. What is headless mode in Java ? Why is it used ? Core Java
Ans. It’s a mode that can be used for creating Back end application without the front end UI.
The advantage is that it reduces the number of packages that needs to be loaded ( by ignoring ui packages ) Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java headless Q227. Write a code to detect the longest palindromic substring Core Java
This question was recently asked at 'Google'.This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 1 Companies Q228. What are the ways we can get over XSS or cross site scripting vulnerability ? Security
Ans. The counter measures of XSS are input validation and implementing a CSP (Content Security Policy). Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  Cross Site Scripting  XSS Asked in 1 Companies This question was recently asked at 'Unisys'.This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 1 Companies Q230. Write a program to make a triangle of stars.
This question was recently asked at 'Oracle'.This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 1 Companies Q231. If you are given a stack trace , what would you look for ?
This question was recently asked at 'Mcleod Software'.This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 1 Companies Q232. If you see a terrible code, Would you rewrite it. If yes , Why ?
This question was recently asked at 'McLead Software'.This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 1 Companies Q233. What would you do if your rest services aren't responding fast enough ? Rest
This question was recently asked at 'Symantec,Barclays'.This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 2 Companies Q234. What kind of deployable is created for the angular project ? Angular Js
This question was recently asked at 'Barclays'.This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 1 Companies This question was recently asked at 'Barclays'.This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  Google Cloud Platform (GCP)  Amazon Web Services (AWS) Asked in 1 Companies Q236. What is JUnitRunner ? JUnit
Ans. A JUnit Runner is a class that extends JUnit’s abstract Runner class and it is responsible for running JUnit tests. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 1 Companies Q237. What are the pros and cons of Lambda expressions ? Core Java
This question was recently asked at 'Number 8'.This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 1 Companies Q238. Write an algorithm to shift a linked list n positions. Data Structure
This question was recently asked at 'Amdocs'.This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 1 Companies Q239. Given 3 arrays - A, B and C, Write all elements from C that are a sum of 1 element from A and 1 from B.
For example -
A -[1,2,4,6]
B-[3,9]
C-[2,4,5,6,7,9,10,12,15]
Output - 4,5,7,9,15
Ans. public class MyClass {
static boolean binarySearch(int [] c, int start, int end, int value) {
while (start <= end) {
int mid = (start end) / 2;
if (c[mid] == value) {
return true;
}
if (c[mid] > value) {
end = mid - 1;
} else {
start = mid 1;
}
}
return false;
}
public static void main(String args[]) {
int [] a = new int[] {1,2,4,6};
int [] b = new int[] {3,9};
int [] c = new int[] {2,4,5,6,7,9,10,12,15};
for (int i = 0; i < a.length; i ) {
for(int j = 0; j < b.length; j ) {
int value = a[i] b[j];
boolean find = binarySearch(c, 0, c.length - 1, value);
if (find) {
System.out.print(value " ");
}
}
}
}
} Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 1 Companies Q240. Write a program to rotate a matrix. Core Java
Ans. public class Matrix {
public static void main(String[] args) {
int[][] matrix = {
{1, 2, 3},
{4, 5, 6},
{7, 8, 9}
};
Matrix.rotateMatrix(matrix);
for (int i = 0; i < matrix.length; i ){
for (int j = 0; j < matrix.length; j ){
System.out.print(matrix[i][j] " ");
}
System.out.println();
}
}
public static void rotateMatrix(int[][] matrix){
int row = matrix.length;
//first find the transpose of the matrix.
for (int i = 0; i < row; i ){
for (int j = i; j < row; j ){
int temp = matrix[i][j];
matrix[i][j] = matrix[j][i];
matrix[j][i] = temp;
}
}
//reverse each row
for (int i = 0; i< row; i ){
for(int j = 0; j< row/2; j ){
int temp = matrix[i][j];
matrix[i][j] = matrix[i][row - 1 - j];
matrix[i][row - 1 - j] = temp;
}
}
}
} Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 1 Companies