Nlogk
Cheat Sheet

Problem Clarify

Input TypeQuestionsKey Considerations
IntegerWhat is the range of the input (e.g., 32-bit signed integer)?Are there rounding requirements (floor, ceiling, nearest integer)?
How to handle 0 (possible to divide 0?)
Should negative inputs be treated differently?
StringWhat is the length of the string?
What character the string may contain?
Are there case sensitivity or whitespace constraints?
Are there specific patterns (e.g., palindromes, anagrams, unique)?
ArrayWhat is the size of the array?
What is the range of values in the array?
Are there specific patterns(e.g., sorted, unique)?
Are there constraints on the input type (e.g., integers, strings)?
LinkedListWhat is the length of the linked list?
What is the range of node values?
Is the linked list singly or doubly linked?
Are there cycles in the list?
Are there special constraints (e.g., sorted, circular)?
MatrixWhat are the size (rows × columns) of the matrix?
What is the range of values in the matrix?
Are there specific patterns (e.g., binary, diagonal, symmetric)?
Are there sparse or dense constraints?
TreeHow many nodes are in the tree?
What is the range of node values?
What type of tree is it (BST, Trie, etc.)?
Is it a perfect, full, or complete binary tree?
Are there parent pointers or other special properties?
GraphHow many nodes and edges are there?
What is the range of node/edge values?
How is the graph represented (adjacency matrix, adjacency list, etc.)?
Is the graph connected or disconnected?
Is it a simple graph (no loops/multiple edges)?
Stream/IteratorWhat is the type of elements in the stream (integers, strings, objects)?
Is it finite or infinite? If finite, what is the maximum size?
What operations (read, write, or modify) are permitted on the stream?
What is the trade-off between different implementation?
How to deal with invalid elements in the stream?

Below is a visual representation of questions and Considerations for different type of input:

Input Considerations Guide

INTEGER
Questions
What is the range of the input (e.g., 32-bit signed integer)?
Key Considerations
Are there rounding requirements (floor, ceiling, nearest integer)?
How to handle 0 (possible to divide 0)?
Should negative inputs be treated differently?
STRING
Questions
What is the length of the string?
What character the string may contain?
Key Considerations
Are there case sensitivity or whitespace constraints?
Are there specific patterns (e.g., palindromes, anagrams, unique)?
ARRAY
Questions
What is the size of the array?
What is the range of values in the array?
Key Considerations
Are there specific patterns(e.g., sorted, unique)?
Are there constraints on the input type (e.g., integers, strings)?
LINKED LIST
Questions
What is the length of the linked list?
What is the range of node values?
Key Considerations
Is the linked list singly or doubly linked?
Are there cycles in the list?
Are there special constraints (e.g., sorted, circular)?
MATRIX
Questions
What are the size (rows × columns) of the matrix?
What is the range of values in the matrix?
Key Considerations
Are there specific patterns (e.g., binary, diagonal, symmetric)?
Are there sparse or dense constraints?
TREE
Questions
How many nodes are in the tree?
What is the range of node values?
Key Considerations
What type of tree is it (BST, Trie, etc.)?
Is it a perfect, full, or complete binary tree?
Are there parent pointers or other special properties?
GRAPH
Questions
How many nodes and edges are there?
What is the range of node/edge values?
Key Considerations
How is the graph represented (adjacency matrix, adjacency list, etc.)?
Is the graph connected or disconnected?
Is it a simple graph (no loops/multiple edges)?
STREAM/ITERATOR
Questions
What is the type of elements in the stream (integers, strings, objects)?
Is it finite or infinite? If finite, what is the maximum size?
What operations (read, write, or modify) are permitted on the stream?
Key Considerations
What is the trade-off between different implementation?
How to deal with invalid elements in the stream?