Posts

Showing posts with the label hadoop cheat sheet

Featured Post

Python Logic to Find All Unique Pairs in an Array

Image
 Here's the Python logic for finding all unique pairs in an array that sum up to a target value. Python Unique Pair Problem Write a Python function that finds all unique pairs in an array whose sum equals a target value. Avoid duplicates in the result. For example: Input: arr = [2, 4, 3, 5, 7, 8, 9] , target = 9 Output: [(2, 7), (4, 5)] Hints Use a set for tracking seen numbers. Check for complements efficiently. Example def find_unique_pairs(arr, target):     """     Finds all unique pairs in the array that sum up to the target value.     Parameters:     arr (list): The input array of integers.     target (int): The target sum value.     Returns:     list: A list of unique pairs that sum to the target value.     """     seen = set()     pairs = set()     for num in arr:         complement = target - num         if complement in seen:...

The Ultimate Cheat Sheet On Hadoop

Image
Top 20 frequently asked questions to test your Hadoop knowledge given in the below Hadoop cheat sheet . Try finding your own answers and match the answers given here. Question #1  You have written a MapReduce job that will process 500 million input records and generate 500 million key-value pairs. The data is not uniformly distributed. Your MapReduce job will create a significant amount of intermediate data that it needs to transfer between mappers and reducers which is a potential bottleneck. A custom implementation of which of the following interfaces is most likely to reduce the amount of intermediate data transferred across the network? A. Writable B. WritableComparable C. InputFormat D. OutputFormat E. Combiner F. Partitioner Ans: e Question #2  Where is Hive metastore stored by default ? A. In HDFS B. In client machine in the form of a flat file. C. In client machine in a derby database D. In lib directory of HADOOP_HOME, and requires HADOOP_CLASSPATH to be modif...