Problem to solve

You need to choose one of the following problem statements and write a program to solve the problem in the language mentioned in respective job description. You then need to send your project to ( hr@raykor.co.in). If your program is accepted then you will be called for interview, where you may be asked to modify your program for a slightly modified problem statement.

Problem statements:

1. Write a program to print INPUT XML on screen formatted as given in OUTPUT XML such that each level is indented by one tab e.g. first level is 1 tab, second level is 2 tabs indented and so on.

INPUT XML:

<?xml version="1.0" encoding="UTF-8"?>
<company>
<name>Raykor Technologies PVT. Ltd.</name>
<employees>
<employee id="1">
<name>ABC PQR</name>
<address>
<line1>M G Road</line1>
<line2>Baner</line2>
<state>Maharashtra</state>
<city>Pune</city>
</address>
<phones>
<mobile>9876543210</mobile>
<landline>0209876543</landline>
</phones>
<education>
<degree>
<college>
<name>College of engineering</name>
<address>
<line1>M G Road</line1>
<line2>Baner</line2>
<state>Maharashtra</state>
<city>Pune</city>
</address>
</college>
</degree>
</education>
</employee>
</employees>
</company>

OUTPUT XML:

<?xml version="1.0" encoding="UTF-8"?>
<company>
    <name>Raykor Technologies PVT ltd</name>
    <employees>
        <employee id="1">
            <name>ABC PQR</name>
            <address>
                <line1> M G Road </line1>
                <line2> Baner </line2>
                <state> Maharashtra </state>
                <city> Pune </city>
            </address>
            <phones>
                <mobile> 9876543210 </mobile>
                <landline> 0209876543 </landline>
            </phones>
            <education>
                <degree>
                    <college>
                        <name>College of engineering</name>
                        <address>
                            <line1> M G Road </line1>
                            <line2> Baner </line2>
                            <state> Maharashtra </state>
                            <city> Pune </city>
                        </address>
                    </college>
                </degree>
            </education>
        </employee>
    </employees>
</company>

2. Write a program to find minimum elements in array which has sum equals to given value.

Input :

  1. Array of integers
  2. Required sum

Output :

  1. Elements from array which makes sum equals to given value

Example:

Input Array : [10, 0, -1, 20, 25, 30]
Required Sum: 45
Output: [20, 25]

Required Sum: 29
Output: [-1, 30]

3. Write a program to display value of each tree node starting from lowest node (H) till root node of the tree such that:

  1. Each node value is displayed on a separate line.
  2. Values of nodes are displayed from right to left e.g. in case of first level: E will be printed first before B or in case of second level, print order will be: G, F, D and C.
  3. Values of same level nodes are displayed first e.g. all nodes of last level will be printed before second-last level.
  4. Program should define class similar to as below given.
  5. Main class should contain logic to output the values.
  6. Each node should be visited only once.