Showing posts with label questions. Show all posts
Showing posts with label questions. Show all posts

Tuesday, 13 December 2016

TCS interview

Date: 13 December 2016
Telephonic

Questions:
General overview.
  1. Why do we use parent attribute when declaring beans?
    1. What could be the disadvantage of using parent?
  2. Have you ever used a prototype bean in Hybris?
  3. How to override an attribute?
    1. Is that even possible?
  4. General architecture of Hybris.
    1. Architecture according to J2EE.
  5. How to publish a web-service in Hybris?
    1. Which extensions are used to publish a webservice in Hybris?
  6. Which one is preferable: Collection or relation? Why?
  7. Which extensions are used for connecting with cybersource?
    1. Whole process of connecting with cybersource.
    2. Have you connected using CI?
  8. What functionalities does Hybris get from Spring?
  9. How to use SOP-HOP instead of SOAP?
  10. What is Hybris planning to do with Promotions in v6.0?
  11. Define OCC.
    1. Is OCC required for connecting to storefront?
  12. How does decorator work?
    1. On which layer does it exist?
    2. What if I modelService.save() something on a decorator?
    3. What is resolver?
  13. More about integration.

Friday, 2 December 2016

TUI interview

Date: 2 December 2016
Mode: Telephonic.
Duration : 30 minutes.

Questions:

  1. What do you do in your current project?
  2. What are cronjobs? How do you set them?
  3. What is trigger? How does it work? What are the libraries that it uses internally?
  4. Explain whole indexing process?
  5. Explain whole order process?
  6. How does Action and Task work in Hybris?
  7. How to speed up impexes?
  8. Does it matter if the order of declarations are changed in an impex?
  9. What are integration frameworks?
  10. What are service frameworks?
  11. Explain how addons work.
  12. How to determine if an attribute is classification or regular hierarchical.

Friday, 6 November 2015

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?



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?

Amazon Interview

Amazon

Date: 15 November 2014
Venue : Nehru Place

Questions:

  1. Create a balanced Binary Search Tree from a sorted array.
  2. A 2-D matrix is filled with only zero and one. Each row is sorted i.e. each row has zero's on the left side and one's on the right side.Find the row with maximum number of one's.
  3. Create a NGE array for an array. NGE : Next Greater Element. For each element find the next larger element to the right. If there is no larger element to the right then show -1.
    Eg:
    An array : {5,1,23,4,7,5,88,2} will have a NGE : {23,23,88,7,88,-1,-1}.
    5    1    23  4  7    5    88   2
    23  23  88  7  88  88  -1  -1

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.

Thursday, 13 November 2014

Deloitte interview

Just had a telephonic interview with Deloitte. And Deloitte exploited Hybris real bad.

Hybris Questions:

  1. Lots of question about items.xml.
  2. Difference between Collection and relation?
  3. Dynamic attribute in an item type.
  4. How to declare an item?
  5. How to extend an item?
  6. Structure of items.xml.
  7. Various tags in items.xml.
  8. Difference between type and item.
  9. How to ensure that some particular attribute is not added to DB through persistence. Something to do with dynamic attribute.
  10. Catalog vs Catalog version?
  11. How many active catalogs are there?
  12. How to make more than one active catalog?
  13. Architecture of cockpit.
  14. What are interceptor? 
  15. How many types of interceptor?
  16. What is modelcontext?
  17. Difference between save() and saveall() in modelservice.
  18. Entire hierarchy of catalog. Whatever that means!
  19. Relation between cronjob and trigger.
  20. Flexiquery.getbyexample() or something like that.
  21. Impex structure.
  22. Lazy loading in hybris.
  23. Price Groups in Hybris
  24. What if the delimiter in impex file i.e.semicolon(;) is changed to something else. How can this be done? 
Then it was plain ol' Java stuff. Its remarkable how the java questions were so easy while Hybris ones were tougher beyond recognition.
  1. What is dynamic polymorphism, with examples.
  2. Difference between final, finalize and finally.
  3. Daemon threads
  4. Difference between ArrayList and LinkList.
  5. Difference between Set and HashSet.
  6. Objects in a JSP.
  7. Life-cycle of JSP.
  8. Tag files.
Now, all this and more was bombarded within 15 minutes. And my eager interviewer was asking the next question before i can answer the previous one.
Gotta say i feel quite drenched. Need a chilled cold coffee, though a nice fuck wont hurt either!!!!

Wednesday, 11 September 2013

Initialization-on-demand holder idiom

Example Java Implementation

This implementation is a well-performing and concurrent implementation valid in all versions of Java. The original implementation from Bill Pugh (see links below), based on the earlier work of Steve Quirk, has been modified to reduce the scope of LazyHolder.INSTANCE to private and to make the field final.
public class Something {
        private Something() {}
 
        private static class LazyHolder {
                private static final Something INSTANCE = new Something();
        }
 
        public static Something getInstance() {
                return LazyHolder.INSTANCE;
        }
}

How it works

The implementation relies on the well-specified initialization phase of execution within the Java Virtual Machine (JVM); see section 12.4 of Java Language Specification (JLS) for details.
When the class Something is loaded by the JVM, the class goes through initialization. Since the class does not have any static variables to initialize, the initialization completes trivially. The static class definition LazyHolder within it is not initialized until the JVM determines thatLazyHolder must be executed. The static class LazyHolder is only executed when the static method getInstance is invoked on the class Something, and the first time this happens the JVM will load and initialize the LazyHolder class. The initialization of theLazyHolder class results in static variable INSTANCE being initialized by executing the (private) constructor for the outer class Something. Since the class initialization phase is guaranteed by the JLS to be serial, i.e., non-concurrent, no further synchronization is required in the staticgetInstance method during loading and initialization. And since the initialization phase writes the static variable INSTANCE in a serial operation, all subsequent concurrent invocations of the getInstance will return the same correctly initialized INSTANCE without incurring any additional synchronization overhead.