How are you generally with DevOps technologies — Kubernetes, CI/CD, and others?
Java
How do you feel about AI potentially replacing developers? How do you see development in 2-3 years?
import java.util.Arrays; import java.util.HashMap; import java.util.Map; public class badCounter { public static Map<String, Integer> mapOfBadNames = new HashMap<>(); protected void doProcessing(String filePath) throws IOException { try { FileInputStream fis = new FileInputStream(filePath); BufferedReader br = new BufferedReader(new InputStreamReader(fis)); while((br.readLine())!=null){ processWords(br.readLine()); } br.close(); fis.close(); } catch (IOException | NullPointerException ex) { System.out.println(ex.getMessage()); } } private void processWords(String line) { Arrays.stream(line.split(" ")) .map(String::trim) .forEach(word -> { if(mapOfBadNames.containsKey(word)){ mapOfBadNames.put(word, mapOfBadNames.get(word)+1); } else{ mapOfBadNames.put(word, 1); } }); } public void writeResultToFile(String path) throws IOException { try { PrintWriter out = new PrintWriter(path); out.println("word,frequency"); for(Map.Entry<String, Integer> entry : mapOfBadNames.entrySet()){ out.println(entry.getKey() + "," + entry.getValue()); } out.close(); } catch (NullPointerException | IOException ex) { throw new RuntimeException("Error writing to file", ex); } } public boolean isEverythingFine() { return true; } public static void main(String[] args) { badCounter bcn = new badCounter(); try { bcn.doProcessing("bad_input.txt"); bcn.writeResultToFile("result.csv"); bcn.doProcessing("bad_input1.txt"); bcn.writeResultToFile("result1.csv"); } catch (IOException ex) { System.out.println("Something went wrong"); } } }
Does the order of columns matter when creating a composite index?
What is the difference between Hibernate and JPA?
Can the argument of a method be considered a temporary variable inside a function?
Is it possible to implement a RESTful API relying entirely on the DELETE HTTP method for all operations?
In what form did the requirements for the tasks come to you?
How to solve the data inconsistency problem: an external call was successful, but saving to the database failed?
How can you view or display the current Instance object in the program?
If there is a chain of objects that refer to each other, at what point can a specific object be deleted?
If the number of tasks is floating (from units to hundreds), what type of thread pool should be chosen?
What are Spring Boot starters? How do they differ from regular libraries? What is auto-configuration?
What are the default fetch types for entity relationships in Hibernate (EAGER or LAZY)?
Why do you want to leave [company]?
What are your thoughts on writing tests?
Are there any restrictions on indexes? What types of indexes exist (hash, B-tree) and when should they be used?
Regarding location — do you live in Moscow?
List the transaction isolation levels and briefly explain their purposes.
[name] asked: Tell about the exception hierarchy in Java.