MVI Technologies Java Fresher Interview Questions and Answers

In this blog, we are going to hear about one of our trainees’ experiences at the MVI Technologies Java Interview. Our trainee got an email from MVI for an interview, and they gave 5 days’ time to prepare for the interview. Our trainee was prepared on Core Java, JDBC, Arrays, String programs, and a few more example programs to improve his logical thinking to crack the interview effectively. They asked a few questions about the file handling, collections, and some of the questions are mixed with a small task. But here our trainee has faced the only problem, time is not enough since they gave only one hour. Now, below we are going to see the questions asked in MVI technologies for a Java Interview.

1. Task:

Create a Java program that works with product data and calculates category-wise total sales.

Requirements:

1. Create a text file named products.txt programmatically.

2. Write product details into the file. Each product has three fields: Category (e.g., Phone, Stationery, Music), Product Name, Product Price

3. Category Details: There should be 3 categories: Phone, Stationery, and Music. Each category should have 3 products with their respective prices. Example: Phone, Samsung,15000

4. Read the products.txt file and calculate the total price for each category.

5. Create another text file named summary.txt and write category-wise totals into it. Each line should have the category name and total price.

Example of the output:
Phone: 125000
Stationery: 100
Music: 14200

2. Task:

You are given a string containing letters and digits. Write a program to reverse only the letters in the string while keeping the digits in their original positions.

Rules:

1. Only alphabetic characters (a–z, A–Z) should be reversed.

2. Digits (0–9) must remain at the same index as in the original string.

3. No inbuilt methods like StringBuilder.reverse() should be used; solve it manually using arrays and loops.

Example of the output:
Input: “abcde1234fgh567ijk”
Output: “kjihg1234fed567cba”

3. Task:

Write a Java program that performs the following tasks:

1. Create a file programmatically and allow the user to enter data.

2. Store the user input in a Map with the following structure: Key: Long number Value: String word

3. The user should enter at least 3 entries. Validation Conditions: Condition 1 (Number Key Validation):

4. The number must be even.

5. All digits of the number must also be even. Examples of valid numbers: 246864, 888222. Examples of invalid numbers: 248678 (contains 7, 1, 3, etc.), 135792. Condition 2 (String Value Validation):

6. The word must have exactly 6 letters.

7. The word must be a palindrome (reads the same forwards and backward). Example valid words: madam, deeded (length must be exactly 6). If both conditions are satisfied, store the number-word pair in the Map.

8. After all entries are collected, write the valid data from the Map to another file.

Example Flow:

Enter number: 246864
Enter word: deified
→ Valid, added to map

Enter number: 248678
Enter word: madamm
→ Invalid, not added

4. Task:

Write a Java program that performs the following steps:

1. Get employee details from the user: Employee ID (integer), Employee Name (string), Employee Salary (double) 

2. Store all the entered employees into an ArrayList as objects. Create an Employee class with fields: id, name, and salary. Get input from at least 3 employees from the user.

3. After storing data in an ArrayList, transfer all data into a LinkedList (one by one using loops — don’t use foreach or streams).

4. Then, programmatically create a file (e.g., employees.txt) and write all the employee details into the file.

5. Use only basic collections and file handling — No Map, no Stream, no foreach. Use the Iterate interface

Our trainee has shared all the answers to the above tasks in the git repository. You can also view by visiting the link below:

Source: [(https://gitlab.com/sathish226/java_exercise/-/tree/main/Java/src/mvi_Interview_Questions?ref_type=heads)]

Below, we have shared another question from another trainee’s interview experience:

Source: https://dev.to/vigneshwaralingam/mvi-interview-questions-2-3e8a

1. Get the 10 inputs from the user and put the map

2. key-Long-> number should be even, and also each digit should be even

3. value-String -> string should be in palindrome, and this length should not be greater than 6.

4. Then, only add them to this map, then write them into the “file.txt”

In a comma-separated values.

Code:

public class Two {
    public static <K> void main(String[] args) throws Exception {
        BufferedWriter br = new BufferedWriter(new FileWriter(new File("/home/vignesh/Desktop/data.txt")));
        Map<Long, String> map = new HashMap<>();
        Scanner sc = new Scanner(System.in);
        int c = 0;
        long key;
        String value;
        while (c <= 1) {
            System.out.println(" enter the key");
            key = sc.nextLong();
            System.out.println("enter the value");
            value = sc.next();
            if (num(key) && rev(value))
                map.put(key, value);
            c++;
        }
        int c1 = 1;
        for (Entry<Long, String> m : map.entrySet()) {
            br.write(m.getKey() + "=");
            br.write(m.getValue() + "");
            if (c1 < map.size() - 1) {
                br.write(",");
            } else {
                br.write(".");
            }
            br.write("\n");
            c1++;
        }
        br.flush();
        br.close();
        System.out.println(map + "" + map.size());
    }

    public static boolean num(long key) {
        if (key % 2 != 0)
            return false;
        while (key > 0) {
            if ((key % 10) % 2 != 0)
                return false;
            key /= 10;
        }
        return true;
    }

    public static boolean rev(String value) {
        String s = "";
        if (value.length() <= 6) {
            for (int i = value.length() - 1; i >= 0; i--) {
                s += value.charAt(i);
            }
            return s.equals(value) ? true : false;
        } else {
            return false;
        }
    }
}

Output of the code:

enter the key
262
enter the value
adda
 enter the key
44
enter the value
sdds
{262=adda, 44=sdds}2
// in the file this data succusfully writen.
We are a team of passionate trainers and professionals at Payilagam, dedicated to helping learners build strong technical and professional skills. Our mission is to provide quality training, real-time project experience, and career guidance that empowers individuals to achieve success in the IT industry.