Full Stack Softwareentwickler Interview Questions

1,680 full stack softwareentwickler interview questions shared by candidates

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(); } } } }
avatar

Full Stack Software Engineer

Interviewed at Costco Wholesale

3.9
Jul 16, 2024

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(); } } } }

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
avatar

Full Stack Software Engineer

Interviewed at Costco Wholesale

3.9
Jul 16, 2024

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

Viewing 331 - 340 interview questions

Glassdoor has 1,680 interview questions and reports from Full stack softwareentwickler interviews. Prepare for your interview. Get hired. Love your job.