Interview Questions and Answers - Order By Rating Ans. No HashMap isn't synchronized. ConcurrentHashMap and Hashtable are synchronized. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  hashmap  synchronizationAns. Yes Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  aws param store  amazon param store  aws lambda  amazon lambda Q363. What measures would you take to avoid Java threading issues in a multi-threaded environment ?
This question was recently asked at 'Fifth Third Bank'.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 Q364. Does abstract class have public constructor? Core Java
Ans. Yes, an abstract class can have a constructor in Java. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  abstract class  public constructor Asked in 1 Companies Q365. Explain CloneNotSupportedException ? Core Java
Ans. If we do not mention, Cloneable Interface to the Class which we want to Clone then we get this exception, only if we try to clone an object
Like:
public class TestClone{
@Override
protected Object clone() throws CloneNotSupportedException {
return super.clone();
}
}
In Main, You try to do:
TestClone clone = new TestClone();
TestClone clone2 = (TestClone) clone.clone();
You will get CloneNotSupportedException.
Just add -> public class TestClone implements Cloneable {
and things are fixed. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  exceptions handling  cloning Q366. Why Hadoop serialized data types are not using in Spark serialization ? BigData
This question was recently asked at 'Tavant Technology'.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 Q367. Explain when you would decide to use open authentication ? Authentication
Ans. Google OAuth can be used when we want to grant the access of our google credentials to the service provider ( most likely a cloud-based mobile application) by using the option ' Login via Google' Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  open authentication Asked in 1 Companies Q368. What does 'variable hoisting' mean? JavaScript
Ans. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 1 Companies Q369. How many heaps will be there with 3 threads ? Core Java
Ans. All threads share a common heap.
Each thread has a private stack, which it can quickly add and remove items from. This makes stack based memory fast, but if you use too much stack memory, as occurs in infinite recursion, you will get a stack overflow. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  memory management  heap memory Asked in 1 Companies Q370. Please explain the architecture of our application through a diagram ? General
This question was recently asked at 'Alfresco Software,Ancestry'.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 2 Companies Q371. What are the disadvantages of binary search trees? Algorithm
This question was recently asked at 'ServiceNow'.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  binary search tree Asked in 1 Companies Q372. How to write an iterator for an iterator of iterators? Core Java
Ans. CustomArrayList myarrayList = new CustomArrayList();
myarrayList.add("Value 1");
myarrayList.add("Value 2");
myarrayList.add("Value 3");
for (String string : myarrayList) {
System.out.println(string);
}
package sample.utils;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class CustomArrayList implements Iterable {
private ArrayList mylist = new ArrayList();
public void add(T t) {
this.mylist.add(t);
}
@Override
public Iterator iterator() {
return new CustomIterator(mylist);
}
class CustomIterator implements Iterator {
private int indexPosition = 0;
private List internalList;
public CustomIterator(List internalList) {
this.internalList = internalList;
}
@Override
public boolean hasNext() {
if (internalList.size() >= indexPosition 1) {
return true;
}
return false;
}
@Override
public E next() {
E val = internalList.get(indexPosition);
indexPosition ;
return val;
}
}
} Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  iterator Asked in 1 Companies Q373. How would you test a Twitter application ? Testing
This question was recently asked at 'Slalom'.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  solution  testing Asked in 1 Companies This question was recently asked at 'IBM India'.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  queue  stack Asked in 1 Companies Q375. Code an elevator simulator. Design
This question was recently asked at 'TrustArc'.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 Q376. What is the minimum number of tables required to perform a SQL join? Database
Ans. 1 , We can do self join
Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  sql join Asked in 1 Companies Q377. What is a difference between JUnit 3 and 4 ? Junit
This question was recently asked at 'Conde Nast'.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  testing  junit Asked in 1 Companies Q378. Can we have a final argument in a method ? What is the use of that if we do so ? Core Java
This question was recently asked at 'Webster Bank'.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 Q379. why is "".equals(str); safer than str.equals("")? Core Java
Ans. str.equals("") this statement will throw NullPointerException if str is null where as "".equals(str) works fine even if str is null Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  equals method Asked in 1 Companies Q380. Write a method that would solve two problems at the same time ? Core Java
Ans. We can return value for one problem solving or computation and set the value for other in some member element. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q381. Design an in memory object oriented system for a Car manufacturing Company ? Design
This question was recently asked at 'Audacious Inquiry'.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 Q382. Which maven commands you usually work with ? Maven
This question was recently asked at 'Akvelon'.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  maven Asked in 1 Companies Q383. How can you prove your honesty ? General
This question was recently asked at 'Gallup'.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 Q384. If you are asked to develop a financial system, how would you make sure that there are proper checks , balances and audits ? Solution
This question was recently asked at 'BzzAgent'.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  Design  Security Asked in 1 Companies Q385. How can we take snapshots and track changes to environment variables in Elastic Beanstalk or Lambda ? Amazon Web Services (AWS)
Ans. We can use AWS Config Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  aws elastic beanstalk  amazon elastic beanstalk  aws lambda  aws serverless computing  amazon cloud serverless computing  amazon lambda 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   Q387. Can a constructor be declared static ? Why ? Core Java
Ans. No.
When we declare a method static, it means that "this belongs to class as whole and not particular instance". The whole purpose of constructor is to initialize a object and hence there is no sense having static constructor. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  constructor  static  static constructor Asked in 1 Companies Ans. No. They are never inherited and therefore are not subject to hiding or overriding. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  constructor  final  final constructor Asked in 1 Companies Ans. No Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  aws subset  aws internet gatewayAns. No Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  aws dynamodb  aws nosql database  amazon cloud nosql database