Monday, 14 December 2015

Express Js Interview Questions and Answers

Express Js Interview Questions and Answers


Question: What is Express Js?
Express JS is a framework which helps to develop web and mobile applications. Its works on nodejs plateform. Its sub part of node.js.



What type of web application can built using Express JS?
you can build single-page, multi-page, and hybrid web applications.



Question: What are core features of Express framework?
  1. Allows to set up middlewares to respond to HTTP Requests
  2. Defines a routing table which can works as per HTTP Method and URL.
  3. Dynamically render HTML Pages


Question: Why I should use Express JS?
Express 3.x is a light-weight web application framework to help organize your web application into an MVC architecture on the server side.



Question: How to install expressjs?
http://expressjs.com/en/starter/installing.html


Question: How to get variables in Express.js in GET Method?
var express = require('express');
var app = express();

app.get('/', function(req, res){
    /* req have all the values **/  
  res.send('id: ' + req.query.id);  
});
app.listen(3000);



Question: How to get POST a query in Express.js?
var bodyParser = require('body-parser')
app.use( bodyParser.json() );       // to support JSON-encoded 
app.use(bodyParser.urlencoded({     // to support URL-encoded 
  extended: true
})); 



Question: How to output pretty html in Express.js?
app.set('view options', { pretty: true }); Question: How to get the full url in Express?
var port = req.app.settings.port || cfg.port;
res.locals.requested_url = req.protocol + '://' + req.host  + ( port == 80 || port == 443 ? '' : ':'+port ) + req.path;



Question: How to remove debugging from an Express app?
var io = require('socket.io').listen(app, { log: false });
io.set('log level', 1); 



Question: How to to 404 errors?
app.get('*', function(req, res){
  res.send('what???', 404);
});



Question: How to download a file?
app.get('/download', function(req, res){
  var file = __dirname + '/download-folder/file.txt';
  res.download(file); 
});



Question: What is the parameter “next” used for in Express?
app.get('/userdetails/:id?', function(req, res, next){
 });

req and res which represent the request and response objects
nextIt passes control to the next matching route.



Friday, 11 December 2015

Hadoop Basic Interview Questions and Answer

Hadoop Basic Interview Questions and Answer



Question: Name fews companies that use Hadoop?
  1. Facebook
  2. Amazon
  3. Twitter
  4. eBay
  5. Adobe
  6. Netflix
  7. Hulu
  8. Rubikloud



Question: Differentiate between Structured and Unstructured data?
Data which are proper categorized and easily search and update is know as Structured data.
Data which are proper un-categorized and can't search and update easily is know as Un-Structured data.


Question: On Which concept the Hadoop framework works?
HDFS: Hadoop Distributed File System is the java based file system for scalable and reliable storage of large datasets. Data in HDFS is stored in the form of blocks and it operates on the Master Slave Architecture.
Hadoop MapReduce:MapReduce distributes the workload into various tasks which runs in parallel. Hadoop jobs perform 2 separate job. The map job breaks down the data sets into key-value pairs or tuples. The reduce job then takes the output of the map job & combines the data tuples in smaller set of tuples. The job is performed after the map job is executed.


Question: What is Hadoop streaming?
Hadoop distribution has a generic programming interface for writing the code in any programming language like PHP, Python, Perl, Ruby etc is know as Hadoop Streaming.


Question: What is block and block scanner in HDFS?
Block: The minimum amount of data that can be read or written is know as "block" (Defualt 64MB).
Block Scanner tracks the list of blocks present on a DataNode and verifies them to find any type of checksum errors.


Question: What is commodity hardware?
Hadoop have thousands of commodity hardware which are inexpensive that do not have high availability. these are used to execute to job.


Can we write MapReduce in other than JAVA Language?
Yes, you can write MapReduce task in other languages like PHP, Perl etc.


Question: What are the primary phases of a Reducer?
  1. Shuffle
  2. Sort
  3. Reduce


Question: What is Big Data?
Big data is too heavy database that exceeds the processing capacity of traditional database systems.


Question: What is NoSQL?
It is non-relational un-structured database.


Question: What problems can Hadoop solve?
It sove following problems.
  1. When database too heavy and exceed its limit.
  2. Reduce the cost of server.



Question:Name the modes in which Hadoop can run?
Hadoop can be run in one of three modes:
  1. Standalone (or local) mode
  2. Pseudo-distributed mode
  3. Fully distributed mode



Question:What is the full form of HDFS?
Hadoop Distributed File System

Question:What is DataNode and Namenode in Hadoop?
Namenode is the node which stores the filesystem metadata.
File maps with block locations are stored in datanode.


Question:What are the Hadoop configuration files?
  1. hdfs-site.xml
  2. core-site.xml
  3. mapred-site.xml