Amazon Python Interview Question for a Data Engineer L4 Position | Python For Data Analytics

Поделиться
HTML-код
  • Опубликовано: 25 янв 2024
  • In this video we are going to discuss a Python Interview problem asked in Amazon for a data engineer Position.
    Here is the input list:
    emp_list=[('Ankit',10000),('Rahul',12000),('Sumit',14000),('Dheeraj',21000),('Pavan',11000),('Mohit',13000)]
    Expected Output: [('Sumit',14000),('Dheeraj',21000)]
    Zero to hero(Advance) SQL Aggregation:
    • All About SQL Aggregat...
    Most Asked Join Based Interview Question:
    • Most Asked SQL JOIN ba...
    Solving 4 Trick SQL problems:
    • Solving 4 Tricky SQL P...
    Data Analyst Spotify Case Study:
    • Data Analyst Spotify C...
    Top 10 SQL interview Questions:
    • Top 10 SQL interview Q...
    Interview Question based on FULL OUTER JOIN:
    • SQL Interview Question...
    Playlist to master SQL :
    • Complex SQL Questions ...
    Rank, Dense_Rank and Row_Number:
    • RANK, DENSE_RANK, ROW_...
    #python #dataengineer

Комментарии • 66

  • @user-ho7kx2qr5y
    @user-ho7kx2qr5y 6 месяцев назад +5

    Thank you so much Ankit for making video on data validation using Python 🙏🏻❤

  • @ankitbansal6
    @ankitbansal6  6 месяцев назад +20

    Do give a thumbs up to the video for more Python Interview Questions😊

    • @baskarandurai6702
      @baskarandurai6702 6 месяцев назад +1

      Kindly continue this python series Ankit... Kind request from one of your fan.. ❤❤❤

  • @aoihana1042
    @aoihana1042 6 месяцев назад +7

    To show off python skills:
    avg = sum(emp[1] for emp in emp_list)/len(emp_list)
    result= list(filter
    (lambda x: x[1]>avg, emp_list))
    print(result)

  • @prabhatgupta6415
    @prabhatgupta6415 6 месяцев назад +9

    avg_salary=sum(i[1]for i in emp_list)/len(emp_list)
    print([i for i in emp_list if i[1]>avg_salary])

  • @ramakumarguntamadugu1299
    @ramakumarguntamadugu1299 Месяц назад +2

    Please continue posting similar python videos as well👍👍

  • @pranjalwaghmare3846
    @pranjalwaghmare3846 6 месяцев назад +2

    Thank you Ankit for making such practical videos on Python 🙏🙏🙏
    Eagerly waiting for more such videos!!

  • @harshitbhadoria2393
    @harshitbhadoria2393 6 месяцев назад

    Sir Today I saw your first video, how easily you explained every concept, thank you so much sir :)

  • @DEwithDhairy
    @DEwithDhairy 5 месяцев назад +1

    DSA for the Data Engineer / Data Analyst or Data Science ROle :
    ruclips.net/p/PLqGLh1jt697wQTamFvXx_Odlm-Wg3zbxq&si=6owKBIz4xO93BxPN

  • @adityatomar9820
    @adityatomar9820 6 месяцев назад

    I reallly needed this series sir, THANKYOU

  • @pankajrao6895
    @pankajrao6895 6 месяцев назад +8

    we want more python videos ankit , keep em coming

  • @nidhigupta7606
    @nidhigupta7606 6 месяцев назад

    Thanks @ankit looking forward to more such examples.

  • @dianasatapathy594
    @dianasatapathy594 Месяц назад

    Your sql videos have helped us a lot in our career. Please make more videos in python as well:)

  • @sapnanimbalkar1210
    @sapnanimbalkar1210 6 месяцев назад

    Thanks Ankit for Python🐍 Content as well. Needed the most 🍀

  • @avi8016
    @avi8016 6 месяцев назад

    Great initiative 💯
    This will help us a lot, thankyou so much 🙏

  • @dikshantchaudhary3014
    @dikshantchaudhary3014 5 месяцев назад

    We need more videos on python question . Thanks!

  • @the_realkumar
    @the_realkumar 6 месяцев назад

    Very informative , very much demanding video, bro please bring everyday it's very helpful...❤❤❤

  • @shailendra9292
    @shailendra9292 6 месяцев назад +2

    import numpy as np
    avg_sal = np.mean([x[1] for x in emp_list])
    print([x for x in emp_list if x[1] > avg_sal])

    • @Tusharchitrakar
      @Tusharchitrakar 6 месяцев назад

      This is much better since numpy is more efficient due to vectorization

  • @sprinter5901
    @sprinter5901 6 месяцев назад +2

    Alternative solution using pandas
    emp_list = [('Ankit', 10000), ('Rahul', 12000), ('Sumit', 14000), ('Dheeraj', 21000), ('Pavan', 11000), ('Mohit', 13000)]
    df = pd.DataFrame(emp_list, columns=['emp_name', 'Salary'])
    average_salary = df['Salary'].mean()
    df[df['Salary'] > average_salary]

  • @karankakkar9020
    @karankakkar9020 5 месяцев назад

    Thanks Ankit..❤ please start python interview question series

  • @zainaltaf4935
    @zainaltaf4935 6 месяцев назад

    its a good video ankit

  • @Data.scientistt
    @Data.scientistt 6 месяцев назад +1

    def avg_sal(emp_list):
    avg_sal = sum(i[1] for i in emp_list)/ len(emp_list)
    return [x for x in emp_list if x[1] > avg_sal]

  • @rk-ej9ep
    @rk-ej9ep 6 месяцев назад

    This is nice..👍👍

  • @nipunshetty9640
    @nipunshetty9640 6 месяцев назад

    Man What a Head you Have Ankit genius😁🙌👌

  • @vikramjitsingh6769
    @vikramjitsingh6769 6 месяцев назад

    Python series would be great Ankit...

  • @xiamojq621
    @xiamojq621 6 месяцев назад +1

    Please can you upload video on implementation of statistical concept using python

  • @tharanga835
    @tharanga835 6 месяцев назад

    Now i can solve complex sql question after doing your sql video series, but I am missing python, Please do python interview question, thank you sir for your effort and time

  • @DineshGudla
    @DineshGudla 5 месяцев назад

    @ankit bansal it is a great way to learn basics

  • @dattatraysuryawanshi934
    @dattatraysuryawanshi934 6 месяцев назад

    We want more video like this. If may I request, you can type in notebook comments the python concept used to solve probelm. Like in this problem concept used is tuple unpacking..

  • @saipriya2682
    @saipriya2682 5 месяцев назад

    Thank you, its really helpfull.

  • @adityamohapatra9530
    @adityamohapatra9530 6 месяцев назад

    Created a dataframe and stored the value of the list and then using the pandas dataframe manipulation to filter the names of the employees salary greater than average.

  • @Tiger_Gaming30
    @Tiger_Gaming30 6 месяцев назад

    How can we append multiple dictionaries with same key but different values in empty list of dictionary dynamically

  • @balabhadrakotesh4064
    @balabhadrakotesh4064 6 месяцев назад +3

    My Solution:
    emp_list=[('Ankit',10000),('Rahul',12000),('Sumit',14000),('Dheeraj',21000),('Pavan',11000),('Mohit',13000)]
    avg_sal = sum([second for first,second in emp_list])/len(emp_list)
    print([emp for emp in emp_list if emp[1] > avg_sal])

  • @sanketgilbile2427
    @sanketgilbile2427 6 месяцев назад

    This is so easy

  • @raviyadav-dt1tb
    @raviyadav-dt1tb 6 месяцев назад

    Please do more videos 🙏

  • @lol000333
    @lol000333 5 месяцев назад

    Thanks for explaining but you should have covered list comprehension in the same video as well so that everyone will get all the flavor
    Sol :
    import numpy as np
    final_list = [val for val in emp_list if val[1] > np.mean([val[1] for val in emp_list])]

  • @jjayeshpawar
    @jjayeshpawar 6 месяцев назад

    avg_sal=((sum([i[1] for i in emp_list]))/len(emp_list))
    print([i for i in emp_list if i[1]>=avg_sal])

  • @vishnupsharma50
    @vishnupsharma50 3 месяца назад

    emp_name= [tuple[0] for tuple in emp_list if tuple[1]>=np.mean([val[1] for val in emp_list])]

  • @saib7231
    @saib7231 6 месяцев назад +1

    Convert the data into data frame
    Df=pd.dataframe(data)
    df['avg'] = df['salary'].mean()
    filtered_df = df[df['salary'] > df['avg']]

    • @MoHz-rx5my
      @MoHz-rx5my 6 месяцев назад

      I think Pandas are not allowed by interviewer

  • @gazart8557
    @gazart8557 5 месяцев назад

    Plz do more python plz plz

  • @-es2bf
    @-es2bf 2 месяца назад

    why do we use python when we have SQL? I have mainly used pandas just for pivot tables, since making a pivot table in sql is not that convenient. Most of them time when I am working with a df in a jupyter notebook instead of a table in a database I just google how to do this in python the way I would have done it in sql. Okay of course if you need to connect to an api and scrape a bit, it is useful but besides that why do we need it for simple filtering?

  • @adharshsunny5154
    @adharshsunny5154 6 месяцев назад

    Bro please start AWS training

  • @SumithDommati
    @SumithDommati 2 месяца назад

    emp_list = [('Ankit', 10000), ('Rahul', 12000), ('Sumit', 14000), ('Dheeraj', 21000), ('Pavan', 11000), ('Mohit', 13000)]
    total_salary=0
    for name,salary in emp_list:
    total_salary+=salary
    avg=total_salary/len(emp_list)
    print(avg)
    print([(name,salary) for name, salary in emp_list if salary > avg])

  • @zebakauser7178
    @zebakauser7178 5 месяцев назад

    My solution:
    ▪List comprehension to extract salaries.
    emp_salary = [salary for name, salary in emp_list]
    ▪Calculate average salary
    avg_salary = sum(emp_salary) / len(emp_salary)
    ▪List comprehension to filter employees whose salary is greater than the average salary
    expected = [(name, salary) for name, salary in emp_list if salary > avg_salary]
    ▪print(expected)
    [('Sumit', 14000), ('Dheeraj', 21000)]

  • @atifsuhail7803
    @atifsuhail7803 6 месяцев назад

    data=[ ('Ankit',10000),('Rahul',12000),('Sumit',14000),('Dheraj',21000),('Pavan',11000),('Mohit',13000)]
    print(data)
    avg_sal=sum(sal for _, sal in data)/len(data)
    output=[i for i in data if i[-1]>avg_sal]
    print(output)

  • @chaitalibanerjee5459
    @chaitalibanerjee5459 6 месяцев назад

    Sir when you are going to again start SQL course

  • @gurjotesinghsandhu638
    @gurjotesinghsandhu638 5 месяцев назад

    this is normal lite life, use list comprehensions for mentos pro max

  • @vamsisai6830
    @vamsisai6830 6 месяцев назад

    can you please start a dedicated bootcamp on this please

    • @ankitbansal6
      @ankitbansal6  6 месяцев назад

      It's already going on

    • @tequilajoe518
      @tequilajoe518 6 месяцев назад

      @@ankitbansal6 Pls send link to register

  • @localmartian9047
    @localmartian9047 6 месяцев назад

    Isn't this too easy for Amazon.
    How can we do this looping once

    • @ankitbansal6
      @ankitbansal6  6 месяцев назад

      It's for L4 position. So its fine.

  • @shashwatshekhar6867
    @shashwatshekhar6867 5 месяцев назад

    def final_required_output_calc(emp_list):
    sum_of_salary=0
    for i in range(len(emp_list)):
    sum_of_salary=sum_of_salary+emp_list[i][1]
    average_salary=sum_of_salary/len(emp_list)
    final_list=[]
    for i in range(len(emp_list)):
    if emp_list[i][1]>average_salary:
    final_list.append(emp_list[i])
    return final_list
    Edit:Saw your solution it is almost same 😂

  • @sasmitanayak1346
    @sasmitanayak1346 6 месяцев назад

    using list comprehension:
    emp_list = [('Ankit', 10000), ('Rahul', 12000), ('Sumit', 14000), ('Dheeraj', 21000), ('Pavan', 11000), ('Mohit', 13000)]
    avg_sal = sum(salary for name, salary in emp_list) / len(emp_list)
    my_list = [(name, salary) for name, salary in emp_list if salary > avg_sal]
    print(my_list)

  • @anandahs6078
    @anandahs6078 2 месяца назад

    emp_list = [('Ankit', 10000), ('Rahul', 12000), ('Sumit', 14000), ('Dheeraj', 21000), ('Pavan', 11000),
    ('Mohit', 13000)]
    emp_dict = dict(emp_list)
    avg = sum(emp_dict.values()) / len(emp_dict)
    print(f"average salary:{avg}")
    employee_avg_list = [(key, value) for key, value in emp_dict.items() if value > avg]
    print(employee_avg_list)

  • @chethan4160
    @chethan4160 6 месяцев назад

    my code
    def get_avg_sal(tup_list):
    total = sum(sal for _, sal in tup_list) # Calculate the total salary using a generator expression
    return total / len(tup_list)
    def get_name(tup_list, avg_sal):
    return [(name, sal) for name, sal in tup_list if sal > avg_sal]
    avg_sal = get_avg_sal(tup_list)
    my_list = get_name(tup_list, avg_sal)
    print(my_list)