Java Basics
OO Principles
Collections
Design
Python Basics
100

Declare a String array variable "s" (but don't create the array)

What is "String [] s" ?

100

This principle means that an object contains both data and the methods that operate on the data.

What is encapsulation ?

100

Collection of unordered items, no duplicates

What is a Set?

100

3-letter acronym means you should avoid duplicate code or duplicate logic.

What is DRY?

(Don't Repeat Yourself)

100

Python name of a collection of key-value pairs.

What is a dict?

200

This package contains Java collections.

What is java.util ?

200

It means to create one thing or concept to represent a more complex thing, so that unnecessary details are removed.

What is abstraction ?

200

Ordered collection of items, may contain duplicates, and items can be added or read at anyway in the collection.

What is List?

200

This principle means you should be able to extend the behavior of a class without modifying the class's code.

What is the Open-Closed Principle?

200

Similar to a list but immutable.

What is a tuple?

300

A class that is used to sort and search different kinds of collections.

What is Collections? (java.util.Collections)

300

Many classes can implement the same method but provide different implementation.  We can invoke the method (behavior) on different objects, without knowing which type will perform the behavior.

What is polymorphism ?

300

A collection of keys and values. For each key there is at least one value in the collection

What is a Map ?


Alt: "dict" ok for Pythonistas, but the datatype is usually called a "map".

300

This Design Pattern enables us to ensure only one instance of a class is created.

What is Singleton?

300

This exception is raised when you invoke a function using an invalid argument, but correct data type, such as math.log(-1).

What is ValueError

400

An interface that specifies a single method named "run()".

What is Runnable ?

400

One class can build on another class by incorporating all its attributes and methods.

What is inheritance ?

400

Collection that obeys "first in first out" access. You "push" elements in one end and "pop" from the other end.

What is a Queue.

400

One of the 5 "C" words of class interface design, it means that a class should provide enough methods to perform everything its required to do.

What is Completeness?

400

For a Python statement to span multiple lines without using \ (explicit continuation), the line must contain an unfinished expression using one of these 3 characters.

What are parens (), braces {}, and brackets []?

Ex:  x = ( a + sqrt(b)

             ) / 2

Any statement with unclosed (, {, or [ is implicitly continued on the next line. (So don't write really long statements on one line!)

500

A mutable String class that is also thread-safe.

What is StringBuffer?

(StringBuilder is almost identical but not thread-safe)

500

A property of a class's methods that means all the methods are related to each other and to the responsibility of the class.

What is [High] Cohesion ?

500

Collection that is both a queue and a stack. You can push/pop elements on either end. But no where else.

What is a Deque?

500

2 words meaning not to depend on too many other classes or components, esp. unstable ones.

What is Low Coupling?

500

An expression or statement that creates an anonymous or unnamed function.

What is lambda.

Ex: add = lambda x,y: x+y