# 3 mil

Preguntas de entrevista para Python Developer compartidas por los candidatos

## Principales preguntas de entrevista

Ordenar: Relevancia|Popular|Fecha
A un Python Developer le preguntaron...26 de mayo de 2019

### First Round: Write a pattern 1: Should accept only odd numbers numbers only except 2: Pattern should be fully Dynamic for n =1 @@@@@ * ** *** **** ***** ****** ***** **** *** ** * @@@@@ Second Round:n=6 * ** *** **** ****** ****** ***** **** *** ** *

7 respuestas

num = int(input()) for i in range(num): print('@',end="") for i in range(num+2): for j in range(i): print("*",end="") print() for i in range(num,0,-1): for j in range(i): print("*",end="") print() for i in range(num): print('@',end="") Menos

num = int(input()) for i in range(num): for j in range(num): print(" ",end=" ") for j in range(num-i): print(" ",end="") for j in range(i+1): print("*",end=" ") print() for i in range(num,0,-1): for j in range(num-i+1): print(" ",end="") for j in range(i): print("*",end=" ") print() Menos

with less loops n=int(input()) print(n*"@") for i in range(1,n+2): for j in range(i): print("*",end="") print("") for i in range(n,0,-1): for j in range(i): print("*",end="") print("") print(n*"@") Menos

Mostrar más respuestas

### Find set of chars not repeated in a list.

6 respuestas

I bet you come from C++? return [x for x in li if li.count(x) == 1]

There's actually an even simpler solution: return set(li)

A=['a', 'b,' a'] Set(a) ['a', 'b']

Mostrar más respuestas

### # n=3 * * * @ * @ * @ * * * #n=5 * * * @ * * * @ * * * @ * * * @ * * * @ * * * somewhat similar to these !

5 respuestas

I was only able to do this : * * * @ * * * @ * * @ * @ Menos

Please elaborate your question.. How question pattern looks like. It's seems in single line and you printed in multiple lines... thank-you Menos

n = int(input("num")) print("* " ) print("* ", end="") print("* ", end="") print("@ ", end="") print("\n") for i in range(n-2, 0, -1): m = n-1-i for j in range(i): print("* " , end="") print("@ ", end="") for k in range(m): print("* ",end="") print("\n") print(" ", end="") print(" ", end="") print("@ ", end="") print("* ", end="") print("* ") for m in range(5): if m&lt;4: print(" ", end="") else: print("* ") Menos

Mostrar más respuestas

### question on list ,sets and dictionary

4 respuestas

What were the questions about in the online test and face to face round

Face to face they ask related to DS al

do you remember questions asked in online hackerrank test

Mostrar más respuestas

### Given a very long string composed of numbers as characters, find the four character substring that has the largest multiple. For example, given the string "809723", the two char substring with the largest multiple is "97", having a multiple 9*7 = 63.

4 respuestas

max([functools.reduce(operator.mul, data[i-4:i]) for i in data if i &gt; 3])

max([functools.reduce(operator.mul, data[i-4:i]) for (i, e) in enumerate(data) if e &gt; 3]) Menos

def largest_2str_multipler(a): l = len(a) m = int(a[0])*int(a[1]) for x in range(1,l-1): if m &lt; int(a[x])*int(a[x+1]): m = int(a[x])*int(a[x+1]) return m Menos

Mostrar más respuestas

### Write a Program to print sum of even numbers which is divisible by 8:-

4 respuestas

what was the question in your Hackathon round?

Share the questions of hackathon round plz

It will. Be great help if someone can update here questions of Hackathon Or round 3 . Thanks! Menos

Mostrar más respuestas

4 respuestas

Fair.

Easy one

Easy one

Mostrar más respuestas

### How would you triage and go about fixing infrastructure problems? Giving an input file, get the number of lines matching a specific piece of text using bash scripting. Give the percentage of lines in the file that match that string.

3 respuestas

1.) I said hard to tell because that is a very vague question. 2.) Use grep and awk and wc. 3.) Use the above plus "bc" to calculate percentage. Menos

for: 2.) Use grep and awk and wc. I believe grep + uniq + wc would be better and simpler, right? Menos

for: 2.) Use grep and awk and wc. 'grep -c' is enough

### How to remove duplicated items in a list? What's the complexity of your algorithm?

3 respuestas

def rem_dupe(input_list): x = set(input_list) return [y for y in x]

def remove_duplicates(arr): return list(dict.fromkeys(arr).keys())

def remove_duplicate(l): ...: res = [] ...: n = len(l) ...: if n &lt; 2: ...: return l ...: for i in range(1,n): ...: if l[i-1] != l[i]: ...: res.append(l[i-1]) ...: res.append(l[-1]) ...: return res Menos

### For the years 1901 to 2000, count the total number of Sundays that fell on the first of a month.

3 respuestas

import datetime c = 0 for y in range(1901,2001): for m in range(1,13): d = datetime.datetime(y,m,1) if d.weekday() == 6: c += 1 print('Number of Sundays: ',c) Menos

import datetime count=0 for i in range(1901,2001): for j in range(1, 13): if datetime.date(i,j,1).weekday() == 6: count+=1 print(count) Menos

Two lines of code in matlab: Answer is 171 sundays fall on the first day of the month from 1 Jan 1901 to 31 Dec 2000 dt = datenum(1901,1,1):datenum(2001,1,1)-1; sum(day(dt(weekday(dt) == 1)) == 1) Menos

Viendo 1-10 de 2518 preguntas de entrevista