Theory Modifier Class Package Subclass World public Y Y Y Y protected Y Y Y N no modifier Y Y N N private Y N N N OOD interview step by step Clarification List use cases(APIs) Prioritize Define classes(data + action) and their relationship(Association, Aggregation, Inheritance) Optimize design with basic concepts abstraction ancapsulation inheritance polymorphism design pattern others enum generics comparable/comparator eager/lazy computation iterator … Coding Test
Theory In computer science, divide and conquer is an algorithm design paradigm. A divide-and-conquer algorithm recursively breaks down a problem into two or more sub-problems of the same or related type, until these become simple enough to be solved directly.
Asymptotic Notations Asymptotic notations are the mathematical notations used to describe the running time of an algorithm when the input tends towards a particular value or a limiting value.
example For example: In bubble sort,
Theory A greedy algorithm is any algorithm that follows the problem-solving heuristic of making the locally optimal choice at each stage. In many problems, a greedy strategy does not usually produce an optimal solution, but nonetheless, a greedy heuristic may yield locally optimal solutions that approximate a globally optimal solution in a reasonable amount of time.
Theory G(Graph) = E(Edges) + V(Vertices)
Graph can be:
Directed or undirected(also called bidirected) Cyclic or acyclic Connected or disconnected Given V in a graph, how many Edges do we have?
Theory Breadth-first search (BFS) is an algorithm for traversing or searching tree or graph data structures. It starts at the tree root(or some arbitrary node of a graph, sometimes referred to as a ‘search key’), and explores all of the neighbor nodes at the present depth prior to moving on to the nodes at the next depth level.