Interview Questions and Answers - Order By Newest Q1891. Write a SQL to remove records with a duplicate field in a Table ? Database
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  sql Asked in 1 Companies Q1892. How can we make sure that we don't receive duplicate messages from the Kafka Topic ? Apache Kafka
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  kafka Q1893. 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 Q1894. 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 Q1895. 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 Q1896. 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 Q1897. 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 Q1898. 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 Q1899. 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 Q1900. 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 Q1901. 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 Q1902. 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 Q1903. 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 Q1904. 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 Q1905. 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 Q1906. 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 Q1907. 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 Q1908. 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 Q1909. 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 Q1910. 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 Q1911. 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 Q1912. 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 Q1913. 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 Q1914. 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 Q1916. 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 Q1917. 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 Q1918. 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 Q1919. 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 Q1920. 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