Skills101
← All practice quizzes

Quiz: Python Interview Programs

5 questionsNo time limitPass: 60%+10 XP on first pass

The programs asked again and again in campus interviews — prime, Fibonacci, palindrome, Armstrong, factorial, anagram, frequency, second largest, binary search and FizzBuzz — with clean solutions.

Log in to take the quiz

Free account · see your score, answers and explanations, earn XP

  1. Question 1

    What does reverse_number(1200) (from this lesson) return?

  2. Question 2

    Why does the prime check loop only while i * i <= n?

  3. Question 3

    What does this print?

    print(sum(int(d) ** 3 for d in "153"))
    
  4. Question 4

    What is the time complexity of binary search?

  5. Question 5

    In FizzBuzz, what goes wrong if you check i % 3 == 0 before i % 15 == 0?