Python-Quiz: Python Coding Interview Questions

This Python quiz prepares you for the coding round of an interview. It tests the Big-O cost of common operations, which data structure fits a problem, and patterns like two pointers, hash map lookups, memoization and binary search.

Schwer 10 Fragen ~8 Minuten Bestanden ab 80% Python 3.12

Modus wählen

Du spielst als Gast: Melde dich an, damit XP und Serie gespeichert werden.

Beispielfrage

Frage 1 von 10

What is the average time complexity of x in s when s is a set with n items?

Lösung zeigen

C. O(1) Sets and dicts are hash tables, so finding an item takes constant time on average. The same x in s on a list is O(n), because Python checks items one by one.

Darum geht es in diesem Quiz

  • Big-O of in, pop and other list, set and dict operations
  • Picking a set, dict, deque or heap for a task
  • Two pointers and the dict-based two-sum
  • Recursion limits and memoization with lru_cache
  • Binary search with bisect

Häufige Fragen

Brauche ich ein Konto?

Nein. Jeder kann spielen. Mit Anmeldung werden XP, Serie, Abzeichen und Verlauf gespeichert.

Welche Python-Version?

Python 3.12. Jede Frage zur Ausgabe wurde geprüft, indem der Code ausgeführt wurde.

Kann ich es wiederholen?

Ja. Dein Bestwert bleibt erhalten, und Fragen und Antworten werden jedes Mal neu gemischt.