Data Engineering Interview

แชร์
ฝัง
  • เผยแพร่เมื่อ 6 ต.ค. 2024

ความคิดเห็น • 9

  • @rahulrishi107
    @rahulrishi107 4 หลายเดือนก่อน +2

    Its a fabulous initiative. Please continue with this concept.

  • @shabarinathk8954
    @shabarinathk8954 5 หลายเดือนก่อน +2

    Great content. Pls never stop posting

  • @surajsuryawanshi444
    @surajsuryawanshi444 15 วันที่ผ่านมา

    A generic solution for the first question:
    ""
    def parsed_sum(item):
    total = 0
    if type(item) == dict:
    for _, val in item.items():
    total += parsed_sum(val)
    elif type(item) in [list, tuple, set]:
    for val in item:
    total += parsed_sum(val)
    else:
    total += item
    return total
    my_dict = {
    'v1': 10,
    'v2': {
    'v3': 20,
    'v6': [30],
    'v7': {
    'v8': 40
    }
    },
    'v5': [25, 25],
    'v6': (25, 25),
    'v7': {50, 100, 50}
    }
    print(f'Total: {parsed_sum(my_dict)}')
    """

  • @TexasMan2024
    @TexasMan2024 5 หลายเดือนก่อน

    the first Python solution is not correct here: for x in v: sum += x, because X could be list, dict again

  • @sharankarthick3364
    @sharankarthick3364 5 หลายเดือนก่อน

    Informative one!

  • @stylishsannigrahi
    @stylishsannigrahi 3 หลายเดือนก่อน +1

    sum_val=0
    def sum_of_vals_recursive(my_dict):
    global sum_val
    if (type(my_dict)==dict):#processing logic for dictionary
    for k,v in my_dict.items():
    if(type(v)==int or type(v)==float):#if the value is a simple int/float
    sum_val=sum_val + v
    else:
    sum_of_vals_recursive(v)#this will get invoked during 1st nested level
    else:#this bit of logic is for nested ones, where it is list, set, tuple from 1st nesting
    for x in my_dict:#iteration logic for set, tuple, list
    if(type(x)==int or type(x)==float):#type check of elements of the value of each iterated from previous step
    sum_val = sum_val + x
    else:
    sum_of_vals_recursive(x)#this one is for handling next set of nestng and then, it will again follow
    return sum_val;
    inp_dict = {'ireland':100,'india':[200,300,[400,[200,200],400]],'uk':{'scotland':[50]}}
    print(sum_of_vals_recursive(inp_dict))

  • @Ali.achachi17
    @Ali.achachi17 5 หลายเดือนก่อน +1

    for SQL query why u complicated here is a simple solution :
    select e.event_name , p.participant_name
    from participant p
    join Events e
    on e.event_id = p.event_id
    group by e.event_name , p.participant_name
    having count(e.event_id) > 1;

    • @JulioSerratos
      @JulioSerratos 2 หลายเดือนก่อน +1

      It easy to answer when you are not under pressure of an interviwer. A simple problem could become enormous if you do not have a the best control of your emotions.

    • @dhairyaparikh5694
      @dhairyaparikh5694 2 หลายเดือนก่อน

      On top of that, there is a possibility that there are 2 participants with the same name but different participant ids. In that case, your solution will just return 1 name instead of 2.
      That is why the interviewer stated it’s a seeming simple yet tricky question to solve.