Pertanyaan dan Jawaban Wawancara Paling Populer & Tes Online
Platform edukasi untuk persiapan wawancara, tes online, tutorial, dan latihan langsung

Bangun keterampilan dengan jalur belajar terfokus, tes simulasi, dan konten siap wawancara.

WithoutBook menghadirkan pertanyaan wawancara per subjek, tes latihan online, tutorial, dan panduan perbandingan dalam satu ruang belajar yang responsif.

Prepare Interview

Ujian Simulasi

Jadikan Beranda

Bookmark halaman ini

Langganan Alamat Email

Python Coding Pertanyaan dan Jawaban Wawancara

Ques 6. Write a Python program to find the nth Fibonacci number.

def fibonacci(n):

  if n <= 1:

    return n

  else:

    return fibonacci(n-1) + fibonacci(n-2)

Example:

fibonacci(5)  # Output: 5

Apakah ini membantu? Add Comment View Comments
 

Ques 7. Implement a function to find the intersection of two lists.

def intersection(list1, list2):

  return list(set(list1) & set(list2))

Example:

intersection([1, 2, 3], [2, 3, 4])  # Output: [2, 3]

Apakah ini membantu? Add Comment View Comments
 

Ques 8. Write a Python program to perform matrix multiplication.

import numpy as np

matrix1 = np.array([[1, 2], [3, 4]])

matrix2 = np.array([[5, 6], [7, 8]])

result = np.dot(matrix1, matrix2)

Example:

print(result)
# Output: [[19, 22], [43, 50]]

Apakah ini membantu? Add Comment View Comments
 

Ques 9. Create a generator function to generate Fibonacci numbers.

def fibonacci_generator():

  a, b = 0, 1

  while True:

    yield a

    a, b = b, a + b

Example:

fib_gen = fibonacci_generator()
print(next(fib_gen))  # Output: 0

Apakah ini membantu? Add Comment View Comments
 

Ques 10. Implement a depth-first search (DFS) algorithm for a graph.

def dfs(graph, node, visited):

  if node not in visited:

    print(node)

    visited.add(node)

    for neighbor in graph[node]:

      dfs(graph, neighbor, visited)

Example:

graph = {1: [2, 3], 2: [4, 5], 3: [6], 4: [], 5: [], 6: []}
visited_set = set()
dfs(graph, 1, visited_set)

Apakah ini membantu? Add Comment View Comments
 

Most helpful rated by users:

Hak Cipta © 2026, WithoutBook.