How to implement parallel processing within a single consumer with waiting for completion? (Virtual Threads)
DevOps
What are consumer groups in Kafka?
No explicit interview question or task is stated in the screenshots. The images show Java code snippets: 1. The first snippet demonstrates: - Creating a List of Lists of Strings representing auto numbers. - Using streams to flatten the list and print each element. - Using streams to create a Map where keys are the original strings and values are the strings with all digits removed. 2. The second snippet shows a method: ```java public static boolean isPerfectSquare(int n){ if (n < 0) return false; int sqrt = (int) Math.sqrt(n); return sqrt * sqrt == n; } ``` This method checks if a number is a perfect square. No direct question or task is provided in the screenshots.
What problem does offset management solve? What would happen without it?
Is it worth creating a consumer group if we only have one consumer?
Why is asynchronous processing inside a consumer better than horizontal scaling?
//list of car license plates, the numbers are always of a standard type // need to output each number separately to the console // then create a map of number - its digits (example A123BC:123) where key is A123BC and value is 123 //var autoNumbers = List.of(List.of("A123BC", "B421FT"), List.of("0543EC","B421FT", "I2220A")); import java.util.*; import java.lang.*; import java.io.*; class Codechef { public static void main (String[] args) throws java.lang.Exception { // your code goes here } }
How to avoid consumer death during long message processing and what are the risks of long reading?
public static boolean isPerfectSquare(int n){ if (n < 0) return false; int sqrt = (int) Math.sqrt(n); return sqrt * sqrt == n; }
What was the technology stack in your last project?
What will happen if the consumer takes a long time to process messages (for example, 4 seconds)?
What specific tasks did you do on the project?
How to efficiently unload a large volume of data from a database into memory, generate a file, and serve it to the frontend? Can compression be used?
//list of car license plates, numbers are always of the same standard type // need to output each number separately to the console // then create a map of number to its digits (example A123BC:123) where key is the license plate and value is the digits //var autoNumbers = List.of(List.of("A123BC", "B421FT"), List.of("O543EC","B421FT", "I2220A"));