Interview Questions and Answers - Order By Newest Q2011. Given a collection of Employee objects, how can we get the customers with name starting with 'A' using lambda expression. Core Java
Ans. List emp = Arrays.asList("American", "Indian", "Finn");
emp.stream().filter(em -> em.startsWith("A")).forEach(System.out.println); Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  java8  java 8  lambda Asked in 1 Companies Q2012. What is the difference between stream and parallel stream ? Core Java
Ans. streams are used for sequential processing of data and parallel streams are used for parallel processing of data (only if the underlying processor is multicore). Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  stream vs parallel stream  stream  parallel stream Asked in 1 Companies Q2013. Difference between stateless and stateful rest services ? Rest
This question was recently asked at 'Sofi'.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  rest services  stateful rest service  stateless rest service Asked in 1 Companies Q2014. How can we makes sure that message has been consumed properly from Kafka ? Apache Kafka
Ans. We can have a mechanism to send the conformation back to Kafka so that Kafka can do offset only after receiving the confirmation. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  apache kafka  kafka  kafka consumer Q2015. What are the advantage of Abstract classes over interfaces with respect to Java 7 ? and What changed in Java 8 to help facilitate that in Java 8 ? Core Java
Ans. Abstract Classes provide default implementations of methods that are inherited by the classes that extend them, which was not the case for Interfaces. This changed in Java 8, where default implementations are provided for methods. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  abstract classes  interfaces  default method Asked in 1 Companies expert Q2016. Explain Hibernate Validation ? Hibernate
This question was recently asked at 'Sofi'.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  hibernate  hibernate validation Asked in 1 Companies Q2017. Which validation frameworks have you worked on ? Frameworks
This question was recently asked at 'Sofi'.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  validation frameworks Asked in 1 Companies Q2018. Can we mock static methods ? Testing
Ans. Yes we can use PowerMock. With Mockito , we cannot mock static methods. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  mocking fraeworks  mocking static methods  mockito Q2019. Kafka has a deliver atleast once default Policy, What are the other policies that can be configured with Kafka ? Apache Kafka
Ans. Exactly once and At Max Once Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  kafka Q2020. Is Cassandra read optimized or Write optimized ? Cassandra
Ans. Read optimized Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  cassandra Asked in 1 Companies Q2021. How Cassandra provides better Read performance than Oracle Indices ? Database
Ans. Cassandra uses Hash Search which provides a look time of O(1) whereas Oracle Indices uses Binary Search that provide a lookup time of O(Log n). Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  cassandra  hash search  hash search vs binary search Q2022. How different is the Search algorithm when we query Cassandra Tables and When we query Oracle Tables ? Cassandra
Ans. Relational Database uses linear search if we don't query using indices. Performance for linear search is O(n). If indices have been used , relational database uses binary search. Performance for binary search is O(Log n).
Casandra uses hash search. Performance for Hash Search is O(1). Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  cassandra vs oracle  nosql vs relational  search algorithm Q2023. Can we query Cassandra Tables without specifying the partition id in the where clause ? Cassandra
Ans. No. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  cassandra Q2024. What are the restrictions on querying Cassandra Tables ? Cassandra
Ans. Cassandra Tables can only be queried using the partition key and then cluster keys, so all queries should have partition key for sure. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  cassandra Asked in 1 Companies Q2025. Difference between Normalization and Denormalization ? Database
Ans. Normalization is the process of splitting one Table into multiple so as to avoid Data duplication whereas Denormalization is the process of reducing Tables that creates data duplication but would remove joins in the queries. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  normalization  denormalization  normaization vs denormalization Asked in 1 Companies Q2026. Which of the two Normalization / Denormalization facilitate better performance ? Which of the two facilitate better space management ? Database
Ans. DeNormalization facilitate better performance. Normalization remove data duplication and hence facilitate better database space management. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  normalization  denormalization  normalization vs denormalization Q2027. Which of the following databases - Cassandra / Oracle - provides more flexibility about querying the database ? Database
Ans. Oracle as it is not modeled for a particular query or set of queries. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  Cassandra  Nosql database  nosql vs relational database Q2028. What could be the driving force to have dependencies injected through class than through config file while using IOC or Dependency Injection ? Design
Ans. Unit Testing Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  dependency injection  inversion of control Q2029. Which is the best NoSql Database for Performance ? NoSql
Ans. Possible Answer - doument base - monogodb Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  Nosql Database Q2030. Why was Cassandra written in Java and not C++ ? Cassandra
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  cassandra Q2031. Why do we use Thread Class as well as Runnable Interface for creating threads in Java ? 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  Threads  Thread class  runnable interface Q2032. Why can we have a static inner class but not a static Top level class in Java ? 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  static class  inner classes   nested classes Expert   rare Ans. We are using EC2 and Lambda for computing, RDS for Database , S3 for Storage , SQS and Kinesis for streaming and queue and CloudWatch for monitoring. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  aws  aws components Q2034. If a team member send you the code for review which you don't agree to but is just slightly off , Would you approve it or reject it ? General
This question was recently asked at 'Sofi'.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  code review Asked in 1 Companies Q2035. How do you keep yourself aupdated with the changes in technologies ? General
This question was recently asked at 'Sofi,Overstock.com,General Electric (GE)'.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 3 Companies Q2036. Design a Database Schema to store Employee Information with each employee having multiple addresses. Database
Ans. We can have 2 entities i.e EMPLOYEE and ADDRESS and can have a relationship Table , EMPLOYEE_ADDRESS having one to may relationship between the two. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  database schema   design Asked in 2 Companies Q2037. Write a SQL to find 2nd Max value in a Table. Database
Ans. SELECT MIN(FIELD) FROM (SELECT TOP 2 FIELD FROM TABLE ORDER BY FIELD DESC)
or
SELECT MAX(FIELD) FROM TABLE WHERE FIELD NOT IN (SELECT MAX(FIELD) FROM TABLE) Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  sql Q2038. How do you use Mock frmaework to test webservices in any of your previous project ? Testing
Ans. We were having client methods to call web services and were mocking the client method call using Mockito. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  mocking  testing  mockito Q2039. How would you describe your current or previous Boss ? General
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   Q2040. Write a Program to print fibonacci series using recursion. Core Java
Ans. public class FibonacciUsingRecursion {
public static void main(String[] args) throws IOException{
getNextFibanocci(1,1);
}
static int getNextFibanocci(int a,int b){
if(a+b >= 100){
return 0;
} else {
System.out.println(a+b);
getNextFibanocci(b,a+b);
}
return 0;
}
} Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  fibonacci  recursion