Monday, June 11, 2018

Interview

1. Write synchronous and asynchronous code in only javascript.
A
ns : Synchronous code
console.log('1');
console.log('2');
console.log('3')
Asynchronous code
console.log('1')
setTimeout(function afterTwoSeconds() {
console.log('2')
}, 2000)
console.log('3')

2. What is typescript
Ans : TypeScript is an open-source language which builds on JavaScript.

 
3. What is transpilation
Ans : Transpilers, or source-to-source compilers, are tools that read source code written in one programming language, and produce the equivalent code in another language.

4. In test.js we have written console.log("Hello"); Now i have changed the test.js to test.ts. Is that print "Hello". there is no node js is installed. How can we print "Hello" without using any IDE like VS Code, Visiual Studio.

Ans : TypeScript is its own thing which isn't tied to any framework/library. You can use it with regular JS, other frameworks like React, etc. You can even use it on the server-side with Node.
Then, install TypeScript globally by running this in your terminal:
$ npm install -g typescript
Then, all you have to do is create a TypeScript file like script.ts and write TypeScript inside of it. When you want to compile it, just run this in your command line:
$ tsc script.ts
If you're working on a larger project with multiple TS files, it helps to set a TypeScript configuration file to handle how TypeScript works with your project. You can do so by running:
$ tsc --init
This will automatically create a tsconfig.json file for you which will allow you to start using TypeScript in your project. To compile the entire project, you just need to run:
$ tsc

5. Which version of node js is using.
6. Suppose there are version 9.4.3, 8.2.1, 7.4.6, and you are using 5.2.1..then which version you will upgrade yourself.
Ans : Last stable version (LTS)

7. In version x.y.z  what is the meaning of x, y ,z.
Ans : Major Minor Build
 
8. Write promise code.
Ans : var promise = new Promise(resolve,reject){
resolve(10);
}

9. How to start Node Js application from scratch.
Ans : 1. npm init (this will create package.json) 2. npm install express ( for require module you have required express)

 
10. Supoose you have a folder name "yourproject" in any drive. and you run npm start, what depencies it will download or what it will do.

11. What is package.json
Ans : https://interview-preparation-for-you.blogspot.com/2018/12/what-is-use-of-packagejson.html

12. If i removed package.json, then what will be happen.

13. What information package.json have.
Ans : https://interview-preparation-for-you.blogspot.com/2018/12/what-is-use-of-packagejson.html

14. If i deployed a project in deployment server and i remove the package.json. Then what will be happen.
15. If nothing is happen after removing the packegae.json what will the future impact.
16. Which version of express i am using.
17. What is export keyword. what is does.
18. suppose we have two scenarion like below
A) Export class One
{
//something...
}
B) Export class One(same name)
{
//something
}
Is there is any clash in name, because we are using same name.
If not how the Node JS handle this
19. What is my project architecture
20. Explain ICP2 
21. Which stream i am using
22. What are the different stream avalable in Node JS
23. What are Module used in project
24. Overloading in express like app.use('myName', handler) and app.use(sender)...difference between them.
25. What is PM2.
26. How to run application using PM2.
27. Whice module are using for MongoDb.
28. What is diferent between ('mongodb').MongoClient and Mongoose
29. How to handle if the connection is broken with node js application
30. Which version of mongodb is using
31. How it is difference from SQL server or any other traditinal database
32. what are others NoSql DB, like redish or any other he was asking i forgot name.
33. How you will choose the technology for building the Application like C#, MVC or Node Js
34. Why you have choosen MongoDB.
35. What is AWS and how to use it.
36. How Node JS handle the Multiple request and how c# handle the multiple request.
38. HMO(High availablity in mongoDB). Means replica set. Master Slave working of MongoDb
39. LibUV

No comments:

Followers

Link