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.
Ans. In terms of compute options and configurations, Reserved Instances and On Demand instances are the same. The only difference between the two is that a Reserved Instance is one you rent (reserved) for a fixed duration, and in return you receive a discount on the base price of an On Demand instance.
Help us improve. Please let us know the company, where you were asked this question :
Ans. We can create API gateway and give the name of lambda function in order to be linked with lambda function, deploy the API and whenever request will be made from API it will directly be linked to lambda function to perform further process.
Help us improve. Please let us know the company, where you were asked this question :
Q484. Why do we need to specify import statement ? Don't you think Java could have been designed in such a way to automatically import everything that's in the class path ?
Ans. Java could design it in such a manner but would result in ambiguity if there are multiple files with the same name. The only way to get over it to show the message when you use any such class to provide explicit import with the package prefix. The other problem could be that Java might have to change the early import to Late import and check what's being used to decide what needs to be imported as otherwise you will see errors regarding the ambiguous imports with duplicate file name.
Help us improve. Please let us know the company, where you were asked this question :
Ans. Encapsulation facilitate hiding and restricted access and hence more of a security feature. Encapsulation is definitely a great feature as when applications expand criss cross communication between objects / modules could lead to blunders.
Inheritance facilitates code reuse.
Polymorphism comprise of method overloaded ( which to me is negligible usage ) and method overriding. Method overriding is of great usage as it facilitates concept of interfaces and plugin development.
So it’s Security / Organization vs
Code Reuse / Support for other features like overriding vs
Contracts / Plugin Development facilitating the creation of frameworks / libraries.
Which is more important may vary from application to application , its scale , its use , its sensitivity etc.
Help us improve. Please let us know the company, where you were asked this question :
Ans. No. The whole idea of default method is to provide a default definition in case the implementing class intend to provide definition for only some of the methods. Making any of the interface method private would restrict it from being implemented by the implementing class. So default method is an option to provide implementation and not restricting a new definition.
Help us improve. Please let us know the company, where you were asked this question :
Ans. Yes, to a certain extent. But the objective for Final class could be beyond just enforcing composition as certain classes might have been created without inheritance or composition in mind.
Help us improve. Please let us know the company, where you were asked this question :
Ans. 1. Enforcing composition over inheritance
2. Restricting overriding of certain methods
3. Final methods are faster than regular instance methods
4. Enforcing Immutability
Help us improve. Please let us know the company, where you were asked this question :
LikeDiscussCorrect / Improve  final class   reasons for final class   restricting inheritance  object oriented programming (oops)  oops concepts expert
Ans. OAuth is an open-standard authorization protocol or framework that describes how unrelated servers and services can safely allow authenticated access to their assets without actually sharing the initial, related, single logon credential. Like using Google or Facebook to login to something.
Help us improve. Please let us know the company, where you were asked this question :
Ans. IP authentication is very restrictive, if IP changes for some reason then getting the new IP white listed on the server firewall could run your day pretty long. I would prefer encrypted password authentication cause it is not affected by IP changes and not limited to a white listed IP, I could use any different machine and get through authentication without any hassle.
Help us improve. Please let us know the company, where you were asked this question :
Ans. Both Arrays and ArrayLists are used to store elements. Elements can be either primitives or objects in case of Arrays, but only objects can be stored in Arraylist. Array is a fixed length data structure while arraylist is variable length collection class. Once created, you cannot change the size of the arrays, but arraylists can dynamically resize itself when needed.Another notable difference between Arrays and Arrayslist is that arary is part of core java programming and array list is part of collection classes
Ans. Just like people , AWS resources too have execution roles or permissions. Seems like in such a situation Lambda function may not have sufficient privileges to perform operations on S3. For example - The execution role of Lambda may just have read permissions on S3 and we may be trying to perform PutObject operation.
Help us improve. Please let us know the company, where you were asked this question :
Ans. Abstract classes can take care of that to a certain extent. Though they are little heavier than Interfaces but An abstract class with all abstract methods and no instance variables will be able to help with everything that currently an interface does.
The only problem is that a class can only extend one class whereas it can implements multiple interfaces and that is the reason Interfaces were introduced in Java, i.e to get over the problem of multiple inheritance.
Help us improve. Please let us know the company, where you were asked this question :
Ans. Service ( EC2, Lambda etc )
AMI ( Operating System and Softwares )
Instance Type ( T,M, R etc )
EBS ( Volume Type , Size )
Price Class ( OnDemand, Dedicated etc )
Help us improve. Please let us know the company, where you were asked this question :