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 Newest | ||||
| ||||
| Ans. First Find the number of nodes in the linked list and take it as n.then find the data at n-3 element. | ||||
| ||||
| Ans. Authentication / Authorization URL forwarding Auditing / Logging Localization | ||||
| ||||
| Ans. Yes, doesn't provide exclusive access as we cannot allocate and deallocate memory exclusively as Java internally manages it. The advantage of this is that it relieves the coder for such tasks and helps protect from many bugs that may get introduced with imperfect coding. Moreover as java garbage collector collects all unclaimed memory or objects, it helps the application from memory leaks. On the flip side , as coder doesn't have extensive excess to memory , it is upto java to decide on the state for programming construct and data storage and hence may introduce some security risks. For example - Java keeps string literals in string pool and there is no exclusive way to remove it and hence may stay and sensitive data in string pool may introduce security issues. Moreover when we overwrite a value or object for a variable / reference, it is upto java to purge those values and hence it may stay in memory for a while till java decide that it is no longer referenced and hence should be removed and hence makes it vulnerable for inappropriate access. | ||||
| ||||
| Ans. Though var args are used rarely but they are pretty useful if a method is expected to receive variable number of arguments. For example - it's pretty useful for the main method as the caller has the flexibility to provide arguments in infinite ways.It provides a convenience and flexibility to the caller. | ||||
| ||||
| Ans. It means that only 1 thread can access have access to Vector at a time and no parallel access is allowed whereas Array List allows parallel access by multiple threads. | ||||
| ||||
| Ans. public class LinkedList { Node start = null; Node head = null; class Node { Integer body; Node nextNode; Node(Integer value) { body = value; } } private void addNodeToEnd(Integer value) { if (start == null) { start = new Node(value); head = start; head.nextNode = null; return; } while (head.nextNode != null) { head = head.nextNode; } head.nextNode = new Node(value); } private void traverse() { head = start; while (head != null) { System.out.println(head.body); head = head.nextNode; } } public static void main(String[] args) { LinkedList ll = new LinkedList(); ll.addNodeToEnd(5); ll.addNodeToEnd(10); ll.addNodeToEnd(15); ll.traverse(); } } | ||||
| ||||
| Ans. public class LinkedList { Node start = null; Node head = null; class Node { Integer body; Node nextNode; Node(Integer value) { body = value; } } private void addNodeToEnd(Integer value) { if (start == null) { start = new Node(value); head = start; head.nextNode = null; return; } while (head.nextNode != null) { head = head.nextNode; } head.nextNode = new Node(value); } private void deleteNode(Integer value) { head = start; while (head.nextNode != null) { if(head.nextNode.body == value){ head.nextNode = head.nextNode.nextNode; } head = head.nextNode; } } private void traverse() { head = start; while (head != null) { System.out.println(head.body); head = head.nextNode; } } public static void main(String[] args) { LinkedList ll = new LinkedList(); ll.addNodeToEnd(5); ll.addNodeToEnd(10); ll.addNodeToEnd(15); ll.traverse(); ll.deleteNode(10); ll.traverse(); } } | ||||
| ||||
| Ans. pop method pulls the top element from the stack and then move the top to the next element whereas peek only get the top element but doesn't move the top. | ||||
| ||||
| Ans. By using synchronized static method or synchronized block | ||||
| ||||
| Ans. There is schema in mongo-db but the schema need not to be defined before creating collection. | ||||
| ||||
| Ans. Abstraction is a process of hiding the implementation details and describing only the functionality to the user. | ||||
| ||||
| 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. | ||||
| ||||
| 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. | ||||
| ||||
| 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. | ||||
| ||||
| Ans. Observable is emiting data and Observer is subscribing to catch the data | ||||
| ||||
| Ans. == compares values === is used in scripting languages for comparing two values as well as there data tpe. like in js,php. | ||||
| ||||
| Ans. WEB APP |WEB-INF - META-INF | | | META-INF.MF | lib - WEB.xml - Classes | ||||
| ||||
| Ans. Encrypted User Name / Password Encrypted Password within Cookie Encrypted Tokens IP Client Certificates Oauth | ||||
| ||||
| 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. | ||||
| ||||
| 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. | ||||
| ||||
| Ans. No, It will throw compile time error saying "must provide either dimension expressions or an array initializer" Alternatively we can provide array initializer like String[] strArray = new String[]{"Buggy","Bread"}; which will initialize it to size 2 with values as "Buggy" and "Bread" | ||||
| ||||
| Ans. forFeature is used for lazily registering reducers with the module. | ||||
| ||||
| Ans. For Cloning-exception,For deserialization-read.resolve() | ||||
| ||||
| Ans. It's an on premise virtual appliance that can be used as cache to store s3 locally at customer site. | ||||
| ||||
| Ans. AWS Cached - Low Availability than AWS Stored, Lower cost than AWS Stored AWS Stored - High Availability, High Local Storage Cost AWS VTL - S3 Used as Back up only. | ||||
| ||||
| Ans. EC2 is IAAS Elastic Beanstalk is PAAS EKS is Containerization service Lambda is Serverless | ||||
| ||||
| Ans. Automated Backups are deleted automatically whereas Snapshots are preserved. Upon terminating RDS instance , AWS gives a warning about that and requests to create a final snapshot before terminating the instance. | ||||
| ||||
| Ans. High bandwidth and availability in NAT Gateway NAT Gateway is completely managed by AWS NAT Gateway is auto scalable NAT Instance is just like EC2 instance and hence backed by security group NAT Instance can be used as bastion host whereas NAT Gateway cannot be. | ||||
| ||||
| Ans. Deserialization. In serialization, we can save the object of a byte stream into a file or send over a network. Suppose if you serialize the Singleton class, and then again de-serialize that object, it will create a new instance, hence deserialization will break the Singleton pattern. To overcome this issue, we need to override readResolve() method in the Singleton class and return the same Singleton instance. | ||||
| ||||
| Ans. IP Authentication IP Range Authentication Certificates Authentication Cards | ||||