Search Interview Questions | ![]() ![]() Click here and help us by providing the answer. ![]() Click Correct / Improve and please let us know. |
|
| ||||
Interview Questions and Answers for 'Infrastructure' - 19 question(s) found - Order By Newest | ||||
| ||||
Ans. OOPs or Object Oriented Programming is a Programming model which is organized around Objects instead of processes. Instead of a process calling series of processes, this model stresses on communication between objects. Objects that all self sustained, provide security by encapsulating it's members and providing abstracted interfaces over the functions it performs. OOP's facilitate the following features 1. Inheritance for Code Reuse 2. Abstraction for modularity, maintenance and agility 3. Encapsulation for security and protection 4. Polymorphism for flexibility and interfacing | ||||
![]() | ||||
![]() ![]() ![]() ![]() ![]() ![]() | ||||
![]() | ||||
| ||||
Ans. Polymorphism means the condition of occurring in several different forms. Polymorphism in Java is achieved in two manners 1. Static polymorphism is the polymorphic resolution identified at compile time and is achieved through function overloading whereas 2. Dynamic polymorphism is the polymorphic resolution identified at runtime and is achieved through method overriding. | ||||
![]() ![]() | ||||
![]() | ||||
![]() ![]() ![]() ![]() ![]() ![]() | ||||
![]() | ||||
![]() | ||||
| ||||
Ans. String pool (String intern pool) is a special storage area in Java heap. When a string is created and if the string already exists in the pool, the reference of the existing string will be returned, instead of creating a new object and returning its reference. | ||||
![]() | ||||
![]() ![]() ![]() ![]() ![]() ![]() | ||||
![]() | ||||
![]() | ||||
| ||||
Ans. The operator instanceOf is used to verify if the specified object is the instance of specified class or interface. Syntax if(x instanceOf ABC) where x is an object reference and ABC could be a class name or interface name. The above statement will be true if x holds an object that is an instance of ABC or any of the child class of ABC or if x holds an object that implements ABC. instanceOf operator is used to verify in case of downcasting. For ex - DerivedClass extends BaseClass x is the reference of BaseClass but holds DerivedClass object ( Polymorphism ) There is an operation that is defined in Derived Class, let's say derivedClassMethod() We cannot call derivedClassMethod() directly using x as x is reference of BaseClass and not DerivedClass and hence can only access methods that are defined in BaseClass and overridden in derived class. Though we can cast it to DerivedClass as following ((DerivedClass)x).derivedClassMethod(); But it may throw ClassCastException in case x doesn't hold an instance of DerivedClass at that point. So before casting it to DerivedClass we may like to make sure that it is an instance of DerivedClass and hence won't throw ClassCastException. So we make a check for it if(x instanceOf DerivedClass) { ((DerivedClass)x).derivedClassMethod(); } | ||||
![]() | ||||
![]() ![]() ![]() ![]() ![]() ![]() | ||||
| ||||
Ans. Within message.properties file. | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
![]() | ||||
| ||||
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. | ||||
![]() | ||||
![]() ![]() ![]() ![]() ![]() ![]() | ||||
| ||||
Ans. private static boolean isPalindrome(String str) { if (str == null) return false; StringBuilder strBuilder = new StringBuilder(str); strBuilder.reverse(); return strBuilder.toString().equals(str); } | ||||
![]() | ||||
![]() ![]() ![]() ![]() ![]() ![]() | ||||
| ||||
Ans. 1. Fault Tolerance 2. Better Access by bringing the application closer to the users. | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. JVM (Java Virtual Machine) is an abstract machine. It is a specification that provides runtime environment in which java bytecode can be executed.JVMs are available for many hardware and software platforms (i.e. JVM is platform dependent).Runtime Instance Whenever you write java command on the command prompt to run the java class, an instance of JVM is createdThe JVM performs following operation:Loads codeVerifies codeExecutes codeProvides runtime environment | ||||
![]() | ||||
![]() ![]() ![]() ![]() ![]() ![]() | ||||
| ||||
Ans. Paas - Platform as a service Iaas - Infrastructure as a service Saas - Software as a service | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. final keyword is a modifier that means differently when applied to variables, methods and classes. 1. Final variable cannot be changed once initialized 2. Final method cannot be overridden 3. Final class cannot be sub classed | ||||
![]() ![]() ![]() | ||||
![]() | ||||
![]() ![]() ![]() ![]() ![]() ![]() | ||||
![]() | ||||
| ||||
Ans. Encapsulation is a feature of OOP's that binds the data and it's associated methods together as a single unit and facilitate protection and data hiding by providing minimal interface to outside. For example - member variables are declared private and are accessed through public methods. Moreover we have private methods that can only be used internally and hence providing minimal interface to outside class through use of public methods. | ||||
![]() | ||||
![]() | ||||
![]() ![]() ![]() ![]() ![]() ![]() | ||||
| ||||
![]() | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
![]() | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. Following are key differences between containers and serverless: Supported host environments: Containers can run on any modern Linux server, as well as certain versions of Windows. In contrast, serverless runs on specific host platforms, most of which are based in the public cloud (like AWS Lambda or Azure Functions). Self-servicing ability. For the reasons just noted, in most cases, serverless functions require you to use a public cloud. (There are on-premises serverless frameworks, like Fn, but these are not yet widely used.) With containers, you can set up your own on-premises host environment, or use a public cloud service like ECS. Cost. Because serverless environments are hosted in the cloud, you have to pay to use them. In contrast, you can set up a container environment yourself using open source code for free (although you’ll still have management costs, of course). Supported languages. You can containerize an application written in any type of language as long as the host server supports the language. Serverless frameworks are different; they support a limited number of languages. The details of supported serverless language vary from serverless platform to platform. Statefulness. Most serverless platforms are designed to support stateless workloads. (Some serverless providers offer limited support for stateful services; cf. Durable Functions on Azure.) Although you can connect to external storage services (like S3 on AWS) from within serverless platforms, the functions themselves cannot be stateful. Containers present their own persistent storage challenges, but creating stateful containerized apps is certainly possible. Availability. Serverless functions are designed to run for a short period—usually, a few hundred seconds—before they shut down. Containers can run for as long as you need. | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. Because Vendors need not worry about provisioning , managing and maintaining the servers and it's intrinsically taken care of by AWS. | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
![]() | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
![]() | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. On Demand service restricts cost by paying only for the use and Self Service saves cost by reducing intermediary human resource cost. | ||||
![]() | ||||
![]() ![]() ![]() | ||||