Search Interview Questions | More than 3000 questions in repository. There are more than 900 unanswered questions. Click here and help us by providing the answer. Have a video suggestion. Click Correct / Improve and please let us know. |
|
| ||||
Interview Questions and Answers - Order By Newest | ||||
| ||||
Ans. BlockingQueue is a Queue that supports operations that wait for the queue to become non-empty when retrieving and removing an element, and wait for space to become available in the queue when adding an element. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  blockingqueue   collections   java   concurrent collections Asked in 10 Companies | ||||
This question can be asked in different variants like performace improvement of an application, improving performance for DB communication etc. | ||||
| ||||
Ans. This depends on entirely upon the code type. For example 1.If its just logic, we can try it to short circuit or put the if / switch case with maximum probability in the beginning. 2. Can use faster data structures, for eg - random retrieval instead of sequence / iterator 3. Working with primitive types or even bytes instead of Objects, even though it may result in marginal improvement. 4. If its service call, then service call with bulk load can help 5. If DB Operation, then with use of Indices , Views or using ORM , cache etc. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  performance improvement  code optimization Asked in 1 Companies | ||||
| ||||
This question was recently asked at 'Myntra,Compro 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 2 Companies | ||||
| ||||
Ans. class A { void test() { System.out.println("test() method"); } } class B { void test() { System.out.println("test() method"); } } Suppose if Java allows multiple inheritance like this, class C extends A, B { } A and B test() methods are inheriting to C class. So which test() method C class will take? As A & B class test() methods are different , So here we would Facing Ambiguity. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  multiple inheritance  object oriented programming (oops)  oops concepts  diamond problem Asked in 20 Companies basic   frequent | ||||
| ||||
Ans. Cloud Computing is a way of using IT infrastructure with following traits - 1. On Demand Infrastructure 2. Broad Network Access 3. Resource Pooling 4. Rapid Elasticity 5. Measured Service | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  google cloud platform (GCP)  Amazon Web Services (AWS | ||||
| ||||
Ans. Warm up time for certain technologies like Java ( JVM Warmup ) Performance Size of Deployable ( Bigger size packaging should go in S3 ) | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  serverless technologies  aws lambda  aws serverless computing  amazon cloud serverless computing  amazon lambda Asked in 1 Companies | ||||
| ||||
Ans. In AWS Lambda we can run a function in synchronous or asynchronous mode. In synchronous mode, if AWS Lambda function fails, then it will just give an exception to the calling application. In asynchronous mode, if AWS Lambda function fails then it will retry the same function at least 3 times.If AWS Lambda is running in response to an event in Amazon DynamoDB or Amazon Kinesis, then the event will be retried till the Lambda function succeeds or the data expires. In DynamoDB or Kinesis, AWS maintains data for at least 24 hours. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  aws lambda  aws serverless computing  amazon cloud serverless computing  amazon lambda | ||||
| ||||
Ans. Because it gives the ability to provision infrastructure on Demand with No contracts and strings attached. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  Amazon Web Service (AWS)   Google Cloud Platform (GCP) | ||||
| ||||
Ans. If the computation required is Spiky and unpredictable. If it's first time use. If the lifespan of the application isn't known. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  aws ec2  aws computing  amazon cloud computing  amazon ec2 | ||||
| ||||
Ans. If the usage is non continuous and have flexible start and End Time. For ex - Analysis , Research , mining etc. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  aws ec2  aws computing  amazon cloud computing  amazon ec2 spot | ||||
| ||||
Ans. On Demand Reserved Spot Dedicated Host | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  aws ec2  aws computing  amazon cloud computing  amazon ec2 | ||||
| ||||
Ans. Keeping Low cost for processing , i would choose Spot Price Plan F1 or P3 Instance Type Cold Hdd (SCI ) EBS Volume | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  aws ec2  aws computing  amazon cloud computing  amazon ec2 | ||||
| ||||
Ans. Computation Spot Price Plan F1 or P3 Instance Type Cold Hdd (SCI ) EBS Volume Storage S3-IA | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  aws computation  aws ec2  aws computing  amazon cloud computing  amazon ec2 | ||||
| ||||
Ans. We can assign multiple security groups to single instance and we can use single security group with multiple instances. It never results in conflict as security groups only have allow rules and no deny rules. Multiple security groups for an instance results in union of all rules. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  aws ec2  aws computing  amazon cloud computing  amazon ec2  aws security group | ||||
| ||||
Ans. JSON is "JavaScript Object Notation", primarily used for client-server or server-server communication. Its a much lighter and readable alternative to XML. JSON is language independent and is easily parse-able in all programming languages. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  json   markup language   client server communication Asked in 26 Companies basic   frequent | ||||
Try 2 Question(s) Test | ||||
| ||||
Ans. One can import the same package or same class multiple times. Neither compiler nor JVM complains wil complain about it. And the JVM will internally load the class only once no matter how many times you import the same class. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   import   jvm   advanced Asked in 1 Companies intermediate   rare | ||||
| ||||
Ans. Enables the programmer to abbreviate the names of classes defined in a package. | ||||
Sample Code for import | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   import   java keyword | ||||
| ||||
Ans. By static import , we can access the static members of a class directly without prefixing it with the class name. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   java5   static import   static   java keyword   static import Asked in 4 Companies basic   frequent | ||||
Frequently asked to fresh graduates. | ||||
| ||||
Ans. Its an interpretor. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   jvm   compiler   interpretor basic   frequent | ||||
| ||||
Ans. Externalizable interface is used to write the state of an object into a byte stream in compressed format. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   oops   serialization   externalizable interface   interface Asked in 3 Companies | ||||
| ||||
Ans. Collections class is a utility class having static methods for doing operations on objects of classes which implement the Collection interface. For example, Collections has methods for finding the max element in a Collection. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   collections   collections class   collection interface   basic interview question Asked in 6 Companies basic   frequent | ||||
Try 1 Question(s) Test | ||||
| ||||
Ans. sockets, RMI. EJB | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   distributed computing   rmi   ejb   sockets   socket   architecture | ||||
| ||||
Ans. applets Client component like Client side Java codes. Web component like JSP, Servlet WAR Enterprise JavaBeans like Session beans, Entity beans, Message driven beans Enterprise application like WAR, JAR, EAR | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   j2ee   j2ee components | ||||
Frequently asked in CTS ( Based on 2 feedback ) | ||||
| ||||
Ans. Comparable interface is used for single sequence sorting i.e.sorting the objects based on single data member where as comparator interface is used to sort the object based on multiple data members. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   java.util   comparable   comparator   collections Asked in 23 Companies basic   frequent | ||||
| ||||
Ans. Yes, it is possible by using a static block in the Java program. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   main   static block   compile   yes-no | ||||
| ||||
Ans. Externalizable is an interface which contains two methods readExternal and writeExternal. These methods give you a control over the serialization mechanism. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   serialization   externalizable interface Asked in 2 Companies intermediate   rare | ||||
| ||||
Ans. private static boolean isPalindrome(String str) { if (str == null) return false; StringBuilder strBuilder = new StringBuilder(str); strBuilder.reverse(); return strBuilder.toString().equals(str); } | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   string   stringbuilder   stringbuilder   string class   code   palindrome Asked in 38 Companies Basic   frequent | ||||
| ||||
Ans. public void checkIfAnagram(String str1,String str2){ boolean anagram = true; for(char c:str1.toCharArray()){ if(!str2.contains(String.valueOf(c))){ System.out.println("Strings are Anagrams"); anagram = false; } if(anagram == true){ System.out.println("Strings are not Anagrams"); } } } | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve   check if 2 strings are Anagrams Asked in 30 Companies basic   frequent | ||||
| ||||
Ans. import static java.lang.System.*; | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   static import   generics   import   OCJP   SCJP   Oracle certified java developer Asked in 1 Companies | ||||
| ||||
Ans. These are the tables that are created temporarily and are deleted once the Stored Procedure is complete. For example - we may like to pull some info from a table and then do some operations on that data and then store the output in final output table. We can store the intermediary values in a temp table and once we have final output with us, we can just delete it. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  database   sql   temp tables   tables | ||||