Interview Questions and Answers - Order By Rating Q751. 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 Q752. 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 Q753. 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 Q754. 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   Q755. What is the difference between subject and observable ? RxJava
Ans. Subject has state, it keeps a list of observers. On the other hand, an Observable is really just a function that sets up observation. While Subjects are Observables, Subjects also implement an Observer interface. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  RxJava  Design  Design Pattern Q756. What is the difference between Observer and Observable ? RxJava
Ans. Observable is emiting data and Observer is subscribing to catch the data Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  RxJava  Design  Deaign Pattern 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   Q758. 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 Q759. 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 Q760. 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   Q761. 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 Q762. 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 Q763. 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 Q764. 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   Q765. 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 Q766. What is the difference between pop and peek function of stack ? Data Structure
Ans. pop method pulls the top element from the stack and then move the top to the next element whereas peek only get the top element but doesn't move the top. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  stack Q767. Write a program to sort a stack in ascending order You should not make any assumptions about how the stack is implemented The following are the only functions that should be used to write this program: push | pop | peek | isEmpty 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  Data Structures Q768. How would you design a stack which, in addition to push and pop, also has a function min which returns the minimum element? Push, pop and min should all operate in O(1) time 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  Data Stricture   Big O Notation  time complexity Q769. Describe how you could use a single array to implement three stacks 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  Data Structure Q770. Write a Program to implement stack using LinkedList. Data Structure
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  Data Structure Q771. 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   Q772. 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   Q773. 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 Q774. 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 Q775. 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 Q776. 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 Q777. Explain your experience working on UI ? 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 Q778. Why you chose programming as your career ? 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 Q779. What methodology and technology stack do you use ? General
Ans. [Open Ended Answer]
Possible Answer - We are using Agile. We have daily standups, Bi weekly Backlog Grooming , Planning and Retrospective, We have a 2 week sprint and We use Jira for Scrum Management. We are using Java 8, Spring Boot, JSF , Apache Kafka , Soap as well as Rest Services. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 9 Companies Q780. Are you involved in getting business requirements ? General
This question was recently asked at 'Western Governors University (WGU)'.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