Thread: Interview Questions- State Street Corporation

Forum : Java SE FAQ?s and Interview Questions Java SE   05-2-2018 05:17:10 PM
User Image
RajaKnL

Newbie

Joined: Jun 25, 2017

Points: 100

Threads: 7

Posts: 21

Interview Questions- State Street Corporation

| Quote Date : Feb 5, 2018    Views:2143    

 Date : 05/02/2018

Company : State Street Corporate Services

Written Test of 36 questions from J2SE 1.8 only

1.what are all HashSet features?
2.Whar are all ArrayList feature?
3.which collection you use if you want to store group of elements by presurving the order and duplicates are allowed?
4.In java how primitives and object types will be passed to a method?
5.which collection you use if i want to store and find nth element which takes constant time?
6.which of these are correct?
Map implements Collection
Queue implements Collection
Iterator implements Iterable
8.Which keyword used to stop serializing an attribute while serializing?
transient
protected
super
private
9.in which mode jms message will reach to only one target?
Queue
SESSION
TOPIC
Connection
10.What is the benifit of Dependency injection?
11 if a sql query is taking long time to execute what will you do to optimize the query ?
13.what is the output of below code
class Test extends Thread{
public static void main(String[] args){
Test t=new Test();
t.run();
}
public void start(){
syso("Thread is running");
}
}

14.what do Executor will do?
15.how many methods of below class has to be synchronized?
class Items{
private final List<String> items;
Items(){
items=new ArrayList();
}
public void print(){
for(String str:items){
//some logic here
}
}
public void add(String item){
items.add(item);
}
}
16.is the below class called immutable class?
class Item{
private final List<String> items;
Item(){
items=new ArrayList();
}
public List<String> get(){
return items;
}
}
17.what is the output of below code
abstract class Fruit{
static final String name;
Fruit(String name){
this.name=name;
}
public void print(){
sysout(name);
}
}
class Apple extends Fruit{
Apple(String name){
super(name);
}
public void print(){
sysout(name);
}
}
class Test{
public static void main(String[] args){
Fruit f=new Apple("apple");
Fruit f=new Apple("dragon");
f.print();
}
}

18.what will be the output of the below code?
class Quantity{
int amount;
Store(Integer amount){
this.amount=amount;
}
public void add(Integer i){
items.add(i);
}
public boolean contains(Integer i){
return items.contains(i);
}
public boolean equals(Integer i){
if(this == i)
return true;
else{
Quantity q=(Quantity) obj;
return amount==q.amount;
}
}
}
class Test{
public static void main(String[] args){
Quantity store=new Quantity();
Integer one=new Integer(1);
Integer two=new Integer(1)
HashSet hs=new HashSet();
hs.add(one);
sysout(store.contains(one)+"--"+store.contains(two));
}
}
19.What is the output of below code?
int i=10;
while(i++<=10){
i++;
}
sysout(i);
ANS
-----
10
11
12
13
cant say
20.whe you use Stream.parallel()?
21.where is the error in below class?
class Ex{
public void foo1(){
throw new RuntimeException();
}
public void foo2(){
throw new Exception();
}
}
22.what is the output of below code
class Foo{
public void print(){
sysout(1);
}
public void finalize(){
sysout(2);
}
}

class Test{
public static void main(String[] args){
Foo foo=new Foo();
foo.print();
}
}
23.which design pattern adds additional functionality at runtime?
24.what benifit do we get when we take connection from connection pool insted of we creating connection?
25. where is the mistake in this class?
class Person{
private final String name;
Person(String name){
this.name=name;
}
public void setName(String name){
this.name=name;
}
public String getName(){
return name;
}
}

26.a class in java implements any number of interfaces but override only 1 abstract clss? true/false
27.what will the advantage if we  declare a method in interfacce as public?
28.what is the output of below code
abstract class Person{
static String name;
Person(String name){
this.name=name;
}
public void print(){
sysout(name);
}
}
class Test{
public static void main(String[] args){
Person mathew=new Person("mathew");
Person dave=new Person("Dave");
sysout(mathew.print());
}
}
29.what is the best practice when we are dealing with eqauls and hashcode() in our class?

Comments

User Image
Pranayinee

Newbie

Joined : Apr 6, 2018

Points : 100

Threads: 0

Posts: 1

Re: Interview Questions- State Street Corporation

Reply Date : Apr 6, 2018

Why did they ask in coding test ?.

Load More

No More Comments