Interview Questions and Answers - Order By Rating Q1531. 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 Q1532. 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 Q1533. 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 Q1534. 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 Q1535. 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 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 Q1537. 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 Q1538. What is the difference between Singleton and Prototype Bean scope in Spring ? Spring
Ans. Prototype scope - A new object is created each time it is injected/looked up. It will use new SomeClass() each time.
Singleton scope - It is the default scope. The same object is returned each time it is injected/looked up. Here it will instantiate one instance of SomeClass and then return it each time. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  Spring beans  singleton bean scope  prototype bean scope Asked in 1 Companies Q1539. 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 Q1540. 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 Q1541. 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 Q1542. 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 Q1543. 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 Q1544. 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 Q1545. 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 Q1546. 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 Q1547. 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 Q1548. 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 Q1549. 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 Q1550. 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 Q1551. 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 Q1552. 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 Q1553. 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 Q1554. 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 Q1555. 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 Q1556. 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 Q1557. 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 Q1558. 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 Q1559. 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 Q1560. If a Map needs to be accessed simultaneously by multiple threads, which collection class should be used ? Core Java
Ans. ConcurrentHashMap Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  map  concurrenthashmap  multithreading