DEV Community

Cover image for Interview Experience Digital Specialist Engineer - Infosys
vedant-jain03
vedant-jain03

Posted on

Interview Experience Digital Specialist Engineer - Infosys

What is HackWithInfy?

HackWithInfy is a competitive coding competition for second-year to pre-final year students across India. In this competition, participants have to solve coding questions in a given time and top performers get a chance to interview Infosys.
The level of the competition was medium-hard. I solved 1 question and got AC and other 2 partially accepted. I did not remember the exact questions but they were mainly based on Arrays, Greedy and DP.

All questions can be solved partially with brute force, so will recommend you to solve every question.

If you solved 1 questions fully and some testcases for other 2, you will definitely going to get the interview for DSE role.
So there were two roles Infosys was offering:

  • SE : 9 LPA
  • DSE : 6.25 LPA

If you are able to solve all 3, you will get upgraded to advanced rounds and will surely get the interview for SE.

Interview Experience

I got the mail on 3 May 2022 to schedule my interview and I scheduled nearest date possible 7th May. My interviewer forgot about the interview and hence he slept and get back to me after 2 hours. That was funny, XD. Never mind.
The interviewer was really chilled and cool.

  • He asked me for the introduction.
  • Then asked me about my current semester subjects.
  • He then started with question to check weather a number is prime or not. I shared my screen and he asked me that, what if in place of #include <bits/stdc++> can we write #include "bits/stdc++.h", I was not sure about it and said no it will not compiled but it compiled successfully and then I realised about importing modules in react with "". I got pretty nervous.
  • He then asked me that main() function will return 0 to whom? In my mind I was right OS, but as my overconfident killed my before I not tell him the answer.
  • Then I write the code, he gave me sample TC and it ran fine.
  • He then asked me the topic which I can not expect, What is DFA, I asked him to repeat I heard DFS, but it was Deterministic Finite Automata. Luckily I learned the topic in my online classes(YES, I attended first class) and told him everything I knew.
  • He then asked me about my projects.
  • He then started with some sense of humour question

    • What is color of the wall behind you?
    • What is the color of your Shirt?
    • How many buttons in your T-Shirt?
  • He then asked me

    • What do you know about Infosys?
    • Where do you see yourself after 5 years?

We wrapped up and ask me for any doubts.

  • I asked him about his experience.
  • I asked him about my feedback. He told me that I have good communication skills and open source experience.

Conclusion

It is going to be very chill and easy, just be confident(not over).

Top comments (5)

Collapse
 
xmachli profile image
XMachli

import org.apache.poi.ss.usermodel.;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.apache.poi.ss.usermodel.CellType;
import java.io.
;
import java.util.*;
import java.util.stream.Collectors;

public class ExcelFileMerger {
public static void main(String[] args) {
String inputFolder = "path/to/input/folder";
String outputParentFolder = "path/to/output/parent"; // Specify the parent folder for merged files

    // Find all Excel files in the input folder and its subfolders
    List<File> excelFiles = findExcelFiles(inputFolder);

    // Create the output folder for merged files
    String outputFolder = outputParentFolder + File.separator + "MergedOutput";
    File outputDirectory = new File(outputFolder);
    outputDirectory.mkdirs(); // Create the directory if it doesn't exist

    // Merge Excel files
    Map<String, List<File>> groupedFiles = groupFilesByName(excelFiles);
    for (Map.Entry<String, List<File>> entry : groupedFiles.entrySet()) {
        mergeExcelFiles(entry.getValue(), outputFolder, entry.getKey());
    }
}

private static List<File> findExcelFiles(String folderPath) {
    List<File> excelFiles = new ArrayList<>();
    File inputFolder = new File(folderPath);
    File[] files = inputFolder.listFiles();

    if (files != null) {
        for (File file : files) {
            if (file.isDirectory()) {
                excelFiles.addAll(findExcelFiles(file.getPath()));
            } else if (file.getName().endsWith(".xlsx")) {
                excelFiles.add(file);
            }
        }
    }
    return excelFiles;
}

private static Map<String, List<File>> groupFilesByName(List<File> files) {
    return files.stream()
        .collect(Collectors.groupingBy(File::getName));
}

private static void mergeExcelFiles(List<File> files, String outputFolder, String fileName) {
    try {
        Workbook mergedWorkbook = new XSSFWorkbook();
        for (File file : files) {
            FileInputStream fileInputStream = new FileInputStream(file);
            Workbook workbook = new XSSFWorkbook(fileInputStream);

            for (int i = 0; i < workbook.getNumberOfSheets(); i++) {
                Sheet sheet = workbook.getSheetAt(i);
                String sheetName = sheet.getSheetName();
                Sheet mergedSheet = mergedWorkbook.getSheet(sheetName);

                if (mergedSheet == null) {
                    mergedSheet = mergedWorkbook.createSheet(sheetName);
                }

                for (int j = 0; j < sheet.getPhysicalNumberOfRows(); j++) {
                    Row row = sheet.getRow(j);
                    Row mergedRow = mergedSheet.createRow(mergedSheet.getLastRowNum() + 1);

                    for (int k = 0; k < row.getPhysicalNumberOfCells(); k++) {
                        Cell cell = row.getCell(k);
                        Cell mergedCell = mergedRow.createCell(k);

                        if (cell != null) {
                            CellType cellType = cell.getCellType();
                            switch (cellType) {
                                case STRING:
                                    mergedCell.setCellValue(cell.getStringCellValue());
                                    break;
                                case NUMERIC:
                                    if (DateUtil.isCellDateFormatted(cell)) {
                                        mergedCell.setCellValue(cell.getDateCellValue());
                                    } else {
                                        mergedCell.setCellValue(cell.getNumericCellValue());
                                    }
                                    break;
                                // Handle other cell types as needed
                                default:
                                    // Handle unknown or unsupported cell types
                                    break;
                            }
                        }
                    }
                }
            }
            fileInputStream.close();
        }

        // Save the merged workbook to the output folder
        File outputFile = new File(outputFolder + File.separator + fileName);
        FileOutputStream fileOutputStream = new FileOutputStream(outputFile);
        mergedWorkbook.write(fileOutputStream);
        fileOutputStream.close();
    } catch (Exception e) {
        e.printStackTrace();
    }
}
Enter fullscreen mode Exit fullscreen mode

}

Collapse
 
Sloan, the sloth mascot
Comment deleted
Collapse
 
Sloan, the sloth mascot
Comment deleted
Collapse
 
sachiravi profile image
sachiravi

aaa

Collapse
 
Sloan, the sloth mascot
Comment deleted