karat sde Interview Experience | karat Latest Interview Experience

425 Views
No Comment
karat sde Interview Experience | karat Latest Interview Experience

Karat's interviewers are outsourced globally, and the main focus is on a flexible schedule, and a lot of people, like me, will pick evenings or weekends for interviews.

Karat sde interview a little experience: please train yourself in karat environment, and leetcode is not the same, here the testcase need to write their own. of course, the questions may have prepared testcase. Of course, you may already have a testcase in the question, but the kind of complex input is not tested, such as binary tree, letcode is to help you read the testcase and then automatically call the solution, but it is impossible to do that here. Arrays, strings, and hash maps are the main focus.

karat sde interview real sharing

Code Question 1

karat sde interview Code Question 1

The question asks to determine whether the elements in a given two-bit array conform to a specific rule for each row and column.

Ideas

That is, two traverses the two-dimensional array, as long as any row or column does not meet the requirements, return False; if all rows and columns are validated, return True.

The questions are not too difficult, not concerned with algorithm complexity, just pass all tests.

Code Question 2

karat sde interview Code Question 2

The meaning of the question is that you have a number of people who are going to a campground, and only 2 of them have a car and are starting from different starting points.
Roads are linear directed linked list structures (no loops, no forks).

Each vehicle proceeds along the road (with travel time on each side), the
Passing through each location you will pick up friends who live there.

Idea:

This is actually a shortest path coverage problem, but since the route is linear and branchless, the problem can be simplified as follows: for each location, compute the time of arrival of the two vehicles and take the earlier one to pick up the corresponding friend.

# TC: O(n) = max(len(list), len(products)) = MAX(m, n) =
# SC: O(n) = products len, depts len = max(m, n) = # SC: O(n) = products len, depts len = max(m, n)
def shopping(products, shopping_list).
    # dict
    product2dept = {product: dept for product, dept in products}

    # calc original visits
    original_visits = 0
    prev = None
    for item in shopping_list: curr = product2dept[item].
        curr = product2dept[item]
        if curr ! curr = product2dept[item] if curr !
            original_visits += 1
        prev = curr

    # optimal visits
    depts = set()
    for item in shopping_list.
        depts.add(product2dept[item])

    # output diff
    return original_visits - len(depts)


# print(shopping(products, list1))
# print(shopping(products, list2))
# print(shopping(products, list3))
# print(shopping(products, list4))
# print(shopping(products, list5))

ProgramHelp usually help students throughout the mock, coding, eight shares, system design can be interview assistance, on behalf of the interview. With our support, Karat / Google / Amazon / Microsoft / TikTok OA and VO can be obtained.

author avatar
ProgramHelp
END
 0