Posts

Showing posts with the label Hadoop Interview Questions

Featured Post

Python map() and lambda() Use Cases and Examples

Image
 In Python, map() and lambda functions are often used together for functional programming. Here are some examples to illustrate how they work. Python map and lambda top use cases 1. Using map() with lambda The map() function applies a given function to all items in an iterable (like a list) and returns a map object (which can be converted to a list). Example: Doubling Numbers numbers = [ 1 , 2 , 3 , 4 , 5 ] doubled = list ( map ( lambda x: x * 2 , numbers)) print (doubled) # Output: [2, 4, 6, 8, 10] 2. Using map() to Convert Data Types Example: Converting Strings to Integers string_numbers = [ "1" , "2" , "3" , "4" , "5" ] integers = list ( map ( lambda x: int (x), string_numbers)) print (integers) # Output: [1, 2, 3, 4, 5] 3. Using map() with Multiple Iterables You can also use map() with more than one iterable. The lambda function can take multiple arguments. Example: Adding Two Lists Element-wise list1 = [ 1 , 2 , 3 ]

Big Data: Top Hadoop Interview Questions (4 of 5)

Image
1) What is MAP Reduce program? - You need to give actual steps in this program - You have to write scripts and codes 2) What is MAPReduce? -Mapreduce is a data processing model -It is combination of 2 parts. One is Mappers and the other one is Reducers 3)What will happen in Mapping phase? It takes the input data, and feeds each data element into the mapper 4)What is the function of Reducer? The reducer process all outputs from mapper and arrives at a final result 5)What kind of input required for Mapreduce? It should be structured in the form of (Key,Value) pairs 6)What is HDFS? HDFS is a file system designed for large-scale data processing under frameworks such as MapReduce. 7) Is HDFS like UNIX? No, but commands in HDFS works similarly to UNIX 8) What is Simple file command? hadoop fs -ls 9) How to copy data into HDFS file system? Copy a file into HDFS from local system 10) What is default working directory in HDFS? /user/$USER $USER ==> Your log