Showing posts with label Spring. Show all posts
Showing posts with label Spring. Show all posts

Friday, 6 November 2015

Q3 Technologies

Date: 6 November 2015
Venue: JMD Megapolis IT Park, Sector-48, Gurgaon
The building has a wonderful architecture!!!

After a terrible wait of 1 hour.

Hybris:

  1. Full WCMS story.
  2. Difference between CSFT and CSFP?
  3. In a box show the entire process of Solr functionality by drawing everything.
  4. Which pages use Solr?
  5. How does Solr get data from hybris DB? Surely, we don't send the entire data.
  6. Where is the entry that, which product type (Style variant, size variant, etc.) needs to be indexed? solr.impex was expected!!!
  7. Difference between ant, ant clean, ant all and ant clean all?
  8. Which of them compiles the code?
  9. What new files or what changes will happen if these are run after generate="true"?
  10. What do you mean by "build successful"?
  11. Entire presentation layer?
  12. When is facade needed? When it is not? Answer: Needed only for storefront.
  13. What happens at DAO layer?
  14. Full process of making a new form entry, starting from form at front-end to DB.
  15. Tell me something about spring security in Hybris.
  16. What is singleton?
  17. Why is it created?
  18. Difference between @Resource and @Autowired?
  19. What should be done at service layer? What not?
  20. What should be done at facade layer? What not?
  21. Why use converter/populator?
  22. What is the order of AtomicType,Collection,Map,Items,etc. in items.xml? Can we change the order?

Xebia

Date: 5 November 2015
Telephonic

Java:

  1. Difference between List and Set?
  2. How does Set ensure unique values?
  3. What if I want to add multiple objects with same values to Set (or something like that).
  4. Why hashcode() when equals is already there?
  5. Difference between HashMap and HashTable?
  6. Which of them takes "null" value for key?
  7. What if two objects with same values are pushed in HashMap?
  8. Why should the HashMap key be immutable?
  9. What are immutable object? Example in java.
  10. How many objects are created for different cases of String creation?
  11. In what scenarios will the different String objects result true for == and equals?
  12. What is Java SOLID? Hint: SOLID is an acronym.


Design Pattern:

  1. Name a few.
  2. What are build patterns?


Spring:

  1. What is singleton?
  2. What is prototype?
  3. What about a singleton bean inside prototype?
  4. What about a prototype beans inside singleton?
  5. Bean life cycle?
  6. Dispatcher servlet?
  7. Entity manager at DAO?
  8. Spring MVC entries.
  9. What if there is a cyclic dependency between beans.
  10. What is DI?



Saturday, 18 April 2015

Born Group

Questions:

Round I:
There were very long uncomfortable pauses between each question.
  1. What all modules in hybris have you worked upon?
  2. How to use the REST webservices of hybris?
  3. How to use the SOAP webservices of hybris?
  4. How to create a SOAP client?
  5. How to do a server side validation using Spring?
  6. What all classes are in Collections framework?
  7. Difference between ArrayList and LinkedList?
  8. How to define a cronjob in Hybris?
  9. How to customize solr?
  10. How does data from solr comes to Product listing page?
  11. What is association?
  12. How to implement association in hybris?
  13. Which element implement association in hybris in items.xml?
  14. Implementing cardinality in hybris?

    Lots of questions about web-services, spring MVC and their implementation in Hybris.
