---
# System prepended metadata

title: Basic code interview questions

---

# Basic code interview questions

## Question 1

```python
first_word = ["a", "d", "x", "y", "z"]
second_word = ["a", "b", "c", "d", "a"]


for first_letter in first_word:
    for second_letter in second_word:
        if first_letter == second_letter:
            print(first_letter) 
            break
```

## Question 2

```python

first_word = ["a", "d", "x", "y", "z"]
second_word = ["a", "b", "c", "d", "a"]

output = []
for second_letter in second_word:
    if second_letter not in output:
        output.append(second_letter)
for first_letter in first_word:
    if first_letter in output:
        print(first_letter)
```