Search Interview Questions | ![]() ![]() Click here and help us by providing the answer. ![]() Click Correct / Improve and please let us know. |
|
| ||||
Interview Questions and Answers - Order By Rating | ||||
![]() ![]() | ||||
| ||||
Ans. We can keep them in config as encrypted values. | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. Yes an application can have configuration stored at multiple places. Factors that could facilitate such a design could be 1. Type of config information - We may have a case to store confidential information differently than other regular config value 2. Environment - We may like to have a base config ( defined in application package ) and then a different override mechanism in different environments. 3. Centralization - Sometime some configs need to be shared across application and hence centralized. 4. Testing - Testing against config may not be possible in some enviornments in certain cases and hence additional config store might be kept for testing purpose only. | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
![]() | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
| ||||
Ans. str.equals("") this statement will throw NullPointerException if str is null where as "".equals(str) works fine even if str is null | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
| ||||
![]() | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
| ||||
![]() | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
| ||||
Ans. Firstly ,we have removed old backup data from server after that we are checking which user consume high memory through df command. | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
| ||||
Ans. Inline functions , just like C++ Macros is an optimized technique used by compiler to reduce the execution time. If the function is working on pre identified values ( which aren't resolved at runtime ), the function can execute the method and evaluate the outcome at compile time only instead of making a function call at runtime. | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
| ||||
Ans. Inline functions , just like C++ Macros is an optimized technique used by compiler to reduce the execution time. If the function is working on pre identified values ( which aren't resolved at runtime ), the function can execute the method and evaluate the outcome at compile time only instead of making a function call at runtime. In Java, the optimizations are usually done at the runtime or JVM level. At runtime, the JVM perform some analysis to determine which methods to inline. Java compiler would never inline any method and there is no way in java for the developer to explicitly define inlining of methods as it's take intrinsically care of during runtime only. | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. EC2 is IAAS Elastic Beanstalk is PAAS EKS is Containerization service Lambda is Serverless | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
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. List is an interface whereas ArrayList is an implementation of List. | ||||
![]() | ||||
![]() ![]() ![]() ![]() ![]() | ||||
| ||||
Ans. US-EAST-1 | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. Through Snapshots | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. Saving Cost by either expiring objects or moving to low cost storage. | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. Disaster Recovery and availability | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. At that bucket, it will form a linked list depending on what equals method evaluates for that object. | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
| ||||
Ans. Computation Spot Price Plan F1 or P3 Instance Type Cold Hdd (SCI ) EBS Volume Storage S3-IA | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. import java.util.Random; public class OTPGenerator { public static void main(String[] args) { int otpLength = 4; String otp = generateOTP(otpLength); System.out.println("Generated OTP: " otp); } private static String generateOTP(int length) { StringBuilder otp = new StringBuilder(); Random random = new Random(); for (int i = 0; i < length; i ) { int digit = random.nextInt(10); otp.append(digit); } return otp.toString(); } } | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
| ||||
Ans. It saves Network traffic and facilitates faster delivery by hosting bulk media and cached data near to client. | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. As Edge location only host cached content, Amazon CDN service or CloudFront is provided on these locations. | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. A Region is a Geographical entity like US-East , US-West etc. Each Region may have multiple availability zones where each zone comprise of 1 or more Data Center located with each other. Edge Locations are the sites that hosts cached content for faster delivery and for saving network traffic as they feed content from sites that are local or near to consumption. | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. US-East Virginia This is the oldest and most popular region. All new features are rolled first in this region and hence they are first available there. The downside is that because of experimentation with new services, unavailability time is quite high. | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. @RequestMappping | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
| ||||
Ans. AMI is an Amazon Machine Image. It contains the configuration to enable to boot up an EC2 instance with said configuration whereas Cloud formation is a templating language that allows to describe how to build a VPC and also allows you to create AWS services AMI is templating specific to instances whereas the scope of CloudFormation templating is much bigger. CloudFormation could use AMI for launching instances along with other services. | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. It depends on how we are serializing. The Serialization API doesn't worry about private variables and convert it into binary representation. If we are using a library to map it to JSON / XML using XML Mappers, it may create trouble. | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. package snippet; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; public class Pascal { public static void main(String[] args) { System.out.println(generatePascalTriangle(5)); } static Map> generatePascalTriangle(int size) { Map> triangle = new HashMap<>(); triangle.put(0, Arrays.asList(1)); triangle.put(1, Arrays.asList(1, 1)); for (int i = 2; i <= size; i ) { List coeffListForI = new ArrayList<>(); List coeffListForI_1 = triangle.get(i - 1); coeffListForI.add(1); for (int j = 0; j <= coeffListForI_1.size() - 2; j ) { coeffListForI.add(coeffListForI_1.get(j) coeffListForI_1.get(j 1)); } coeffListForI.add(1); triangle.put(i, coeffListForI); } return triangle; } } | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
| ||||
Ans. Cloud Formation does not have any additional cost but you are charged for the underlying resources it builds. | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. table per hierarchy table per concrete class table per sub class | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
| ||||
Ans. For Cloning-exception,For deserialization-read.resolve() | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
![]() ![]() | ||||