Round II:
    1. What is deployment table in hybris? How is it stored internally?
    2. Entire story about WCMS?
    3. Simple database table to store details of a family and their relations.
    4. How to override a service or any bean in java? What are the best practices?
    Round III:
    HR round
       This is where it gets interesting. The HR's have a mood swing. One moment they are the nicest, coolest most co-operating saints in corporate industry. Next moment they turn angry, fussy, exceptionally dumb, bullies. And then they turn back to their efforts for canonization. Just bear with their antics and any revolutionary idea that they come up with. Having said that these guys like to believe that they are an elite club of hybris nerds. And this means that they won't mind dolling out large lumps of CTC to pump their egos. Good for them, good for us.
    My advice is that negotiate hard, they are willing to walk the extra mile.  

    Monday, 17 November 2014

    Hong Kong and Singapore Based Firm

    Telephonic for a Singapore based firm with clients in Hong Kong.

    Spring:

    1. What is AOP?
    2. What is DI?
    3. What is IOC?
    4. How many types of IOC?
    5. How to inject bean using constructor?
    6. How to inject bean using setter?
    7. How many types of beans?
    8. Life cycle of beans?
    9. Example of singleton bean?
    10. Is it thread safe?
    11. When does singleton get instantiated?
    12. When does prototype get instantiated?
    Java:
    1. What is dynamic polymorphism?
    2. What is interface?
    3. Why use interface when we have abstract class?
    4. How to restrict a method from being overridden?
    5. Can private methods be overridden? 
    6. Can static methods be overridden?
    7. Can non-static content be referenced from a static method?
    8. What if system.exit() is called in a try block?
    9. StringBuilder vs StringBuffer?
    10. What is volatile keyword?

    Saturday, 15 November 2014

    Ebix Solutions

    Ebix Solutions:

    Venue : Located in the last corner of earth also know as Noida Phase 2.
    Date: 14 November 2014 (Happy Children day.......beat that shit)

    4 rounds in total.

    Now before i start, some basic info about the company.
    It is located in Noida Phase 2. This must explain the whole story to anybody in Delhi NCR. But if you don't get the gist, allow me. Ebix was no different. Just by the look of it you get a gut feel that something is very wrong. Its redder than a commie flag. The LED lights in pillars and walls and floor and in your face alternate between blue and red. The walls are chrome plated. Even the stairs have false lighting and you can bask in the glory of walking over DJ set while thinking of proper typecasting for your objects. It took me longer than expected but the Software Firm is literally established in a discotheque. However, if you are still reading then just for your acknowledgement, i haven't even started with the good part.

    Reminds me of Ebix!!!

    Round 1:
    The very first round is an HR round. Surprise. Welcome to the Wonderful world of Noida Phase 2 firms. The HR discusses your salary, likes, dislikes, expectations, consummations and most important why you are planning to move over to Ebix (It appeared so innocent back then). Then she asks about your family and more about family and hometown of family and current lodging of family, until you start feeling uncomfortable. To my relief she was married, but you never know. And with the foreplay to set the mood right, she drops the bomb. WE CAN'T PAY. Plain and simple, that's what we do as a firm. We hire people to develop software, we organize walk-ins, discuss everything inside out and then we just don't pay. Can it be more obvious. Now a bewildered me mumbled something of the likes, "Then?!". Here's the explanation that can put Einstein to shame:
    "See. We will pay what your are getting in your current firm. Only we will not provide you with any insurance (medical or otherwise), bonus, allowance or other perks. So, we will simply convert your current salary to your in-hand salary. Cool isn't it .And while your current firm provides you stupid cab facility like picking you from home and dropping you to office, we keep our buses at major metro stations that will ferry you to this awesome desolate location. Of course you can teleport to the metro stations from your home."

    Then i have to wait for about 2 hours before anything happened. You can do wonderful activities in this time like, twist on the sofa, overhear the girly discussion on why Gauhar's sister is a weak contestant in Big Boss and how Bihar is going to be the next IT hub. Still, this was the most fruitful part of the entire interview process. The hot chocolates of the day (read guys who were sent back after interview rounds) ensured that their enlightenment provides them with enough chances to flirt with the girls who were more than eager to trade any inhibitions for that sort of knowledge. Some insight in their gyan:

    1. They will hire only if you know what's the difference between Spring 2.5 and Spring 3.0. Coz, that's what clients ask, isn't it. Why would they develop a checkout mechanism or product detail page. All they wanna know is the DIFFERENCE between Spring versions.
    2. You have to know Spring, Struts and Hibernate.
    3. They have a project that will end on specific deadline so ARE YOU prepared to go for it?
    Then he bragged about his duels with his managers while flashing a cell phone with a screen the size of your television. In my view he was the only winner of the day and with that sort of attention he is getting laid sooner than his next technical round.

    Round 2:
    An interviewer who is tired beyond grief, finally calls me in for the first technical round. Asks a lot about resume, current project, etc. Dialogues from first round help a lot to clear this one. Then he jolts down some technologies on which he has not worked yet and gets really curious over them. Who was interviewing whom, again!!!. 4 hours after arriving and shitload of discussion later i am finally confronted with the first Java question:

    1. A simple scenario where a job inside a method can be hit by two or more processes. Just to make it cheesy he said that the job has serialization implemented on it. Actually, it was a classic case of a situation where threading must have been implemented. Theses processes should have Thread or Runnable implemented and the job must be inside a synchronized block. As, this was not the case in current code, we have to do it manually. So, use a semaphore/mutex and do the entire code for threading yourself.
    2. A is the parent of B and both of them have a method foo().
      public class Parent {
      public void foo()
      {
      System.out.println("Parent");
      }

      }

      public class Child extends Parent {

      public void foo()
      {
      System.out.println("Child");
      }

      }

      public static void main(String[] args) {
      Parent p = new Child();
      p.foo();

      }

      Now, a reference of Parent is assigned to an object of Child. What will get printed on calling foo().
      Ans. Child

      Then, he removes the foo() method from Parent class.

      public class Parent {

      }

      Now, what will be printed?
      Ans. Nothing. It will  not even compile and give an exception regarding unidentified method.
    After, round 2 i was made to sit outside again. Only this time an HR cum peon got really excited and kept saying after every 5 minutes that i will have the next round after 10 minutes. Needless to say i have to wait for full 1 hour again before the next guy bothered.

    Round 3:

    An even tiresome interviewer finally takes me to a glass chamber and asks the core question on which this company was established. Yes, you guessed it right. Family, that's what hey wanna know. By now, Ebix guys knew more about my family than i do. After getting his fix, he moved to Java. And then he asked me the exact same inheritance question that i was asked in the previous round. On protest, he started blushing. Don't you dare ask me why? It's perfectly natural and Noida Phase 2 rocks. The next 5 minutes were spent discussing who took my previous interview and his relation with that guy. However, this gave me a very very interesting idea.

    **Did you realize that of all the stuff that happened this guy never. Never ever, bothered to get an answer. Now how cool is that!!! This can be used as a trick in future interviews. So, instead of whining and shitting your pants on that nightmarish question you just have to say that it was asked in the previous round. Even if the interviewer calls your bluff you just have to answer the question, which you have to answer any way. BINGO!!!

    Finally, he comes to the point and openly confessed that they are simply looking for anyone who know Hibernate and Struts as well. I didn't. Still i was instructed to wait for the 4th round.

    Round 4 (Final Round):
    Enter the big boys. By look and accent you can tell that they were the actual players. As for the questions you must have an idea by now. "Yes sir, i live with my family in .....". And on it goes. More about myself and then they repeat the first round all over. The first guy finally satisfied after quenching his thirst for the details of my family, invites the other big boy for his fair share of dope. You could have actually skipped the whole article, (but its too late, isn't it), to read this part which explains what the actual deal is. Dude number 2:

    1. You comfortable working late hours?
    2. How will you get to this location. Do you own a vehicle?
    3. We work on weekends more that often. Cool?
    4. What exactly do you do? Question of the day.
    5. How long will it take you to learn Spring and Hibernate?
    6. Why do you wanna switch?
    7. What do you know about XSLT?
    8. What do you know about DOM and SAX?
    9. More and more technical acronyms were bombarded, before he declared that they won't pay a dime above my current salary.
    Did you notice that all these questions don't have an answer. Its because i dint give any, nor did he expect any. Any effort on the contrary was immediately stalled by asking the next question. Then it got over and i thanked GOD more than once.
    Free from any further torment, i ate the omlette at the dhaba cum canteen (which was exceptionally clean with the only catch of being right next to a fuming generator), had a real good look at this wonderful creation of Almighty called Noida Phase 2 and decided to leave. What had started in the middle of the day ended late at night. But i am really glad that it got over. As usual i got ripped by the autowallah into paying 100 bucks for reaching sector 37. 
    All in all, Ebix is a software company and they are hiring and GOD is great.

    Sunday, 28 July 2013

    Sonata interview

    Sonata
    Q.1 Tell me about your project?
    Q.2 Design patterns (structural, behavioural)?
    Ans. Business delegate  and MVC are incorrect answers.
    Hint# Related to JavaEE
    Q.3 Best sorting technique?
    Q.4 Space and time complexity of merge sort?
    Q.4 Where does log (n) comes in merge sort?
    Q.5 Why is public satic void main(String args[]) so?
    Q.6 What if we change pulic to private or protected?
    Q.7 Why is main static?
    Q.8 Could the return type of main be int?
    Q.9 Scope of beans?
    Ans. Singleton, prototype, global, etc.
    Q.10 How to define singelton bean without sring framwork?
    Q.11 Can we have setter and constructor injection?
    Q.12 What is inversion of control, Spring ?
    Q.13 Can we have two items.xml files in a project?
    Q.14 Can we have two spring.xml files in a project?
    Q.15 What is the tag by which we create a relationship between two id's/components in an items.xml files?
    Q.14 How many extensions are there in hybris? How many have you worked upon?

    Unicommerce interview

    Unicommerce interview.
    URL: http://www.unicommerce.com/

    Date : 27 July 2013
    Venue : Okhla Phase 3, New Delhi, India

    Round 1 (Aptitude):
    15 question. 45 minutes.
    Objective questions. However, there is no strict marking scheme. Any guess made will be questioned in interview.

    Q.1 If a>b implies 1/a<1/b, the which is true?
    A) a>0 
    B) b>0 
    C) a>0 and b>0 
    D) none of the above

    Q.2  There are 25 horses in a race. Find the minimum number of races to find the three fastest horses. Each race can have 5 horses.
    A) 12 
    B) 7 
    C) 9 
    D) 5
    Ans. 7.
    Explanation:
    First perform 5 races to find the top 5. Total races = 5
    Then perform a race to find the fastest horse. Total races = 6
    Now discard the original buckets of 2nd, 3rd, 4th and 5th horse from the 6th race as they can never give top three fastest horses and we already have the fastest horses from these pool. Also, discard the 4th and 5th horse of 6th race.
    So, we are left with four horses from the pool of winner of 6th race and the second and third of 6th race i.e. total of 6 horses.
    Now either the 2nd and 3rd of 6th race are the 2nd and third fastest or the 2nd or 3rd of the winner of 6th race are the 2nd and 3rd fastest.
    So, discard the 4th and 5th of the original bucket of winner of 6th race.
    Now, we are letf with only four horses. 2nd and 3rd of 6th race and 2nd and 3rd of the original bucket of winner of 6th race.
    Perform a race of these four horses and get the second and third.               Total races = 7

    Q.3  Find the total number of squares that u can draw in a chess board?
    Ans. 204
    Explanation: 
            Consider the lefthand vertical edge of a square of size 1 x 1.  
    This edge can be in any one of 8 positions. Similarly, the top 
    edge can occupy any one of 8 positions for a 1 x 1 square.  
    So the total number of 1 x 1 squares = 8 x 8 = 64.
    
    For a 2 x 2 square the lefthand edge can occupy 7 positions and 
    the top edge 7 positions, giving 7 x 7 = 49 squares of size 2 x 2.
    
    Continuing in this way we get squares of size 3 x 3, 4 x 4 and so on.
    
    We can summarize the results as follows:
    
       Size Of square      Number of squares
       ---------------     -----------------
          1 x 1               8^2 = 64
          2 x 2               7^2 = 49
          3 x 3               6^2 = 36
          4 x 4               5^2 = 25
          5 x 5               4^2 = 16
          6 x 6               3^2 =  9
          7 x 7               2^2 =  4
          8 x 8               1^2 =  1
                          ---------------
                          Total   = 204
    
    There is a formula for the sum of squares of the integers 
    1^2 + 2^2 + 3^2 + ...  + n^2
    
                    n(n+1)(2n+1)
             Sum  = ------------
                         6
    
    In our case, with n = 8, this formula gives 8 x 9 x 17/6 = 204.
    
    As an extension to this problem, you might want to calculate the 
    number of rectangles that can be drawn on a chessboard.
    
    There are 9 vertical lines and 9 horizontal lines. To form a rectangle 
    you must choose 2 of the 9 vertical lines, and 2 of the 9 horizontal 
    lines. Each of these can be done in 9C2 ways = 36 ways. So the number 
    of rectangles is given by 36^2 = 1296.

    Q.4 How many knights can u place on a chessboard such that none of them attacks the other?
    Ans. 32

    Q.5 Find the next number in the series.
    6, 15, 35, 77, 143, ___
    Ans. 221
    Explanation: 
    6 = 2*3
    15 = 3*5
    35 = 5*7
    77 = 7 *11
    The pattern is that the terms are products of two prime numbers and where one of the prime numbers increases to the next one in the following term Hence:
    11*13 = 143
    13*17 = 221 etc

    Q.6 How many zeroes are there at the end of 1000! (1000*999*998*......3*2*1) ?
    Ans. 248
    Explanation:
    We wish to find the number of zeros at the end of 1000! = 1000*999*998*997*....*4*3*2*1
    We examine the factors of 1000! to see which can be used to produce multiples of 10.
    For 1000!, each multiple of 5 - taken together with some even number - contributes a multiple of 10. Each multiple of 25 - taken together with some multiple of 4 - contributes two multiples of 10. Each multiple of 125 - taken together with some multiple of 8 - contributes three multiples of 10.
    We can count each multiple of 5 in 1000! once. Then we can count each multiple of 25 in 1000! once in order to altogether count each multiple of 25 twice. Then we can count each multiple of 125 in 1000! once in order to altogether count each multiple of 125 thrice.
    There are 1000/5 = 200 multiples of 5 in 1000!
    There are 1000/25 = 40 multiples of 25 in 1000!
    There are 1000/125 = 8 multiples of 125 in 1000!
    Adding them together, we have 200+40+8 = 248 zeros at the end of 1000!.

    Q.7 There are 3 Englishmen and three french in a company. Each of them holds a secret. They can tell the secret on a one-on-one telephonic conversation. At the end of all the conversations each of them must know all the six secrets. Only one Englishman knows french and none of the french knows English. How many minimum calls are to be made?
    A) 5
    B) 9
    C) 10
    D) 15
    Ans. C) 9
    Explanation:
    1: Englishman 1 calls the guy who knows french, and tells his secret
    2: Englishman 2 calls the guy who knows french, and tells his secret
    3, 4: The guy who knows french calls two of the Frenchmen and collects their secrets
    5: The guy who knows french calls the last Frenchman and collects his secret (thus gaining all the secrets) and tells the Frenchman all the secrets he knows (so the Frenchman has all the secrets).
    6-7: the Frenchman calls his fellow Frenchmen and discloses all the secrets
    8-9: The guy who knows french calls his fellow Englishmen and discloses all the secrets.

    Q.8 Akshay Kumar is standing in a tunnel(PQ) at a distance of x/4 from P. The total length of the PQ tunnel is x.  A train is approaching the tunnel from P. Currently it is at a distance of y from P. It is running at a speed of 60 km/hr. If Akshay can run at his maximum speed to just save his life, what is the maximum speed of Akshay?

    Q.9 There are two beakers A and B. A contains 1000ml of milk and B contains 1000 ml of water. If 100 ml of milk from A is added to B and then 100 ml of liquid from B is added to A. Which of the following is true?
    A) Percentage of milk in A > Percentage of water in B
    B)  Percentage of milk in A < Percentage of water in B
    C)  Percentage of milk in A = Percentage of water in B
    D) None of the above
    Ans. C
    Explanation : On solving the percentage of milk in A and water in B come out as 91%.

    Q. 10 An object is marked at MRP p. Which of these two  options will result in a lower price for customer?
    I) First give a discount of x% on p. Then add a tax of y% on the result.
    II) First add a tax of y% on p. Then provide a discount of x% on the result.
    Ans. Both will result in the same final price i.e.  p(1-x/100)(1+y/100)

    Q.11 A car travels at 40 km/hr from Delhi to Gurgaon and comes back at 60 km/hr from Gurgaon to Delhi. What is the average speed of car during the entire journey?

    Q.12  In the following grid assign the numbers 1-8 such that no two numbers that are adjacent in numeric series are adjacent in the grid (vertically, horizontally and diagonally). For example the below solution is incorrect.
    X 1 X
    2 3 4
    5 6 7
    X 8 X
    Ans.
    X 7 X
    3 1 4
    5 8 6
    X 2 X

    Q.13 There are 1000 bulbs in a room in off state. Turning the switch will put them in on state. In first pass all the switches are turned. In second only the switches that are multiples of 2 are turned and so on ..... After the 1000 pass how many switches remain on?
    Ans. No of primes < 1000


    Round 2 (Face to face interview):
    Q.1 Explain the solution of question number 4.
    I had accidentally solved it thinking they are asking about rook not knight (and marked 8 as my answer). Corrected my mistake and gave this design.

    k k k
    k k
    k k k
    and so on i.e. putting knights after leaving a block which gives us 64/2 = 32 knights.

    Q.2 Detailed explanation of Q.2 (horse racing).
    Like me everybody has simply guessed that one. So it was pretty much 'catch of the day' for the interviewer. I did notice a smirk when he asked me. Ans i did get busted. Then,i tried my level best, but reached only up to finding top 2 fastest horses. Mr. Einstein then explained me the answer. This one took a lot of time.

    Q.3 What do u do in your company. What does your company do?
    For no apparent reason i started babbling. He got the hint and completed the sentences for me. While i kept quoting Spring and Hybris and other heavyweight technologies he simply translated them as 'Oh!!! Servlets, Controllers and JSP's. Okki". And frankly he was looking for a lot less. All he wanted was somebody that knew core java. Call me pessimist but at this point i knew it's over.

    Q.4 How did you find the written test.
    Me.  I was looking for Java so this was quite a surprise.
              Yeah, don't you know that i am the inventor of Java. How dare dost thou asketh me these petty questions.

    Q.5 Why is String immutable?
    Explaining the entire history of StringBuffer and StringBuilder did not cut any ice. Saying that since all the primitive types and there corresponfing wrapper classes are immutable as well so String was made immutable to give it a primitive like 'look and feel', was not much correct as well. Later, he explained that if it were not immutable how would you create a pool of String. It had something to do with saving heap space and getting it thread-safe. I am still working on finding the semantic meaning of that sentence.

    Q.6 What is serializable. When do you use it. How do u serailize and deserialize an object. Do you use toString()  to Serialize an object?
    Explained that serializable is used to bring objects in a persistance state so that they maybe written in a file. You can serialize by implementing the Serializable interface. Using toString() will simply return a String <Class Name>@<hashcode>, so there must be another mechanism.

    Q.7 Sensing that i am faltering he asked what Database do i use.
    Me. Actually there is no such database. We push data in the data base 'Endeca' from hybris using cronjobs like partial update and baseline update. Hybris also has a database of its own that stores some information.
    Listening to even more heavyweight words confirmed his earlier premonitions. Now he had an active dislike in my candor. It was only a matter of minutes now.

    Q.8 What are the collections available in Java?
    Me. List, Set, Map...

    Q.9 Difference between List and Set?
    Me. Set has all unique elements while List may have non-unique elements.

    Q.10 How does Set check if we are adding unique elements?
    Me. Inside there must be a loop.
    Him. But how?
    Me. It compares and finds if the element already exists.
    Him. But how does it compare the class that i just created say 'Student'?
    Me. It should be having generic coding inside i.e. using <T> and that <T> will get replaced by Student at run time.
    Him. But how does it do that?
    Me. It must be having a check == or equals() to compare.
    Him. Which one?
    Me. == checks if both the refrences are pointing to the same object and equals() compare the values or whatever we override.
    Him. So which one?
    Me.Ummm.....welllllll.....................aaaaaaaaaaaaaaaa...................hashcode..........something something.....................ummmmmmmmmmm
    Him. Oki if hashcode() comparison of two references returns true  does that mean they are equal?
    Me. No. if hashcode() returns true then the two references may be equals/ may not be equal but if it returns false, then equals() will return false for sure.
    Him. Then why not use simply hashcode() comparison. Why go for equals() ?
    Me. Totally blank face.
    Can't believe it started from something as innocent as Set.

    Q.11 What are the conditions/ restrictions on overriding a method?
    Me. The child class must have the access specifier that is less restricitve or same as parent method. Example if parent class has its method specified as protected, then the child class can make it either public or protected.
    Him. Why is that? Why not more restrictive?
    Me. After thinking the hell out of my brain. When you override a method you make a refernce of parent type. Initialize it with the object of child type and then call an overridden method using that reference. Now, if it were more restricitive. Then  calling the overridden method would result in an exception.
    Him. During runtime or compile time?
    Me. During runtime. That's when overriding comes into play.

    Q.12 You work on Spring. Right?
    Me. Aye. I do.
    Him. All that controller and servlets. Okki. So if you define a global variable,which acts as a counter in your servlet and 50 requests are made to that servlet then what will be value of that counter at the end of all the requests. All requests are coming simultaneously.
    Me. That vaiable is static. Ain't it!!
    Him. Does that even matter?
    Me. Yeah. Coz the servlet will make multiple threads.
    Him. But the object will still be the same. Isn't it. The container creates one object for a servlet and then that servlet can have many threads sharing the same variable space.
    Me. Then we can't say what will be the final value as it is not thread safe.
    Him. What can we do to make it thread safe?
    Me. Put it into synchronized block.
    Him. Any other method?
    Me. No idea.
    Him. Actually there is a keyword atomic which puts the variable in locations which are thread safe.

    Q.13 Anything you wanna ask me ?
    Me. What is unicommerce?
    Him. ITs a company founded around 1.5 years ago. We provide services for inventory management and eommerce.
    Thanx.
    Now comes the final nail in my coffin.
    Soooooooooooooo, we will contact you later.
    I know. I have heard it many times.