Total Pageviews

Wednesday 12 November 2014

Hadoop Interview Questions part 1


1. What is Hadoop framework?
Ans: Hadoop is an open source framework which is written in java by apache software foundation. 
This framework is used to write software application which requires to process vast amount of data (It 
could handle multi tera bytes of data). It works in-parallel on large clusters which could have 1000 of 
computers (Nodes) on the clusters. It also process data very reliably and fault-tolerant manner. See 
the below image how does it looks.
2. On What concept the Hadoop framework works?
Ans: It works on MapReduce, and it is devised by the Google.
3. What is MapReduce?
Ans: Map reduces is an algorithm or concept to process Huge amount of data in a faster way. As per 
its name you can divide it Map and Reduce.
• The main MapReduce job usually splits the input data-set into independent chunks. (Big data sets in 
the multiple small datasets)
• Reduce Task: And the above output will be the input for the reduce tasks, produces the final result.
Your business logic would be written in the Mapped Task and Reduced Task. Typically both the input 
and the output of the job are stored in a file-system (Not database). The framework takes care of 
scheduling tasks, monitoring them and re-executes the failed tasks.
4. What is compute and Storage nodes?
Ans: Compute Node: This is the computer or machine where your actual business logic will be 
executed.
Storage Node: This is the computer or machine where your file system resides to store the processing 
data. In most of the cases compute node and storage node would be the same machine.
5. How does master slave architecture in the Hadoop?
Ans: the MapReduce framework consists of a single master Job Tracker and multiple slaves, each 
cluster-node will have one Task Tracker.The master is responsible for scheduling the jobs' component tasks on the slaves, monitoring 
them and re-executing the failed tasks. The slaves execute the tasks as directed by the master.
6. How does a Hadoop application look like or their basic components?
Ans: Minimally a Hadoop application would have following components.
• Input location of data
• Output location of processed data.
• A map task.
• A reduced task.
• Job configuration
The Hadoop job client then submits the job (jar/executable etc.) and configuration to the Job Tracker
which then assumes the responsibility of distributing the software/configuration to the slaves, 
scheduling tasks and monitoring them, providing status and diagnostic information to the job-client.
7. Explain how input and output data format of the Hadoop framework?
Ans: The MapReduce framework operates exclusively on pairs, that is, the framework views the 
input to the job as a set of pairs and produces a set of pairs as the output of the job, conceivably of 
different types. See the flow mentioned below (input) -> map -> -> combine/sorting -> -> reduce -> 
(output)
8. What are the restriction to the key and value class?
Ans: The key and value classes have to be serialized by the framework. To make them serializable 
Hadoop provides a Writable interface. As you know from the java itself that the key of the Map 
should be comparable, hence the key has to implement one more interface Writable Comparable.
9. Explain the Word Count implementation via Hadoop framework?
Ans: We will count the words in all the input file flow as below
• Input
Assume there are two files each having a sentence Hello World Hello World (In file 1) Hello World 
Hello World (In file 2)
• Mapper: There would be each mapper for the a file
For the given sample input the first map output:
< Hello, 1>< World, 1>
< Hello, 1>
< World, 1>
The second map output:
< Hello, 1>
< World, 1>
< Hello, 1>
< World, 1>
• Combiner/Sorting (This is done for each individual map)
So output looks like this
The output of the first map:
< Hello, 2>
< World, 2>
The output of the second map:
< Hello, 2>
< World, 2>
• Reducer:
• Output
It sums up the above output and generates the output as below
< Hello, 4>
< World, 4>
Final output would look like
Hello 4 times
World 4 times10. Which interface needs to be implemented to create Mapper and Reducer for the Hadoop?
Ans: org.apache.hadoop.mapreduce.Mapper org.apache.hadoop.mapreduce.Reducer
11. What Mapper does?
Ans: Maps are the individual tasks that transform input records into intermediate records. The 
transformed intermediate records do not need to be of the same type as the input records. A given 
input pair may map to zero or many output pairs.
12. What is the Input Split in map reduce software?
Ans: An Input Split is a logical representation of a unit (A chunk) of input work for a map task; e.g., a 
filename and a byte range within that file to process or a row set in a text file.
13. What is the Input Format?
Ans: The Input Format is responsible for enumerate (itemize) the Input Split, and producing a Record 
Reader which will turn those logical work units into actual physical input records.
14. Where do you specify the Mapper Implementation?
Ans: Generally mapper implementation is specified in the Job itself.
15. How Mapper is instantiated in a running job?
Ans: The Mapper itself is instantiated in the running job, and will be passed a
Map Context object which it can use to configure itself
16. Which are the methods in the Mapper interface?
Ans: the Mapper contains the run () method, which call its own setup () method only once, it also call 
a map () method for each input and finally calls it cleanup () method. All above methods you can 
override in your code.
17. What happens if you don’t override the Mapper methods and keep them as it is?
Ans: If you do not override any methods (leaving even map as-is), it will act as the identity function, 
emitting each input record as a separate output.
18. What is the use of Context object?
Ans: The Context object allows the mapper to interact with the rest of the Hadoop system. It
Includes configuration data for the job, as well as interfaces which allow it to emit output.19. How can you add the arbitrary key-value pairs in your mapper?
Ans: You can set arbitrary (key, value) pairs of configuration data in your Job, e.g. with 
Job.getConfiguration ().set ("myKey", "myVal"), and then retrieve this data in your mapper with
context.getConfiguration ().get ("myKey"). This kind of functionality is typically done in the Mapper's 
setup () method.
20. How does Mapper’s run () method works?
Ans: The Mapper. Run () method then calls map (KeyInType, ValInType, Context) for each key/value 
pair in the Input Split for that task
21. Which object can be used to get the progress of a particular job?
Ans: Context
22. What is next step after Mapper or MapTask?
Ans: The output of the Mapper is sorted and Partitions will be created for the output. Number of 
partition depends on the number of reducer.
23. How can we control particular key should go in a specific reducer?
Ans: Users can control which keys (and hence records) go to which Reducer by implementing a custom 
Partitioner.
24. What is the use of Combiner?
Ans: It is an optional component or class, and can be specify via Job.setCombinerClass (Class Name), 
to perform local aggregation of the intermediate outputs, which helps to cut down the amount of 
data transferred from the Mapper to the Reducer.
25. How many maps are there in a particular Job?
Ans: the number of maps is usually driven by the total size of the inputs, that is, the total number of 
blocks of the input files.
Generally it is around 10-100 maps per-node. Task setup takes awhile, so it is best if the maps take at 
least a minute to execute.
Suppose, if you expect 10TB of input data and have a block size of 128MB, you'll end up with 82,000
maps, to control the number of block you can use the mapreduce.job.maps parameter (which only 
provides a hint to the framework). Ultimately, the number of tasks is controlled by the number of 
splits returned by the InputFormat.getSplits () method (which you can override).
26. What is the Reducer used for?Ans: Reducer reduces a set of intermediate values which share a key to a (usually smaller) set of 
values. The number of reduces for the job is set by theuser via Job.setNumReduceTasks (int).
27. Explain the core methods of the Reducer?
Ans: The API of Reducer is very similar to that of Mapper, there's a run() method that receives a 
Context containing the job's configuration as well as interfacing methods that return data from the 
reducer itself back to the framework. The run() method calls setup() once, reduce() once for each 
key associated with the reduce task, and cleanup() once at the end. Each of these methods can 
access the job's configuration data by using Context.getConfiguration ().
As in Mapper, any or all of these methods can be overridden with custom implementations. If none of 
these methods are overridden, the default reducer operation is the identity function; values are 
passed through without further processing.
The heart of Reducer is it’s reduce () method. This is called once per key; the second argument is an 
Iterable which returns all the values associated with that key.
28. What are the primary phases of the Reducer?
Ans: Shuffle, Sort and Reduce
29. Explain the shuffle?
Ans: Input to the Reducer is the sorted output of the mappers. In this phase the framework fetches 
the relevant partition of the output of all the mappers, via HTTP.
30. Explain the Reducer’s Sort phase?
Ans: The framework groups Reducer inputs by keys (since different mappers may have output the 
same key) in this stage. The shuffle and sort phases occur simultaneously; while map-outputs are 
being fetched they are merged (It is similar to merge-sort).

