Interview Question for Software Engineer in Tests


Country: India
Interview Type: Written Test




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

Assuming that the coins mentioned above are the only allowed coins.

1) Positive case for each of the product when exact amount of coins are supplied.
2) Positive case for products other than tea in multiples of lower value coins (various possible denominations).
3) When excess amount is entered and change has to be returned after dispensing product.
4) Product is unavailable
5) How should the system behave when it doesn't have enough change to return in case of excess amount (should the order be rejected?)
6) Product unavailable + excess amount given
7) Insufficient amount supplied for the product

These are what comes to my mind immediately. Others can post more cases which I might have missed.

- arun_lisieux May 13, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Php code:

<?php
 $d = "";
 echo " $d coin<br />";
 
 switch ($d){
  case '50':
    	echo "tea"; 
		break;
	case  '1 rupee':
		echo "Coffee ";
		break;
	case '2 rupee':
		echo "Ice price ";
		break;	
	case '3 rupee':
		echo " Cold Coffee ";
		break;	
	case '10 rupee':
		echo " Milk ";
		break; 	
	default:
		echo "please put the coins in machine";
		break;
}
     
?>

- Padma Muniyasamy May 15, 2013 | 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