close nav

close nav

Thread: One of MNC question 1.30 min interview

Forum : Job discussions   6 Jul, 2017
User Image
manoj4105

Newbie

Joined: 20 Apr, 2017

Points: 100

Threads: 10

Posts: 39

One of MNC question 1.30 min interview

| Quote Date : 6 Jul, 2017    Views:2208    

1. Brief your self?
2. Can we use spring basic & form based security togetcher?
3) can we apply spring security for web service resource?
why used this?
what is the use of auth provider?
4) what is genric?
5) Can you devlope your own generic?
6) What is thread

4) What is 1st level cache?
5) hibernate enity life cycle?
6) why you used asychronus rest resource?
7) In your project Every resource is asychronus rest resource?
8) i want don't want duplicate and inseration order i want then which collection i have to use?
9) Thread run sequialiy or parally?
10) write a program
t1 and t2 are thread
t1 t2
1 2
3 4
5 6
7 8
9 10

they should print one after one
o/p:1,2,3,4,5,6,7,8,9,10
11) where you used multithreading in your project?
12) Where you used aop in your project?
13) what is volitale keyword?
14) What is transient keyword?

tags: interview

Comments

User Image
SourabJain

Newbie

Joined : 28 Jun, 2017

Points : 100

Threads: 9

Posts: 14

Re: One of MNC question 1.30 min interview

Reply Date : 28 Jul, 2017

thanks for sharing your experience thank keep sharing Manoj

User Image
aditya

Newbie

Joined : 28 Jun, 2017

Points : 105

Threads: 6

Posts: 12

Re: One of MNC question 1.30 min interview

Reply Date : 21 Nov, 2017

The outcome is not coming proper ..

"[code]
class ThreadCount implements Runnable{
    private int x;
    public ThreadCount(){
        this.x=1;
    }
    @Override
    public synchronized void run(){
        while(true){
            if(Thread.currentThread().getName().equals("odd") && x%2!=0){
            System.out.println("odd: "+x);
            x++;
        }
        else if(Thread.currentThread().getName().equals("odd")){
            System.out.println("even: "+x);
            x++;
        }      
        if(x>=11)
            break;
        }
    }
}
class MultiThreadTest{
    public static void main(String[] arg){
        ThreadCount tc=new ThreadCount();
        Thread odd=new Thread(tc,"odd");
        Thread even=new Thread(tc,"even");
       
        odd.start();
        even.start();
       
    }
}?

is this helpful ?
[!code]

"

Replied by KishanJ
User Image
PhaniKumar

Newbie

Joined : 26 Jun, 2017

Points : 100

Threads: 13

Posts: 7

Re: One of MNC question 1.30 min interview

Reply Date : 21 Nov, 2017

[code]

class ThreadClass implements Runnable
{
public void run(){
for(int i=0;i<10;i++){
int res=(2*i)+1;
System.out.println("t1:::"+res);
try{
Thread.sleep(1000);
}catch(Exception e){}
}
}
}

class ThreadClassAlternatePrinting
{
public static void main(String[] args)
{
ThreadClass tc=new ThreadClass();
Thread t1=new Thread(tc);
t1.start();
for(int j=0;j<10;j++){
System.out.println("t2:::"+2*j+" ");
try{
Thread.sleep(1000);
}catch(Exception e){}
}
}
}
?
[code]

User Image
KishanJ

Newbie

Joined : 6 Jul, 2017

Points : 110

Threads: 7

Posts: 24

Re: One of MNC question 1.30 min interview

Reply Date : 20 Nov, 2017

[code]
class ThreadCount implements Runnable{
    private int x;
    public ThreadCount(){
        this.x=1;
    }
    @Override
    public synchronized void run(){
        while(true){
            if(Thread.currentThread().getName().equals("odd") && x%2!=0){
            System.out.println("odd: "+x);
            x++;
        }
        else if(Thread.currentThread().getName().equals("odd")){
            System.out.println("even: "+x);
            x++;
        }      
        if(x>=11)
            break;
        }
    }
}
class MultiThreadTest{
    public static void main(String[] arg){
        ThreadCount tc=new ThreadCount();
        Thread odd=new Thread(tc,"odd");
        Thread even=new Thread(tc,"even");
       
        odd.start();
        even.start();
       
    }
}?

is this helpful ?
[!code]

"Thanks for sharing your experience And Yes 10th Question looks very imp. in many interviews this Q has been if any one knows proper solution with coding please share. "

Replied by SourabJain
Load More

No More Comments