Interview Questions and Answers - Order By Rating Q301. What are FPGA's ?
This question was recently asked at 'Intel'.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 Q302. 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 Q303. 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 Q304. 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 Q305. What is the time complexity and space complexity of reversing a Linked List ? Data Structure
Ans. o(n) for time complexity
o(1) for space complexity Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q306. Write a program to find the 10th prime number. Ruby
Ans. def isPrimeNumber(n):
if(n<=1):
return False:
for i range(2,n):
if(n%i==0):
return False
return True
n=isPrimeNumber(11)
print(n) Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   This question was recently asked at 'Fujitsu'.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 Q308. How do you achieve String immutability ? Core Java
This question was recently asked at 'Polaris'.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 Q309. Are there any advantages of associating a ticket id ( like Jira id ) with the code commit ?
Ans. Yes.
We can identify the commits to be rolled back if we have to roll back a particular feature. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q310. Can we override behavior of a collection class ? How ? Core Java
Ans. Yes. We can do that.
1. We can create own own implementation class extending the collection class and then override the behavior method.
2. We can override the behavior at the time of instantiation of class as following
List<MyType> list = new ArrayList<MyType>() {
public boolean add(MyType mt) {
super.add(mt);
Collections.sort(list, comparator);
return true;
}
}; Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  collections Q311. Explain Rest architecture Rest
This question was recently asked at 'Motorola Solutions,DXC Technology'.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 Q312. What is Spring Security in Detail ?
This question was recently asked at '3i Infotech'.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 Q313. Explain unix commands - cat and pwd. Unix
Ans. by using Cat command we can open and see the file content and as well as redirect the file content to another files
pwd command shows us current working path of the server
cat filename | tail -100
cat file name > filname1 Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 1 Companies Q314. What is the difference between map and filter methods in streams ? Core Java
Ans. By using map , you can transform the object values. The map operation allows us to apply a function, that takes input parameter of one type, and returns something else.
Filter is used for filtering the data, it always returns the boolean value. If it returns true, then item is added to list else its filtered out (ignored) Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java 8 Asked in 1 Companies Q315. What is the logic behind the shuffle in Music player ?
or
Explain Music player shuffle algorithm. Algorithm
This question was recently asked at 'ASG Sweden'.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 Q316. Explain memory leaks and how to prevent them.
This question was recently asked at 'Polaris'.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  memory leak Asked in 1 Companies This question was recently asked at '360Degree'.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 Q318. How many objects are created when we define a bean with two different name in spring? Spring
Ans. we wont create the objects because of each and every bean will be an object Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 1 Companies Q319. what annotation do in background in hibernate ? Hibernate
This question was recently asked at 'Cdac Pune'.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. Message queues implement an asynchronous communication pattern between two or more processes/threads whereby the sending and receiving party do not need to interact with the message queue at the same time. Messages placed onto the queue are stored until the recipient retrieves them. Message queues have implicit or explicit limits on the size of data that may be transmitted in a single message and the number of messages that may remain outstanding on the queue. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  message queue Asked in 1 Companies Q321. What are closures ?
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   Q322. What are the difference between "resetting" and "normalizing" CSS? CSS
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   Q323. How to track immediate parent of the child in selenium using xpath? Selenium
Ans. Using ./ Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 1 Companies Q324. Why Spring boot is preferred over Spring MVC ?
Ans. Spring Boot aims to shorten the code length and provide you with the easiest way to develop a web application. It helps create a stand-alone application with less or almost zero-configuration. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 1 Companies Q325. difference between the agile model and v model.
Ans. Agile Model:
Agile Model is the software development model in which development and testing process carries on simultaneously. In this model, both development related processes and testing related processes are parallel. This model provides the facility of more interaction between development team, testing team and end-users.
V-Model:
V-Model is the software development model in which testing takes place once the development process is fully complete or almost complete. In V-Model development and testing process are kept quite separate. It is not as reliable as Agile Model. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 1 Companies Q326. Does spaces get's encoded in html encoding ? Encoding
Ans. Yes they get html encoded. i.e instead of empty space. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q327. What is the difference between html encoding and url encoding ? Encoding
Ans. HTML Encoding escapes special characters in strings used in HTML documents whereas url Encoding replaces special characters with characters so that they can sent within url. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q328. Can you share your experience with encoding and encryption ? Encoding
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  encoding  encryption Q329. Can we change permissions recursively for all folders and files within a single folder ? Unix
Ans. chmod 777 -R /directory Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  Unix Commands Q330. How do you ftp files to a different server ? Do you use scp or mput etc. Unix
Ans. I use both mput as well as scp. mput usually with sftp Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  unix commands  ftp