# CouponDunia Interview Experience

• Last Updated : 27 Feb, 2016

I recently got an offer from CouponDunia, here is my interview experience:

There were four rounds.

Hey geek! It's time to become a success story instead of reading them. Check out our most renowned DSA Self Paced Course, now at a student-friendly price and become industry ready. And if you are looking for a more complete interview preparation resource, check out Complete Interview Preparation Course that will prepare you for the SDE role of your dreams!

Feeling prepared enough for your interview? Test your skills with our Test Series that will help you prepare for top companies like Amazon, Microsoft, TCS, Wipro, Google and many more!

Round 1: Coding Test on HackerRank.

Three question in 90 minutes.

Round 2: Telephonic Interview

1. Let’s say that you have 25 horses, and you want to pick the fastest 3 horses out of those 25. In each race, only 5 horses can run at the same time because there are only 5 tracks. What is the minimum number of races required to find the 3 fastest horses without using a stopwatch? (http://www.programmerinterview.com/index.php/puzzles/25-horses-3-fastest-5-races-puzzle)
2. Implement queue with the help of two stacks.
3. Given a table “student” of with columns Name and Marks. You have to write a SQL query to get the 2nd highest marks from the table. Also write a query to find the nth highest marks, where n can be any number.
4. What is left join. Give example.
6. What is SQL injection?
7. Given three arrays sorted in non-decreasing order, print all common elements in these arrays.
Examples:
ar1[] = {1, 5, 10, 20, 40, 80}
ar2[] = {6, 7, 20, 80, 100}
ar3[] = {3, 4, 15, 20, 30, 70, 80, 120}
Output: 20, 80
ar1[] = {1, 5, 5}
ar2[] = {3, 4, 5, 5, 10}
ar3[] = {5, 5, 10, 20}
Output: 5, 5
8. Difference between program, process and threads.
9. How will you display the most popular coupons on the CouponDunia website? What approach will you follow?

Round 3: Assignment(Java project)
Imagine we have an Email Queue table in our database with each row representing an email that needs sending. Table Name: EmailQueue Columns: id, from_email_address, to_email_address, subject, body (you can also add columns as you wish, but at minimum it should have these columns). Write a java program that will read from this table and send the emails over an SMTP server (not local unix mail). For the SMTP sending you can use a pre-existing library of your choice, if you wish. Please take into consideration the following:

1. Speed is of the utmost concern. Imagine we have 1 million emails to send. Your code should not sequentially send one email after another.
2. Your solution should scale. In other words, if we determine the fastest we can send emails from a single server is 300 emails/second I should be able to run the same Java program on another server and be able to send another 300 emails/second.
3. Your code should be careful to ensure that it is not possible for the same email to be sent twice (especially when running multiple processes of the program).
4. Don’t worry about whether the SMTP server can handle the load. It can.
5. Order emails are sent is not necessarily important. In other words, even though I’m calling this a “queue” it’s not important to guarantee that emails are sent in the order they arequeued.
7. Once again, speed is the primary concern. So do remember to think about what the slow points in the email sending process could be and take efforts to minimize those pain points.
8. Send me instructions on how to compile/run/test your code along with the code itself. Also the sql statements for me to create the table that you are working with and the sql statements to insert a few test emails.

Round 4: Skype Interview