Review the EmployeeManager class. Identify and explain the bad practices in the code. Find the bugs that could cause errors during execution. Provide suggestions for improving the code quality and functionality. Consider the following aspects: Code structure and readability. Proper use of data structures. Error handling and edge case considerations. Java coding standards and best practices. Write your review and improvement suggestions. Explain why certain parts of the code are problematic. Suggest specific changes and improvements. import java.util.List; import java.util.ArrayList; public class EmployeeManager { private List employees; public EmployeeManager() { employees = new ArrayList<>(); } // Adds an employee to the list public void addEmployee(String name) { if(name != null || !name.isEmpty()) { employees.add(name); } } // Removes an employee from the list public void removeEmployee(String name) { if(employees.contains(name)) { employees.remove(name); } } // Prints all employees public void printEmployees() { for(int i = 0; i <= employees.size(); i++) { //index out of bounds will throw here System.out.println(employees.get(i)); } } // Finds an employee by name public boolean findEmployee(String name) { for(String employee : employees) { if(employee == name) {// .equals() for string comparision return true; } } return false; } // Adds an employee to a database public void addEmployeeToDatabase(String name, Connection conn) { PreparedStatement stmt = null; try { if (name != null && !name.isEmpty()) { String sql = "INSERT INTO employees (name) VALUES (?)"; stmt = conn.prepareStatement(sql); stmt.setString(1, name); stmt.executeUpdate(); stmt.close(); } } catch (SQLException e) { e.printStackTrace(); } } } }
Full Stack Softwareentwickler Interview Questions
1,680 full stack softwareentwickler interview questions shared by candidates
Given a list of daily flight prices to Maui, return a list such that, for each day in the input, tells you how many days you would have to wait until a cheaper flight is available. If there is no future day for which this is possible, put 0 instead. Example: given the list of flights [350, 349, 348, 225, 415, 300, 500, 200], your output should be [1, 1, 1, 4, 1, 2, 1, 0] For $350, wait 1 day for next lower price of $349 For $349, wait 1 day for next lower price of $348 For $348, wait 1 day for next lower price of $225 For $225, need to wait 4 days for next lower price of $200
Take home project to implement a credit card number validator using the Luhn Checksum algorithm. Make sure you write unit tests!!!
Why do you want to work at Sezzle? What makes you unique?
- Tell us about your past experience as a software engineer in the insurance industry - Describe the process differences between AGILE and SDLC project management methodologies
Write a program to find 2nd highest number
Technical test was around reading booking time frames & calculating pay totals based on different rates for times/days of the week
Reverse an array using any language
Can you tell me about various design patterns, structural and behavioural
How much money do you want?
Viewing 331 - 340 interview questions