Interview Questions and Answers - Order By Newest Q2491. What is XSS or Cross site scripting ? Security
Ans. XSS or cross site scripting is a javascript vulnerability in web applications. The easiest way to explain this is with a case when the user enters a script in the client side input fields and that input gets processed without getting validated. This leads to untrusted data getting saved and executed on the client side. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 3 Companies Q2492. Explain Hibernate caching mechanism Hibernate
Ans. Every fresh session having its own cache memory, Caching is a mechanism for storing the loaded objects into cache memory. The advantage of cache mechanism is, whenever again we want to load the same object from the database then instead of hitting the database once again, it loads from the local cache memory only, so that the no. of round trips between an application and a database server got decreased. It means caching mechanism increases the performance of the application.
In hibernate we have two levels of caching
First Level Cache [ or ] Session Cache
Second Level Cache [ or ] Session Factory Cache [ or ] JVM Level Cache Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 23 Companies Q2493. Explain servlet lifecycle Java EE
Ans. Init -> service -> destroy.
Out of these, init and destroy are called once per servlet whereas service is called every time when a request is made to the servlet. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  servlet Asked in 6 Companies Q2494. Does it make sense to mock integration calls during stress / load test ? Testing
Ans. No, its usually not done. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  integration testing  stress testing  mocking  MockitoAns. Layer 7 - Application
Layer 6 - Presentation
Layer 5 - Session
Layer 4 - Transport
Layer 3 - Network
Layer 2 - Data Link
Layer 1 - Physical Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 7 Companies Q2496. Implement a Stack with 2 threads in which one thread push data and another pop data. Data Structure
This question was recently asked at 'HCL 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  stack Asked in 1 Companies Q2497. Can you tell me any 10 unix command you have worked with ? Unix
Ans. grep, ls, kill, vi , scp , wget,telnet, zip, unzip,mv,cp Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  unix commands Asked in 1 Companies basic Q2498. Can we create object in static block ? Core Java
This question was recently asked at 'DXC 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 1 Companies Q2499. What are the different ways to create objects in Java ? Core Java
Ans. 1. Using new operator
3. Using Class.forName or Reflection
4. Using clone
5. Using Deserialization Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 1 Companies Q2500. What will happen if there are no enums in Java ? Core Java
Ans. Enums in Java is a facility to have objects upfront and use them as constants. Even if such a facility is not available , a workaround could be achieved. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  enum Q2501. What will happen if there are no collections in java ? Core Java
Ans. Collections in Java is nothing but a library implementation for data structures and algorithm. If it's not available , we might have to include some other library or provide our own implementation. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  collections This question was recently asked at 'SQUAD Infotech'.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  stream  inout output  inour stream Asked in 1 Companies Q2503. Can comments be added in JSON ? JSON
Ans. No, It should all be data. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  Markup languages Q2504. How to calculate distance between 2 points using latitude longitude ? Algorithm
This question was recently asked at 'Trimble'.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 1 Companies Q2505. Why did you apply for this position? General
This question was recently asked at 'NIC inc'.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 1 Companies Q2506. How to parse nested json object ? JSON
Ans. JSONObject jsonChildObject = (JSONObject)jsonObject.get("LanguageLevels");
for (Map.Entry in jsonChildOBject.entrySet()) {
System.out.println("Key = " entry.getKey() ", Value = " entry.getValue());
} Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  json  nested json Asked in 1 Companies Q2507. Explain different inheritance mapping strategies with JPA / Hibernate. Hibernate
Ans. table per hierarchy
table per concrete class
table per sub class Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  hibernate mapping  hibernate associations Asked in 4 Companies Ans. Salesforce is the cloud based #1 CRM (Customer Relationship Management) Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q2509. A customer has a website which is accessible over the Internet and he wants to secure the communication and decides to implement HTTPS instead of HTTP. He has configured EC2 instance behind an ELB. Where should you configure the SSL certificate? Amazon Web Services (AWS)
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   Q2510. With regards to VPC, what is the default maximum number of virtual private gateways allowed per region? Amazon Web Services (AWS)
Ans. 5 Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  aws vpc Q2511. What is elasticity in relation to Cloud infrastructure ? Cloud Computing
Ans. The power to scale computing resources up and down easily with minimal friction 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) Ans. 10000 Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  aws cloudfront  amazon cloudfront Q2513. Which is the best approach that provides the lowest cost for Amazon elastic block store snapshots while giving you the ability to fully restore data? aws ebs
Ans. Maintain the most current snapshot; archive the original and increment to Amazon Glacier. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  aws ebs volume snapshot Q2514. Pascal Triangle Program
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;
}
} Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 8 Companies This question was recently asked at 'Unisys'.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 1 Companies Ans. So that it doesn't overwrite the existing file with the same name and maintain versioning of it. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  AWS S3 Q2517. Which IAM policy condition key should be used if you want to check whether the request was sent using SSL? Amazon Web Services (AWS)
Ans. AWS: secure transport Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  aws security  aws iam  amazon iamAns. Amazon SWF Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  Ans. IPv4 and IPv6 Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  Elastic Load Balance  AWS Load balancing  aws elb  amazon elbAns. Controller Service Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  AWS Controller Service  aws elb  amazon elb  aws load balancing  elastic load balancer