Python
What is a subnet mask and why is it needed?
Have you been unemployed or not participated in projects since May?
How did the system work before transitioning to event-driven/Kafka: was it REST API on FastAPI?
It is necessary to validate the structure ONLY for the correctness of opening and closing brackets. test_data = [ "[][[]]", # valid "[[[]]]", # valid "[][][]", # valid "]]][[", # invalid "[[[]", # invalid "[]]", # invalid "[[]]", # invalid "][]]", # invalid "[]][[]", # invalid "[][[]", # invalid ] def is_valid(value: str):
# So, the requirements "what and how this code should do" should be accepted as it actually works now. # So, the requirements "what and how this code should do" should be accepted as it actually works now. db = Model() def process(data): print("file size: " + str(len(data))) users_lines = open("/opt/data/users.txt").read().splitlines() resultat = [] for stroka in users_lines: trasictions_lines = open("/opt/data/transactions.txt").read().splitlines() process(trasictions_lines) for str2 in trasictions_lines: parts = str2.split() is_valid = db.check_transaction( user_id=parts[3], change=parts[4], ) if not re.search("\d{4}-\d{2}-\d{2}\s+\d{2}:\d{2}:\d{2}\s+\d+\s+\w+\s+\d+.\d+", str2): continue user_id = stroka.split()[0] regdate = db.get_regdate(user_id) if re.search("\d{4}-\d{2}-\d{2}", regdate) and re.search("\d+.\d+", parts[4]): resultat.append(str2) if len(resultat) > 0: print("match")
20. Valid Parentheses Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is valid if: 1. Open brackets must be closed by the same type of brackets. 2. Open brackets must be closed in the correct order. 3. Every close bracket has a corresponding open bracket of the same type. Example 1: Input: s = "()" Output: true Example 2: Input: s = "()[]{}" Output: true Example 3: Input: s = "(]" Output: false
What happens after entering a domain name in the browser's address bar and pressing Enter? Describe the sequence of events.
If you first increase a value by 20%, then decrease the resulting value by 20%, what will be the result relative to the initial value?
Implement a curried addition function add(a) that takes a number and returns another function that takes a second number. The final call returns the sum of the two numbers.
Who should pay the fee when transferring and how should it be reflected in the operation?
Why did you decide to enter the market? What is unsatisfactory about your current job?
What other programming languages have you worked with or what non-commercial development experience do you have?
How many threads can execute bytecode in Python simultaneously?
How to organize fee collection when transferring money between users: what questions to ask the business and what technical solutions to suggest?
How do you navigate and work in Unix systems: how to connect and perform basic diagnostics?
Implement pseudocode for fee collection in the existing method `User.transfer`: what entries and checks are necessary?
Why are you interested in backend development and why did you choose this direction?
Are there any questions about the interview stages?
Do you have documents of military registration and higher education on hand?
How many connected regions are in the matrix (Number of Connected Regions)? Condition Given a 2D matrix of integers. Each cell contains a number. Two cells are considered connected if they are adjacent horizontally or vertically and contain the same number. A connected region is a maximum group of cells with the same value, connected to each other. Write a function that returns the number of such connected regions in the matrix. Input data A 2D array of integers grid (matrix size m×n). Output data An integer — the number of connected regions. Constraints 1 <= m, n <= 100 Code template: # Available without import: json, sys, io def count_regions(grid): # TODO: implement the solution here return 0