Interview Questions and Answers for 'Mp' | Search Interview Question - javasearch.buggybread.com
Javasearch.buggybread.com

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.
Label / Company      Label / Company / Text

   



Interview Questions and Answers - Order By Newest

   next 30
 Q41. What is a BlockingQueue?Data Structures
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.
 Q42. What are the ways in which execution time of the code can be improved ?Solution
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


 Q43. Write a Program to reverse a Linked List ?Data Structure
 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


  Q44. Why java doesn't support multiple Inheritance ?

or

Explain Java Diamond Problem.
Core Java
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


 Q45. What is cloud computing ?Cloud Computing
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


 Q46. What are the problems one could face while working with serverless technologies like AWS Lambda ?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


 Q47. How does AWS Lambda handle failure during event processing?Amazon Web Services (AWS)
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


 Q48. Why is cloud infrastructure so powerful ?Cloud Computing
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)


 Q49. What is the use case for "On Demand" EC2 ?Amazon Web Services (AWS)
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


 Q50. What is the use case for "Spot" EC2 plan ?Amazon Web Services (AWS)
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


 Q51. What are the different price options available for EC2 ?Amazon Web Services (AWS)
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


 Q52. What EC2 configuration would you use if you have to use it for Bitcoin mining ?Amazon Web Services (AWS)
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


 Q53. Which AWS services would you use if you have find a cheapest solution for an analytics application ?Amazon Web Services (AWS)
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


 Q54. Can a EC2 instance have multiple Security Groups ? Can a single security group be assigned to multiple Ec2 instances ? If either of them is true , doesn't it result in conflict ?Amazon Web Services (AWS)
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


  Q55. What is JSON ?Json
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


 Q56. Can I import same package/class twice? Will the JVM load the package twice at runtime?Core Java
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


 Q57. What is "Import" used for ?Core Java
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


 Q58. What is a Static import ?Core Java
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.
 Q59. Is JVM, a compiler or interpretor ?
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


 Q60. What is an Externalizable interface ?
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


  Q61. what is the difference between collections class vs collections interface ?Core Java
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


 Q62. What are some Java related technologies used for distributed computing ?
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


 Q63. What are the components of J2EE ?
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 )
  Q64. What is the difference between comparable and comparator in java.util pkg?Core Java
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


 Q65. Is it possible to compile and run a Java program without writing main( ) method?
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


 Q66. What is Externalizable interface?Core Java
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


  Q67. Write a method to check if input String is Palindrome?Core Java
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


  Q68. Write a Program to check if 2 strings are Anagrams ?Core Java
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


 Q69. Which of the following syntax is correct ?import static java.lang.System.*;or static import java.lang.System.*;Core Java
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


 Q70. What are temp tables ?
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


previous 30   next 30

Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked: