Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

12/21/23, 10:05 PM Gmail - Fwd: Programming Test

SUMIT KUMAR <kmr.sumit2003@gmail.com>

Fwd: Programming Test


1 message

Samanyu Kansara <samanyu@panipurisoft.com> 20 December 2023 at 22:36


To: SUMIT KUMAR <kmr.sumit2003@gmail.com>

---------- Forwarded message ---------


From: Praveen Kansara <praveen@panipurisoft.com>
Date: Wed, 20 Dec 2023 at 4:26 PM
Subject: Programming Test
To: Samanyu Kansara <samanyu@panipurisoft.com>

IMPORTANT:
1. The same programming problem will be sent to all your batchmates. Any indication of
cooperation between a group of people will disqualify the entire group. It is expected that the
problem is solved independently with only the internet and books as an aid.
2. Complete the test by Saturday Evening as we will close the position by then.
3. Send me the email of whatever you can do. Make your best attempt.

Thanks for considering PPS for your career. We are interviewing you for the position of
Developer at PaniPuri Soft Limited. To be considered for the position, we would like you to
complete a programming problem and submit the solution to us.

Please find below the problem statement for the programming problem.

Part 0

1. Create a console application in Java. Preferably using Eclipse.


2. No user input should be required to run the program.

Part 1 - Classes

1. Implement Classes to represent three Shapes Circle, Triangle, and Rectangle


2. Each of the classes should be able to calculate the area and perimeter of the respective
shape.
3. Each class should be able to keep track of the number of objects created for that particular
class.
4. Each object created through your classes should have a unique identifier which is read-only.
5. Each class should be able to produce a string description of the object.
6. Your classes should be able to keep track of the total number of objects created through
them. For Example, if you created 1 circle and 2 rectangles then the total number of shapes is
3. You should be able to get this number through a function call.

Part 2 - Main Function

1. Create a total of 10 objects of the different shape classes created in Part 1.


2. Print the total number of objects created.
3. Print the total number of Circle Objects created.
4. Print the total number of Triangle Objects created.
5. Print the total number of Rectangle objects Created.
6. Place the objects in a data structure and sort them so that the objects are arranged
in descending order according to their area.
https://mail.google.com/mail/u/0/?ik=9e47336a0b&view=pt&search=all&permthid=thread-f:1785821376321286364&simpl=msg-f:1785821376321… 1/2
12/21/23, 10:05 PM Gmail - Fwd: Programming Test

7. Print the descriptions of all the Shapes in the data structure in the descending order of Area.

Sample output from the program

---------------------------------------------------------------------------

The number of shapes is 6

The number of circles is 1

The number of triangles is 2

The number of rectangles is 3

---------------------------------------------------------------------------

Sorted By Largest Area First:

Rectangle Id: 6 Area: 300.0 and Perimeter: 70.0

Circle Id: 1 Area: 153.9 and Perimeter: 44.0

Rectangle Id: 5 Area: 150.0 and Perimeter: 50.0

Triangle Id: 3 Area: 59.5 and Perimeter: 52.0

Rectangle Id: 4 Area: 50.0 and Perimeter: 30.0

Triangle Id: 2 Area: 6.0 and Perimeter: 12.0

---------------------------------------------------------------------------

What we will be looking for:

0. You must not seek help from any person.


1. You may freely use the internet and books.
2. The solution needs to be in Java.
3. The solution must compile correctly and run.
4. Your coding style.
5. Use of Object-Oriented Principles.
6. You get extra marks if you do not hardcode the number of shapes that can be handled by
this program and make it as user input.

Submission:
1. Email me the source files as attachments.
2. Email me the amount of time it took for you to solve the problem.

I shall look forward to your solution.

Thanks and Regards

Praveen Kansara
+91-99282-27666
www.mirrorerp.com
--
Regards,
Samanyu Kansara
CTO, PaniPuri Soft Limited

https://mail.google.com/mail/u/0/?ik=9e47336a0b&view=pt&search=all&permthid=thread-f:1785821376321286364&simpl=msg-f:1785821376321… 2/2

You might also like