## Linode Interview Question for Python Developers

Country: United States

Comment hidden because of low score. Click to expand.
0
of 0 vote

``````public List<Integer> uniqueSetOfDuplicateValues(int[] array) {
HashSet<Integer> valueSet = new HashSet<Integer>();
List<Integer> uniqueSet = new ArrayList();
for(int I=0;i< array.length; i++) {
continue;
else
}

return uniqueSet;
}``````

Comment hidden because of low score. Click to expand.
0
of 0 vote

``````x = input("please enter integers")
a = x.split(' ')
print(a)
d  = {}
for a1 in a:
if(d.get(a1)==None):
d[a1] = 1
else:
print(d)
print('duplicate',a1)
break``````

Comment hidden because of low score. Click to expand.
0
of 0 vote

x = input("please enter integers")
a = x.split(' ')
print(a)
d = {}
for a1 in a:
if(d.get(a1)==None):
d[a1] = 1
else:
print(d)
print('duplicate',a1)
break

Comment hidden because of low score. Click to expand.
0
of 0 vote

In python:
vals, counts = np.unique(a, return_counts=True)
vals[counts>1]

Comment hidden because of low score. Click to expand.
0
of 0 vote

``````result = []
for i in range(0, len(arr)):
for j in range(i+1, len(arr)):
if arr[i] == arr[j]:
result.append(arr[i])
print(result)``````

Comment hidden because of low score. Click to expand.
0
of 0 vote

result = []
for i in range(0, len(arr)):
for j in range(i+1, len(arr)):
if arr[i] == arr[j]:
result.append(arr[i])
print(result)

Comment hidden because of low score. Click to expand.
0
of 0 vote

set(list)

Comment hidden because of low score. Click to expand.
0
of 0 vote

>>> def duplicates(l):
... d={}
... for i in l:
... d[i]=d.get(i,0)+1
... for k,v in d.items():
... if v>1:
... print(k,'found ',v)
...

Comment hidden because of low score. Click to expand.
0
of 0 vote

>>> def duplicates(l):
... d={}
... for i in l:
... d[i]=d.get(i,0)+1
... for k,v in d.items():
... if v>1:
... print(k,'found ',v)
...

Comment hidden because of low score. Click to expand.
0
of 0 vote

``````print("Input")
duparr = input().split(' ')
#duparr = [1,1,2,3,4,10,9,8,7,6]
print(duparr)
h = {}
for d in duparr:
if(d in h):
print('duplicate')
break
else:
h[d] = 1
print(h)``````

Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

### Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

### Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.