Interview Questions and Answers - Order By Newest Q1931. Have you worked with JSF ? General
This question was recently asked at 'Spillman Technologies'.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 Q1932. How long will it take for you to join Canopy ? General
This question was recently asked at 'Canopy Tax'.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 Q1933. What is the Big O notation for Fibonacci series - both iterative as well as recursive ? Algorithm
This question was recently asked at 'Canopy Tax'.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  Big o Notation   Asked in 1 Companies expert Q1934. Write code to see if a Linked List has cycle in it ?
or
Write code using Floyd Algorithm to see if a linked list has cycle in it ? What is it's comlexity ? Algorithm
Ans. public class LinkedList {
Node start = null;
Node head = null;
class Node {
Integer body;
Node nextNode;
Node(Integer value) {
body = value;
}
}
public static void main(String[] args) {
LinkedList ll = new LinkedList();
ll.addNodeToEnd(5);
ll.addNodeToEnd(10);
ll.addNodeToEnd(15);
ll.traverse();
if(checkIfLoop(l1)){
System.out.println("There is a Loop");
} else {
System.out.println("No Loop");
}
}
private boolean checkifLoop(Test l1) {
Node slow = start;
Node fast = start;
Node faster = start;
while(slow != null ) {
fast = slow.nextNode;
faster = fast.nextNode;
if(slow == fast || slow == faster) {
return true;
}
slow = slow.nextNode;
}
return false;
}
}
Complexity of this algorithm is O(n) Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  LinkedList  Cyclic LinkedList Q1935. What is the access time for ArrayList and LinkedList ? Data Structure
Ans. O(1) for ArrayList
O(n) for LinkedList Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 2 Companies Q1936. What is the runtime complexity of appending strings to string object and Why ? Algorithm
Ans. O(n^2) because each time a string is appended a new String is created and it runs through all the letters to copy them over. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q1937. Design an algorithm and write code to remove the duplicate characters in a string without using any additional buffer. Algorithm
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   Q1938. Write a method that returns maximum depth of a tree ? Algorithm
This question was recently asked at 'One Click Retail'.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  tree  data structure  maximum depth of tree Asked in 1 Companies Q1939. Given a sorted array, write an algorithm to create a binary tree. Algorithm
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   Q1940. Difference between Left and Inner Join ? SQL
This question was recently asked at 'Canopy Tax,Cogent Infotech Corp'.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  sql Asked in 2 Companies Q1941. Write a method that takes a string as input and identifies if any permutation of the String is Palindrome ? For example - ttoobb has a permutation 'bottob' which is a palindrome. Design
This question was recently asked at 'Canopy Tax'.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 expert Q1942. Given a list of People, We need to distribute their gifts in such a way that
Any Person shouldn't get it's gift back
If A's gift goes to B, B's gift shouldn't go to A
Write a method that returns a Map where Key is the Person's name and value is the name of person whose gift was exchanged. Design
This question was recently asked at 'Canopy Tax'.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 Q1943. What is the difference between time and space complexity ? Algorithm
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   Q1944. Which data structure would you use to implement LRU cache and Why ? Can you tell me the time complexity for it ? Algorithm
Ans. We can use LinkedHashMap as it will give time complexity of O(1) for lookup and We can maintain the insertion order to identify the Last used elements for eviction. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  LRU Cache Asked in 1 Companies Q1945. What is the difference between Observer and Subscriber ? Design
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  Design Patterns 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   Q1947. Have you heard of reactive extensions ? ReactiveX
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   Q1948. What are the drawbacks of Reactive extensions ? ReactiveX
Ans. Reactive extensions have a steep learning curve which makes it confusing for beginner and intermediate developers. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  RxJava  ReactiveX  Reactive Programming Q1949. What can we do if we need to retrieve Fibonacci value at a particular index faster ? Can we use Linked List ? Data Structure
This question was recently asked at 'Canopy Tax'.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  LinkedList Asked in 1 Companies Q1950. Sort a List of Objects using comparable and comparator Core Java
This question was recently asked at 'HCL Technologies'.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 Q1951. what is parallel array sorting? Algorithm
Ans. Java provides a new additional feature in Array class which is used to sort array elements in parallel.New methods have been added to the java.util.Arrays package that use the JSR 166 Fork/Join parallelism common pool to provide sorting of arrays in parallel.
The methods are called parallelSort() and are overloaded for all the primitive data types and Comparable objects. 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 'American Express'.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 Q1953. How can java script access a database ? JavaScript
This question was recently asked at 'American Express'.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 Q1954. Which statement is used to exit a function in java script ? JavaScript
Ans. return Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 1 Companies Q1955. What is the difference between save() and persist() in hibernate ? Hibernate
This question was recently asked at 'IBM'.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 Q1956. What is the use of @Import and @ImportResource anotations ?
Ans. The @Import annotation is used to import one or more @Configuration classes. This annotation provides the functionality equivalent to element in xml based configuration.
The @ImportResource annotation is used to import one or more XML configuration files. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  annotations Asked in 1 Companies Q1957. What is difference between url based and component based web application ? J2EE
This question was recently asked at 'Newgen technologies'.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 Q1958. Why did you chose programming as your career ? General
Ans. I was always fascinated by mathematics and statistics and hence chose programming as I found It to be fit ground for utilizing those skills. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 1 Companies Q1959. How can we make sue that only 1 object gets created ? Design
Ans. We can use Singleton Design Pattern. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  singleton Asked in 1 Companies Q1960. Why do want to leave your current job ? General
This question was recently asked at 'Spillman Technologies'.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