IBM Interview Question for Software Engineer / Developers






Comment hidden because of low score. Click to expand.
0
of 0 vote

Have a single class and create a singleton instance. The single instance will serve millions of transaction. It will calculate shipping based on the customer location. Customer location needs to be passed as input to the instance method.

- Raj August 18, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I ll prefer a single class only if the company's distrbution system is highly centeralised, bt if the company has several distribution branches around the world.........i ll have seperate class for each branch which will b called depending on its closeness frm the customer's location.

- navin9876 August 18, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Can't this be done using a simple function? Maintain a single global hash having location=>shipping cost. Cache this hashtable for good access speed. Now, have the web interface pass the baseprice + location to this function. This function accesses the hash, calculated the total price & done.

What could be wrong in this approach? Isn't having Singleton Class an overload? The class has to check each time if an instance of the class already exists etc. When there are millions of transactions will this not harm the speed?

- shrikar August 20, 2010 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More