52 comments:

  1. Appreciative hadoop training in chennai for offering such oracle training in chennai profitable data on hadoop training in chennai the online journal and prescribe the collusion..

    ReplyDelete

  2. I found some useful information in your blog,it was awesome to read, thanks for sharing this great content to my vision, keep sharing..
    Greens Technologies In Chennai

    ReplyDelete
  3. There are lots of information about latest technology and how to get trained in them, like Hadoop Training in Chennai have spread around the web, but this is a unique one according to me. The strategy you have updated here will make me to get trained in future technologies Hadoop Training in ChennaiBy the way you are running a great blog. Thanks for sharing this..

    ReplyDelete
  4. QTP Training in Chennai
    Thank you for the informative post. It was thoroughly helpful to me. Keep posting more such articles and enlighten us.

    ReplyDelete
  5. Very nice article for online training,thanks for sharing.

    Oracle DBA Online Training institute

    ReplyDelete
  6. Thanks for sharing this useful informative post to our knowledge, Actually OBIEE training will mostly concentrate on real time issues rather than simply teaching you the OBIEE course. This will help you when you join the job and while attending interviews. Obiee Training in chennai

    ReplyDelete
  7. if i share this blog weblogic Server Training in Chennai aims to teach professionals and beginners to have perfect solution of their learning needs in server technologies. Weblogic server training In Chennai

    ReplyDelete
  8. fantastic presentation .We are charging very competitive in the market which helps to bring more Microstrategy professionals into this market. may update this blog . Microstrategy training In Chennai

    ReplyDelete
  9. Hybernet is a framework Tool. If you are interested in hybernet training, our real time working.
    Hibernate Training in Chennai.
    hibernate-training-institute-center-in-chennai

    ReplyDelete
  10. Latest Govt Bank Railway Jobs 2016


    This website has very good content thanks for the article. .........

    ReplyDelete

  11. I am extremely impressed with your writing skills and also with the layout on your blog
    sas online training

    ReplyDelete

  12. Hai if our training additional way as (IT) trained as individual,you will be able to understand other applications more quickly and continue to build your skll set
    which will assist you in getting hi-tech industry jobs as possible in future courese of action..
    visit this blog webMethods-training in chennai



    ReplyDelete
  13. Latest Govt Bank Jobs Notification 2016

    Your site so great, thanks for all news post information.....................

    ReplyDelete
  14. great article!!!!!This is very importent information for us.I like all content and information.I have read it.You know more about this please visit again.
    QTP Training in Chennai

    ReplyDelete
  15. very nice blogs!!! i have to learning for lot of information for this sites...Sharing for wonderful information.Thanks for sharing this valuable information to our vision. You have posted a trust worthy blog keep sharing.
    Informatica Training in Chennai

    ReplyDelete
  16. I am reading your post from the beginning, it was so interesting to read & I feel thanks to you for posting such a good blog, keep updates regularly.
    informatica training in chennai

    ReplyDelete
  17. Latest Govt Bank Jobs Recruitment Notification 2016

    I cannot thank you enough for the blog article.Thanks Again. Really Cool..............

    ReplyDelete
  18. Performance tuning is a broad and somewhat complex topic area when it comes to Oracle databases. Two of the biggest questions faced by your average DBA concern where to start and what to do. All you may know is that someone (a user) reports a problem about a slow or poor performing application or query. Where do you even begin to start when faced with this situation?
    Oracle's emphasis on this particular methodology changed when Oracle9i was released. The approach has gone from top-down in 8i to that of following principles in 9i/10g. Neither methodology is absolute as each has its advantages and disadvantages.

    The Oracle Server is a sophisticated and highly tunable software product. Its flexibility allows you to make small adjustments that affect database performance. By tuning your system, you can tailor its performance to best meet your needs.
    Performance must be built in! Performance tuning cannot be performed optimally after a system is put into production. To achieve performance targets of response time, throughput, and constraints you must tune application analysis, design, and implementation.

    Oracle Performance Tuning Training in chennai

    ReplyDelete
  19. GSSSB Assistant Technician Pharmacist Recruitment 2015

    The information provided was extremely useful and informative. Thanks a lot for useful stuff......

    ReplyDelete
  20. Thanks for sharing as it is an excellent post would love to read your future post.



    QTP Training in chennai

    ReplyDelete
  21. Really awesome blog. Your blog is really useful for me. Thanks for sharing this informative blog. Keep update your blog.
    Hadoop Training In Chennai

    ReplyDelete
  22. very nice collection of questions thank you for sharing this article with us. Know more about Hadoop Online Training

    ReplyDelete

  23. Excellent post on iOS mobile apps development!!! The future of mobile application development is on positive note. You can make most it by having in-depth knowledge on mobile application development platform and other stunning features
    enterprise mobile app development company

    ReplyDelete
  24. I wondered upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I’ll be subscribing to your feed and I hope you post again soon.
    Best Java Training Institute in Chennai
    Java Training
    Java Classes in Chennai
    Core Java Training in Chennai
    Java Training center in Chennai
    Java Certification course in Chennai

    ReplyDelete
  25. Innovative thinking of you in this blog makes me very useful to learn.
    i need more info to learn so kindly update it.
    android coaching in bangalore
    Android Training in Nolambur
    Android Training in Nungambakkam
    Android Training in Karapakkam

    ReplyDelete
  26. QuickBooks has made payroll management quite definitely easier for accounting professionals. There are plenty people that are giving QuickBooks Payroll Support Phone Number once they process payroll either QB desktop and online options.

    ReplyDelete
  27. QuickBooks Premier really is easy to make use of but errors may usually pop up during the time of installation, during the time of taking backup, while upgrading your software to your latest version etc. The support team at QuickBooks Support Number is trained by well experienced experts that are making our customer care executives quite robust and resilient. It surely works twenty-four hours every single day with only one element of mind as an example. to repair the issues faced by our customers in less time without compromising along with the quality of services.

    ReplyDelete
  28. How to contact QuickBooks Payroll support?
    Different styles of queries or QuickBooks related issue, then you're way in the right direction. You simply give single ring at our toll-free intuitQuickBooks Payroll Contact Phone Number
    . we are going to help you right solution according to your issue. We work on the internet and can get rid of the technical problems via remote access not only is it soon seeing that problem occurs we shall fix the same.

    ReplyDelete
  29. QuickBooks encounter an amount of undesirable and annoying errors which keep persisting with time if you do not resolved instantly. Certainly one of such QuickBooks issue is Printer issue which mainly arises as a result of a number of hardware and software problems in QuickBooks, printer or drivers. You're able to resolve this error by using the below troubleshooting steps you can also simply contact our QuickBooks Payroll Support Phone Number available at.You should run QuickBooks print and pdf repair tool to determine and fix the errors in printer settings prior to starting the troubleshooting.

    ReplyDelete
  30. With exceptional features, QuickBook helps all of the forms of businesses with generating accounting reports, entries for almost any sale, transactions pertaining to banking, etc., with a lot of ease. And along side support for QuickBooks 247 Support Phone Number, it is less difficult to handle most of the tools of QuickBooks in a hassle-free manner.

    ReplyDelete
  31. QuickBooks Enterprise tech support team enables you to manage your organization operations by getting you the latest versions of QuickBooks Enterprise like QuickBooks Enterprise 2019. Just dial QuickBooks Enterprise Support to understand the professionals and cons of accounting software with the help of our QuickBooks tech support members.

    ReplyDelete
  32. Our support also extends to those errors when QB Premier is infected by a virus or a spyware. We also handle almost any technical & functional issue faced during installation of drivers for QuickBooks Support Phone Number We also troubleshoot any type of error which can be encountered in this version or this version in a multi-user mode.

    ReplyDelete
  33. Because The Software Runs On Desktop And Laptop Devices, It Truly Is Prone To Get Errors And Technical Glitches. Except for Such Cases, QuickBooks Enterprise Technical Support Is Present Which Enables A Person To Have His Errors Fixed.

    ReplyDelete

  34. So when everyone knows that QuickBooks Tech Support Phone Number has its own wonderful benefits, with this, QuickBooks scan manager is one of the great features of QuickBooks software to just always maintain your any forms of documents.

    ReplyDelete
  35. QuickBooks has almost changed it is of accounting. Nowadays accounting has exploded to become everyone’s cup of tea and that’s only become possible because because of the birth of QuickBooks Support Phone Number accounting software. We have the best and the most convenient answer to enhance your productivity by solving every issue you face with the software.

    ReplyDelete
  36. We now have a way of deleting the power that you've put immediately from our storage. Thus, there's no chance of data getting violated. You need to get to us with regards to a number of software issues. The QuickBooks Tech Support Phone Number satisfaction could be top quality with us.

    ReplyDelete
  37. QuickBooks Customer Service version is frequently additionally split into QuickBooks professional, QuickBooks Premier and QuickBooks Enterprise. you’ll get the version and this can be additional apt for your needs. you must additionally get guidance and support services for the code that square measure obtainable 24/7.

    ReplyDelete
  38. Dial QuickBooks Helpline to deal this kind of situation which requires top end Data services and data recovery tools with expertise to diagnose the issues. Dial QuickBooks Support Tech Support and obtain your Company file data related issues resolved from highly experienced certified Pro-Advisors.

    ReplyDelete
  39. QuickBooks users in many cases are present in situations where they should face lots of the performance and several other errors as a result of various causes of their computer system. If you would like any help for QuickBooks errors from customer service to obtain the way to these errors and problems, it really is an easy task to have of QuickBooks Tech Support Number and discover instant help with the guidance of your technical experts.

    ReplyDelete
  40. QuickBooks Tech Support Phone Number We have a team of professionals that have extensive QB expertise and knowledge on how to tailor this software to any industry. Having performed many QB data conversions as well as other QB engagements, we have the experience as you are able to rely on.

    ReplyDelete
  41. QuickBooks Payroll Technical Support Number may be the supreme software of accounting for managing the financial health associated with business. The trend regarding the marketplace has modified using its introduction.

    ReplyDelete
  42. Thanks for sharing useful information. I learned something new from your bog. Its very interesting and informative. keep updating. If you are looking for any Hadoop related information, please visit our website hadoop training in bangalore

    ReplyDelete
  43. QB mistake 9999 can happen while you are introducing a program or Intuit Inc. related programming program (for example QuickBooks) is running. If you would like to learn How To Troubleshoot Quickbooks Error 9999, you can continue reading this blog.

    ReplyDelete
  44. Thanks for sharing this article about seo. i read your blog every time.. oracle training in chennai

    ReplyDelete
  45. Want to do Data Science Training in Chennai with Certification Exam? Catch the best features of Data Science training courses with Infycle Technologies, the best Data Science Training & Placement institutes in and around Chennai. Infycle offers the best hands-on training to the students with the revised curriculum to enhance their knowledge. In addition to the Certification & Training, Infycle offers placement classes for personality tests, interview preparation, and mock interviews for clearing the interviews with the best records. To have all it in your hands, dial 7504633633 for a free demo from the experts.
    No.1 Data Science Training in Chennai | Infycle Technologies

    ReplyDelete