Software Engineering Interview Questions

  1. What are web services?
    A web service is any piece of software that makes itself available over the Internet and uses a standard XML messaging service.  A client invokes a web service by sending an XML message, then waits for an XML response.  As all communication in XML, web services are not tied to any one operating system or programming language.  Java can talk to Perl; Windows applcations can talk with Linux applications.

    Web services are built on top of open standards such as TCP/IP, HTTP, Java, HTML and XML.
  2. What does REST stand for?
    REpresentational State Transfer
  3. What are the 6 constraints of REST?
    • 1. Uniform Interface
    • 2. Stateless
    • 3. Cacheable
    • 4. Client-Server
    • 5. Layered System
    • 6. Code on Demand (optional)
  4. What is Atwoods Law?
    Any application that can be written in Javascript will eventually be written in Javascript. -- Jeff Atwood
  5. What are some Javascript frameworks?
    • Backbone.js
    • Angular.js
    • Ember
    • React
  6. What is AJAX?
    AJAX = Asynchronous JavaScript and XML.

    AJAX is about updating parts of a web page, without reloading the whole page.

    AJAX is a misleading name. You don't have to understand XML to use AJAX.

    AJAX is based on internet standards, and uses a combination of:     XMLHttpRequest object (to retrieve data from a web server)     JavaScript/DOM (to display/use the data)
  7. How do you send results back in JSON format in MVC?
    This is a broad question where there could me many correct answers.  The answer I like to provide is the following which shows that you understand the basic syntax for returning JSON objects;

    return Json(output, JsonRequestBehavior.AllowGet);
  8. When you send data in JSON format, using Get Request, it's necessary to specify which property to avoid an error?

    By default, this parameter is set to 'DenyGet'.
  9. What is the dafault recursion limit for JSON requests?
    100 but you can change the default by changing the parameter 'RecursionLimit'.
  10. How can you generate an XML object from a dataset?
    When a DataSet is written as XML data, the rows in the DataSet are written in their current versions. However, the DataSet can also be written as a DiffGram so that both the current and the original values of the rows will be included.

    The XML representation of the DataSet can be written to a file, a stream, an XmlWriter, or a string. These choices provide great flexibility for how you transport the XML representation of the DataSet. To obtain the XML representation of the DataSet as a string, use the GetXml method as shown in the following example;

    • In C#:
    • string xmlDS = custDS.GetXml();

    • In VB;
    • custDS.WriteXml("Customers.xml", XmlWriteMode.WriteSchema)
  11. How can you identify whether changes have been made to a dataset since it was loaded?
    • 1. GetChanges: gives the dataset that has changed since newly loaded or since Accept changes has been executed. 
    • 2. HasChanges: this returns a status that tells if any changes have been made to the dataset since accept changes was executed.
  12. What are the 6 different methods to do exception handling in MVC?
    • 1. Use traditional .NET exception handling style with Try/Catch block
    • 2. Override 'OnException' method
    • 3. Use 'HandleError' attribute
    • 4. Inheriting from 'HandleError' attribute
    • 5. Handling HTTP errors
    • 6. Global error handling in MVC
  13. Describe the Global Error handling in MVC;
    If you wish to do global error handling across your application you can override the “Application_Error” event and do a response.redirect from the global error event. So if the error handling is not done at the controller level it will get propagated to “Global.asax” file;

    • public class MvcApplication : System.Web.HttpApplication
    • {
    •      protected void Application_Error(object sender, EventArgs e)
    •      {
    •         Exception exception = Server.GetLastError();
    •         Server.ClearError();
    •         Response.Redirect("/Home/Error");
    •      }
    • }
  14. Describe the method in MVC for handling exceptions that is known as 'Handling HTTP Errors";
    All MVC exception handling techniques discussed till now do not handle HTTP errors like file not found, HTTP 500 error’s etc. For that we need to make an entry of the error action and the error status code as shown in the below config file;

    • <system.web>
    • <customErrors
    •         mode="On" defaultRedirect="Error1">
    • <error statusCode="404" redirect="~/Testing/NoPageFound"/>
    • </customErrors>
    • </system.web>
  15. Describe the MVC exception handling method known as "Inheriting from 'HandleError' attribute;
    One of the biggest drawbacks of all the previous method was reusability. Error handling logic cannot be reused across other controllers.In order to reuse error handling logic across controller we can inherit from “HandleErrorAttribute”class anddecorate this class as attribute across controller;

    • public class Err : HandleErrorAttribute
    • {
    • public override void OnException(ExceptionContext filterContext)
    • {
    •      Exception ex = filterContext.Exception;
    •      filterContext.ExceptionHandled = true;
    • var model = new HandleErrorInfo(filterContext.Exception, "Controller", "Action");

    •      filterContext.Result = new ViewResult()
    •      {
    •         ViewName = "Error1",
    •         ViewData = new ViewDataDictionary(model)
    •      };
    •   }
    • }
  16. Describe a Web Service in ASP.Net;
    A Web Service is programmable application logic accessible via standard Web protocols. One of these Web protocols is the Simple Object Access Protocol (SOAP). SOAP is a W3C submitted note (as of May 2000) that uses standards based technologies (XML for data description and HTTP for transport) to encode and transmit application data.

    Consumers of a Web Service do not need to know anything about the platform, object model, or programming language used to implement the service; they only need to understand how to send and receive SOAP messages (HTTP and XML).
  17. Describe the WCF framework of ASP.Net;
    Windows Communication Foundation (WCF) is a framework for building service-oriented applications. Using WCF, you can send data as asynchronous messages from one service endpoint to another. A service endpoint can be part of a continuously available service hosted by IIS, or it can be a service hosted in an application. An endpoint can be a client of a service that requests data from a service endpoint. The messages can be as simple as a single character or word sent as XML, or as complex as a stream of binary data.
  18. In what scenarios must WCF be used?
    In what scenarios must WCF be used;

    • A secure service to process business transactions.
    • A service that supplies current data to others, such as a traffic report or other monitoring service.
    • A chat service that allows two people to communicate or exchange data in real time.
    • A dashboard application that polls one or more services for data and presents it in a logical presentation.
    • Exposing a workflow implemented using Windows Workflow Foundation as a WCF service.
    • A Silverlight application to poll a service for the latest data feeds.
  19. What are the features of WCF?
    • Service Orientation
    • Interoperability
    • Multiple Message Patterns
    • Service Metadata
    • Data Contracts
    • Security
    • Multiple Transports and Encodings
    • Reliable and Queued Messages
    • Durable Messages
    • Transactions
    • AJAX and REST Support
    • Extensibility
  20. What is the difference between Web Service in ASP.NET & WCF Service?
    WCF is a replacement for all earlier web service technologies from Microsoft. It also does a lot more than what is traditionally considered as "web services".

    WCF "web services" are part of a much broader spectrum of remote communication enabled through WCF. You will get a much higher degree of flexibility and portability doing things in WCF than through traditional ASMX because WCF is designed, from the ground up, to summarize all of the different distributed programming infrastructures offered by Microsoft. An endpoint in WCF can be communicated with just as easily over SOAP/XML as it can over TCP/binary and to change this medium is simply a configuration file mod. In theory, this reduces the amount of new code needed when porting or changing business needs, targets, etc.

    ASMX is older than WCF, and anything ASMX can do so can WCF (and more). Basically you can see WCF as trying to logically group together all the different ways of getting two apps to communicate in the world of Microsoft; ASMX was just one of these many ways and so is now grouped under the WCF umbrella of capabilities.

    Web Services can be accessed only over HTTP & it works in stateless environment, where WCF is flexible because its services can be hosted in different types of applications. Common scenarios for hosting WCF services are IIS,WAS, Self-hosting, Managed Windows Service.

    The major difference is that Web Services Use XmlSerializer. But WCF UsesDataContractSerializer which is better in Performance as compared to XmlSerializer.
  21. What is WCF?
    Windows Communication Foundation (WCF) is a framework for building service-oriented applications. Using WCF, you can send data as asynchronous messages from one service endpoint to another. A service endpoint can be part of a continuously available service hosted by IIS, or it can be a service hosted in an application. An endpoint can be a client of a service that requests data from a service endpoint. The messages can be as simple as a single character or word sent as XML, or as complex as a stream of binary data. A few sample scenarios include:

    • A secure service to process business transactions.
    • A service that supplies current data to others, such as a traffic report or other monitoring service.
    • A chat service that allows two people to communicate or exchange data in real time.
    • A dashboard application that polls one or more services for data and presents it in a logical presentation.
    • Exposing a workflow implemented using Windows Workflow Foundation as a WCF service.
    • A Silverlight application to poll a service for the latest data feeds.

    While creating such applications was possible prior to the existence of WCF, WCF makes the development of endpoints easier than ever. In summary, WCF is designed to offer a manageable approach to creating Web services and Web service clients.
  22. What are the features of WCF?
    • Service Orientation
    • Interoperability
    • Multiple Message Patterns
    • Service Metadata
    • Data Contracts
    • Security
    • Multiple Transports and Encodings
    • Reliable and Queued Messages
    • Durable Messages
    • Transactions
    • AJAX and REST Support
    • Extensibility
  23. Describe the Service Orientation feature of WCF;
    One consequence of using WS standards is that WCF enables you to create service oriented applications. Service-oriented architecture (SOA) is the reliance on Web services to send and receive data. The services have the general advantage of being loosely-coupled instead of hard-coded from one application to another. A loosely-coupled relationship implies that any client created on any platform can connect to any service as long as the essential contracts are met.
  24. Describe the Interoperability feature of WCF;
    WCF implements modern industry standards for Web service interoperability.
  25. Describe the Multiple Message Patterns feature of WCF;
    Messages are exchanged in one of several patterns. The most common pattern is the request/reply pattern, where one endpoint requests data from a second endpoint. The second endpoint replies. There are other patterns such as a one-way message in which a single endpoint sends a message without any expectation of a reply. A more complex pattern is the duplex exchange pattern where two endpoints establish a connection and send data back and forth, similar to an instant messaging program.
  26. Describe the Service Metadata feature of WCF;
    WCF supports publishing service metadata using formats specified in industry standards such as WSDL, XML Schema and WS-Policy. This metadata can be used to automatically generate and configure clients for accessing WCF services. Metadata can be published over HTTP and HTTPS or using the Web Service Metadata Exchange standard.
  27. What is WSDL?
    The Web Services Description Language (WSDL) is an XML-based language used to describe the services a business offers and to provide a way for individuals and other businesses to access those services electronically. WSDL is the cornerstone of the Universal Description, Discovery, and Integration (UDDI) initiative spearheaded by Microsoft, IBM, and Ariba. UDDI is an XML-based registry for businesses worldwide, which enables businesses to list themselves and their services on the Internet. WSDL is the language used to do this.
  28. Describe the Data Contracts feature of WCF;
    Because WCF is built using the .NET Framework, it also includes code-friendly methods of supplying the contracts you want to enforce. One of the universal types of contracts is the data contract. In essence, as you code your service using Visual C# or Visual Basic, the easiest way to handle data is by creating classes that represent a data entity with properties that belong to the data entity. WCF includes a comprehensive system for working with data in this easy manner. Once you have created the classes that represent data, your service automatically generates the metadata that allows clients to comply with the data types you have designed.
  29. In regards to MEAN stack drivers, what is mean by ODM?
    ODM = Object Document Mapper

    MongoDB is an example of a document database - you would use an ODM to translate between your objects in code and the document representation of the data (if needed).

    Mongoose and Mandango are examples of ODM for MongoDB.
  30. What is meant by ORM?
    ORM = Object Relational Mapper

    MySQL is an example of a relational database - you would use an ORM to translate between your objects in code and the relational representation of the data.

    Examples of ORMs are Hibernate, Entity Framework, Dapper and more.
  31. In regards to MEAN stack development we often use an ODM such as Mongoose for connecting to MongoDB.  Why would we use an ODM like Mongoose instead of a native Node.js driver?
    The basic Node.js driver can be the best solution for simple applications however if you need validations, associations and other high-level data-modeling functions that an Object Document Mapper such as Mongoose may be a better solution.
  32. What is the officially supported ODM for Node.js?
    Mongoose is the officially supported ODM for Node.js.  It has a thriving open source community and includes advanced schema-based features such as async validation, casting , object life-cycle management, pseudo-joins, and rich query builder support.
  33. What is Jade?
    A template engine enables you to use static template files in your application. At runtime, the template engine replaces variables in a template file with actual values, and transforms the template into an HTML file sent to the client. This approach makes it easier to design an HTML page.Some popular template engines that work with Express are Jade, Mustache, and EJS. The Express application generator uses Jade as its default, but it also supports several others.
  34. What is NPM syntax for installing Jade through a command-line utility?
    $ npm install jade --save
  35. What is Swig?
    Like Jade, Swig is a view/templating engine.  Swig is a templating language, which compiles down to HTML, making it easy to separate logic from markup.
  36. What is the purpose of tools like Nodemon and Forever?
    Nodemon and Forever are server restart tools.   They monitor the app server for changes to the server.js file.  Whenever a change is made to the server.js file, Nodemon and Forever shutdown and then restart the app server taking advantage of the changes to the server.js file.  It saves developers time by automatically restarting the app server as changes are made.
  37. What does the NPM --save command extension do?
    --save appended to the NPM command line will save an installed application in your package.json file to be reloaded whenever the application is started.

    example:  npm install swig --save

    The --save extension will add swig to the dependencies section of the package.json file for automatic loading the next time that the application is started.
  38. What is the default view engine for Express builds and in which file is this assignment located?
    HJS -- Found in the app.js file under the 'view engine setup' section.

    Hogan.js NPM package for express 3.x

    Hogan.js is a compiler for the Mustache templating language.
  39. What are some of the first Grunt or Gulp plugins that you install?
    Grunt and Grunt plugins like jshint (gulp-jshint)

    Gulp and Gulp utilities (gulp-util)

    Karma -Foundation that launches everything else from a workflow perspective

    Sass compile (gulp-ruby-sass)

    • Autoprefixer (gulp-autoprefixer)
    • Minify CSS (gulp-cssnano)

    Concatenation (gulp-concat)

    Uglify (gulp-uglify) - Minifies Javascript

    Compress images (gulp-imagemin)

    LiveReload (gulp-livereload)

    Caching of images so only changed images are compressed (gulp-cache)

    Notify of changes(gulp-notify)

    Clean files for a clean build (del)

    rename (gulp-rename)
  40. What is the difference between Grunt and Gulp?
    Gulp is an alternative to grunt. It is a bit more recent and has a reputation as being more flexible than grunt.

    Gulp’s code-over-configuration makes it not only easy to write tasks for, but also much easier to read and maintain. Gulp configurations tend to be much shorter and simpler when compared with Grunt. Gulp also tends to run faster.

    Grunt requires each plugin to be configured separately, specifying source and destination paths for each plugin.

    One of the main differences with Gulp is that it uses streams. A stream is a set of functions through which a file will go and be modified in memory. The file will be written on the disk only at the end of the process so it is more efficient. Grunt tasks, on the other hand, work as silos and cannot be chained.
  41. Why do we uglify files and what is the purpose?
    UglifyJS is a JavaScript parser/compressor/beautifier toolkit. It can be used to combine and minify JavaScript assets so that they require less HTTP requests and make your site load faster. UglifyCSSis a CSS compressor/beautifier that is very similar to UglifyJS.
  42. What is the purpose of jshint?
    JSHint (forked from JSLint) is a popular "lint checker" that's run on JavaScript code. It doesn't execute or modify the code, but analyzes it and reports a variety of different potential errors or bad practices that it finds.If you have 'use strict'; at the top of your JavaScript file, outside of any JavaScript functions, it will enable strict mode for the entire file. By default, JSHint will report a warning if it sees this.
  43. What is Node.js?
    Node.js is a headless JavaScript runtime. It is literally the same JavaScript engine (named V8) that runs inside of Google Chrome, except that with Node.js, you can run JavaScript from the command line instead of in your browser.
  44. AngularJS thinks of HTML as if it had been designed to do what?
    Angular thinks of HTML as if it had been designed to build applications instead of documents.
  45. What kinds of tests does Angular support?
    Angular supports unit tests as well as end to end tests.
  46. Name one of the ways that Angular is forward thinking?
    Angular is forward thinking because of it's future support for web components and object.observe.
  47. What is two-way binding in Angular?
    This means that user input in your form fields is instantly updated in the model.  That means that in most cases you don't need to watch for specific events.

    Also, angular employs 'dirty checking' which means that you don't have to put your data into special structures or call getter and setter methods to read and write data.  You can simply put your data into plain old javascript objects and Angular responds to your changes.
  48. What is dependency injection in regards to Angular?
    Dependency allows you to encapsulate pieces of your application better and also improves testability.
  49. What is the central component in an Angular application?
    The Controller
  50. Directives in Angular are a part of which component?
  51. In Angular, within which component should you put your complex business logic?
  52. In Angular can one module depend on another module?
    Yes.  Modules can have other modules as dependencies.
  53. Should a small application in Angular have more than one module?
    No.  Small applications should only use a single module.

    You would only do this if one part of a module is going to be used by other modules or if there are specific testing needs that will require the simple application be split into multiple modules.
  54. In Angular, what is a controllers primary responsibility?
    The primary responsibility of a controller is to create a scope object.  The scope object is how we communicate with the view.  The scope is able to talk with the view using 2-way communication. We use 2-way bindings to enable changes in the model through the scope.  Events in the view can call methods in the scope.
  55. Can you use basic JavaScript objects as your model in Angular?
  56. What is the markup indicator in Angular for binding data to a view?
    The double curly braces;

    ex.  {{users.username}}
  57. Which Angular directive do you use to bind an image source?

    ex.  <img ng-src="{{event.imageUrl}}" alt = "{{}}" />
  58. What are the purpose of Angular directives in HTML?
    Directives teach HTML new tricks.  Essentially Angular directives give HTML greater functionality.
  59. What are the 4 ways to specify directives with Angular?
    1. As a tag itself.  For instance; <ng-form />

    • 2. Where the directive is an attribute of a tag.  For instance;
    •      <div class = "votingButton" ng-click = "upVoteSession(session)">

    3. As a class. For instance; <div class="ng-form" />

    NOTE: Not all directives can be written in all 3 forms.  Many directives can only be written in one or two of these forms.  

    4.  You can also write some directives inside of an HTML comment. This is an advanced concept.
  60. T/F:  The ng-change directive monitors for a change in an element and can be used alone or with other directives.
    False.  The ng-change directive must always include the ng-model directive as well.  

    • Example:
    • <input type="checkbox" ng-change="handleChange()" ng-model="property" />
  61. T/F:  Angular includes a ngRightMouseClick directive.
    False.  Angular does include man mouse click directives but not ngRightMouseClick.
  62. T/F:  The ngChange directive requires the ngModel directive to also be present.
  63. What are the 4 Angular bind directives?
    • 1. ngBind
    • 2. ngBindTemplate
    • 3. ngBindHtml
    • 4. ngBindHtmlUnsafe
  64. With Angular it is said that you should never manipulate the DOM within a controller.  What then is the best practice for manipulating the DOM?
    Always use Angular directives to manipulate the DOM.
  65. What is the purpose of the Angular ngCloak directive?
    The ngCloak directive avoids a flash of unbound HTML on page load. 

    The ngCloak directive allows you to hide portions or all of your page until Angular has had a chance to run and go through all of your code and parse the HTML and replace the directives or the bindings with the actual values the code is supposed to display.  Otherwise, with some slower clients, you might get flashes of HTML syntax as Angular replaces the code with the assigned and intended values.
  66. What is the benefit of the Angular directive ngForm?
    The Angular directive ngForm allows you to next forms.  With HTML nesting forms is not allowed.  Angular and the  ngForm directive allows you to nest forms for validation, etc.
  67. Which Angular directive delays fetching an image until after binding has occurred?

    Example;  <img ng-src="{{event.imageUrl}}" alt = "{{}}" />
  68. If your website supports older versions of IE what things do you have to keep in mind before implementing Angular?
    • 1. You're going to have to Polyfill JSON.stringify
    • The JSON object is not supported in older browsers. You can work around this by inserting some code at the beginning of your scripts, allowing use of JSON object in implementations which do not natively support it (like Internet Explorer 6).

    2. Whenever you need to use an NG directive, do NOT use the TAG form of the directive.  Write it as an attribute of another element instead. 

    • Example: Do not use;  <ng-form>
    •       Instead use:  <div ng-form...>
  69. T/F: Angular expressions support all JavaScript syntax.
    False.  Angular expressions only support a subset of JavaScript syntax.  They do not support the math. library, for instance.
  70. T/F:  You can create an array in an Angular expression.
    True.  You can create an array and other basic data types inside an Angular expression.
  71. What are the 3 main things that Angular filters can accomplish?
    1. Formatting data - They can do things like change the first letter in a field to uppercase or format dates and dollar amounts for rendering.

    2. Sorting a Dataset - Filters can sort the data to a specific order before rendering. 

    3. Filter a Dataset - Filters can actually filter the data that is included in a dataset to only a predetermined list such as all of the user names that begin with the letter A.  

    Filters are dynamic so whenever you change a filter the output is automatically adjusted.
  72. What are the 3 HTML elements that can be used with the Angular directive ngModel?
    • 1) input
    • 2) select
    • 3) textarea
  73. Which Angular directive can be used to implement two-way binding?

    Two-way binding allows you to keep your model up to date automatically.  The ngModel directive works with 3 different HTML elements; input, select and textarea.
  74. T/F:  Angular two-way binding will update on every keystroke.
  75. In Angular, which HTML elements work with two-way binding and which directive is used to implement two-way binding?
    In Angular the textarea, input or select HTML elements can be implemented with 2-way binding by inclusion of the ngModel directive.

    Example;  <input id="eventCity" type="text" class="input-small" ng-model="" placeholder="City..." />
  76. In Angular, what will happen if you reference a property that doesn't exist in an ngModel directive?
    The property will be created automatically on the scope.
  77. In Angular form validation, what is the opposite of dirty?
  78. In Angular, which directive lets you create a regex for validation?
  79. What is a regex?
    A regular expression (regex) is a special text string for describing a search pattern. You can think of regular expressions as wildcards on steroids. You are probably familiar with wildcard notations such as *.txt to find all text files in a file manager. The regex equivalent is .*.txt.

    • An example of a regex in Angular for validation;
    • <input id="eventDate" type="text" required ng-pattern="/dd/dd/dddd/" ng-model="" placeholder="format (mm/dd/yy)..." />
  80. In Angular, what property does a form element require in order to check validity?
    A form element must have a name property in order to check validity in Angular.
  81. Why do we use services in Angular?
    Services or web workers in Angular allow us to create encapsulated and reuseable business logic objects that can be shared and reused within your applications.   This also helps to create more DRY (don't repeat yourself) applications.

    You could put all of your business logic inside the controllers but that creates applications that are difficult to maintain and violates the single responsibility principle (SRP).

    Another reason is for dependency injection.  You can inject the services into the controllers that need them.

    Using services also makes it easier to code because you can isolate your code to just the pieces that you want to test.
  82. What is SRP?
    SRP = Single Responsibility Principle

    Sometimes described as one of the 5 principles of Object Oriented Programming.

    In this context a responsibility is considered to be one reason to change. This principle states that if we have 2 reasons to change for a class, we have to split the functionality in two classes. Each class will handle only one responsibility and on future if we need to make one change we are going to make it in the class which handle it. When we need to make a change in a class having more responsibilities the change might affect the other functionality of the classes.The Single Responsibility Principle is a simple and intuitive principle, but in practice it is sometimes hard to get it right.
  83. T/F:  In Angular the term "service" refers to an over-the-network service such as a restful service.
    False.  In Angular services are not over the network.  They are just local client objects that may do things like make over-the-network calls to a restful service via AJAX but they don't necessarily do that.
  84. In Angular, why do we need services?
    Reusability, SRP (single responsibility principle), Testability (due to dependency injection)
  85. How is an Angular service different than any other service?
    It really isn't different other than the fact that it is registered with Angular so that Angular can inject it.
  86. What are promises (futures)?
    A promise (or "future") is an object which represents the output of some computation which hasn't necessarily happened yet. When you try to use the value in a promise, the program waits for the computation to complete.

    Suppose you want to execute a SQL query, and it's very large so it takes 10 seconds to complete.

    • In a synchronous programming (most simple programs), you'd do:
    • result = query(...); //  (This takes 10 seconds.)

    This is very straightforward, but means your program can't do anything for 10 seconds. Sometimes that's fine, but sometimes you'd rather do something else, like fire off more I/O or do other computations.

    So you want to make this asynchronous, such that you start the query but your program can keep doing other things until it finishes. One approach is to use callbacks (common in Node.js):query(function(result) { ... }, ...); // Your callback fires in 10 seconds.

    Here, you pass a callback function with the query, and the query API calls the callback when the query completes, handing it the result.
  87. In terms of server errors, what is a 404 error?
    The requested page could not be found but may be available again in the future.
  88. In Angular which service would be the best fit for accessing a restful web service?

    Resource service is specifically designed for working with Restful services.
  89. Which Angular service would be the best fit for accessing a non-restful web service?

    Http service is perfect for making raw request calls regardless of the type of endpoint.
  90. In which module does the $resource reside?
    It's an ngResource module available from the angular-resource library.
  91. What is Bower?
    Bower is a package manager for the web front-end.  NPM is the package manager for back-end and Bower is the package manager for front-end.  

    A bower.json file is created to keep track of the front-end dependencies such as Sass, etc. 

    Bower works by fetching and installing packages from all over, taking care of hunting, finding, downloading and saving the applications you are looking for.  

    Bower keeps track of these packages in a manifest file, bower.json.

    Bower is optimized for the front-end.  Bower uses a flat dependency tree, requiring only one version for each package, reducing page load to a minimum.
  92. What is NPM?
    NPM = Node Package Manager

    A command line utility that is installed when you install node and works as a package manager similar to Bower.
  93. What is Grunt?
    Grunt is a task-based command line build tool for JavaScript projects.

    Here’s the idea: when working on a JavaScript project, there are a bunch of things you’ll want to do regularly. Like what, you ask? Well, like concatenating given files, running JSHint on your code, running tests, or minifying your scripts. If you’re pasting your JavaScript into JSHint online, you probably realize that there’s a better way to do it; even if you’re using cat to concatenate files or a command line minifier, it would be nice to have a single, unified set of commands for all those extra tasks, that worked for every single JavaScript project, right?

    That’s what Grunt aims to be. It has a bunch of built-in tasks that will get you pretty far, with the ability to build your own plugins and scripts that extend the basic functionality.
  94. Describe ExpressJS;
    Express is a web framework for the Node.js platform.  

    Express configuration is done in the config/express.js file when the application is initialized and configured.

    It automatically loads the route files in the app/routes folder which contains the set of routes that the application will serve.  

    There are a few pre-bundled routes;

    Authentication Routes

    Authentication routes are located in the app/routes/users.server.routes.js file.

    • GET http://localhost:3000/users/me
    • Returns the current authenticated user.

    • POST http://localhost:3000/auth/signup
    • This is used to sign up a user using username and password.

    • POST http://localhost:3000/auth/signin
    • This is used to sign in a user using username and password.

    • GET http://localhost:3000/auth/signout
    • This is used to sign out the current user.

    • GET http://localhost:3000/auth/facebook
    • This is used to initialize the Facebook OAuth process.

    • GET http://localhost:3000/auth/facebook/callback
    • This is used as the callback URI for Facebook OAuth process.

    • GET http://localhost:3000/auth/twitter
    • This is used to initialize the Twitter OAuth process.

    • GET http://localhost:3000/auth/twitter/callback
    • This is used as the callback URI for Twitter OAuth process.

    • GET http://localhost:3000/auth/linkedin
    • This is used to initialize the Linkedin OAuth process.

    • GET http://localhost:3000/auth/linkedin/callback
    • This is used as the callback URI for Linkedin OAuth process.

    • GET http://localhost:3000/auth/google
    • This is used to initialize the Google OAuth process.

    • GET http://localhost:3000/auth/google/callback
    • This is used as the callback URI for Google OAuth process.

    • GET http://localhost:3000/auth/github
    • This is used to initialize the Github OAuth process.

    • GET http://localhost:3000/auth/github/callback
    • This is used as the callback URI for Github OAuth process.

    Please notice that you can add more authentication options using a Passport Strategy and this pattern.

    • Application Routes
    • Application core routes are located in the app/routes/core.server.routes.js file.

    • GET http://localhost:3000/
    • The main application page. Using AngularJS helps reduce the use of server side templating, and only serve a single application page. To learn more about this visit the Backend Views section.

    • Example Routes
    • An 'Article' example is included with the boilerplate to help you understand how to properly build your RESTful API, the routes for this module are located in the app/routes/articles.server.routes.js file.

    GET http://localhost:3000/articlesReturns the list of articles.

    POST http://localhost:3000/articlesCreates a new article.

    GET http://localhost:3000/articles/:articleIdReturns an article by articleId.

    PUT http://localhost:3000/articles/:articleIdUpdates an article by ID.

    DEL http://localhost:3000/articles/:articleIdDeletes an article by ID.
  95. What is an iffy (IIFE) function expression?
    An immediately-invoked function expression (or IIFE, pronounced "iffy") is a JavaScript design pattern which produces a lexical scope using JavaScript's function scoping.

    Immediately-invoked function expressions can be used to avoid variable hoisting from within blocks, protect against polluting the global environment and simultaneously allow public access to methods while retaining privacy for variables defined within the function.

    This pattern has been referred to as a self-executing anonymous function, but Ben Alman introduced the term IIFE as a more semantically accurate term for the pattern, shortly after its discussion arose on comp.lang.javascript.
  96. Which of the following are true about NodeJS?

    A) It's a client-side programming environment
    B) It's a server-side, runtime environment
    C) It' a wrapper that code runs inside of like .Net
    D) It's a programming language for web applications
    E) None of these
    F) All of these

    1. A, C, E
    2. B, D
    3. A, B
    4. B, C
    5. A, C
    6. E
    7. F
    4. B, C

    NodeJS is not a programming language.  NodeJS is a server-side, runtime environment similar to ASP.Net.

    NodeJS in written in Javascript and is truly cross platform, lightweight and unopinionated.
  97. What is NPM?
    NPM is the package management system for NodeJS and is included in the install for NodeJS.
  98. What is the common and standard way to launch a node server from the command line?
    npm start

    By including a start script in your servers package.json file, the launch of your node server can be standardized so that a user does not need to know what your main launch file is; (ex. app.js, server.js, etc).

    Example of package.json file with Start script employed;

    • {
    • "name": "library",
    • "version": "1.0.0",
    • "description": "",
    • "main": "app.js",
    • "scripts": {
    •      "test": "echo "Error: no test specified" && exit 1",
    • "start": "node app.js" },
    • "author": "",
    • "license": "ISC",
    • "dependencies": {
    •      "express": "^4.13.4"
    • }}
  99. What is the name of the hidden file were Bower looks before install components to an application?

    (Hint: System files begin with a dot '.')

    When installing components Bower first looks in the .bowerrc file to find the default location for installing files.
  100. What is Gulp?
    Gulp is a task manager for your web development projects.  Many people refer to it as a build tool but it's really a task management product.

    You install Gulp with NPM.
  101. What is JS Hint?
    JS Hint is for code quality management.  It detects potential errors, enforces coding conventions, easily configurable, and it's open source.
  102. What is JSCS?
    JSCS is for code style enforcement.  It enforces style conventions like number of spaces between lines or in front of lines.  It is easy configurable and also open source.
  103. What is the purpose of wrapping Angular components in IIFE expressions?
    Wrap Angular components in an Immediately Invoked Function Expression (IIFE).  Why?

    1) An IIFE removes variables from the global scope. This helps prevent variables and function declarations from living longer than expected in the global scope, which also helps avoid variable collisions.

    2) When your code is minified and bundled into a single file for deployment to a production server, you could have collisions of variables and many global variables. An IIFE protects you against both of these by providing variable scope for each file.
Card Set
Software Engineering Interview Questions
Interview study set