Junior Web/Software Developer Common Questions

¡Supera tus tareas y exámenes ahora con Quizwiz!

How can a rails server be run on a different port?

rails server -p 4000 (or another number)

How can you get a list of rake tasks?

rake --tasks

How can you sum an array of numbers in Ruby?

array.inject(:+)

What Is The Mechanism To Detect The Operating System On The Client Machine?

navigator.appVersion

What is data integrity?

the overall completeness, accuracy and consistency of data. This can be indicated by the absence of alteration between two instances or between two updates of a data record, meaning data is intact and unchanged

What is data type constraint?

the type of data, data length, and a few other attributes which are specifically associated with the type of data in a column.

How do you remove nil values in an array in Ruby?

use .compact

What is check constraint?

used to limit the values that can be placed in a column. The check constraints are used to enforce domain integrity.

What is required for writing Mocha tests

An assertion library; Chai is a common one.

What are some cases where an anonymous function is better used than a declared function?

Inside loops or if statements.

What is the purpose of the alt attribute on images?

To provide alternative information on the image if a user is unable to view it.

What is domain integrity?

all columns in a relational database are in a defined domain.

What are 7 kinds of database constraints?

data type, default, nullability, primary key, unique, foreign key, check

What are database constraints?

declarative integrity rules of defining table structures

What is foreign key constraint?

defines how referential integrity is enforced between two tables.

What is nullability contraint?

defines if a column is NOT NULL or allow NULL values to be stored in it.

What are some Rspec keywords?

describe, context, it, expect

What is the difference between span and div?

div is a block element and span is inline element. A div can have a p tag or span tag inside of it but a span tag can not have a p tag or div element.

What are the three kinds of data integrity in a relational database?

entity integrity, referential integrity, domain integrity.

What is a callback function?

function that is passed to another function as an argument and is executed after some operation has been completed.

What command in terminal runs mocha tests?

npm test

How can you access the Ruby command line without changing any data?

rails console --sandbox

How can you access the database console in rails?

rails dbconsole or rails db

What are some elements html5 introduced for media content?

<audio> - It specifies sound content. <video> - It links to a video. <source> - This tag specified the source of video and audio links. <embed> - It acts as a container for external applications. <track> - This element defines tracks for video and audio.

Why is the root certificate important?

A Root SSL certificate is a certificate issued by a trusted certificate authority (CA). In the SSL ecosystem, anyone can generate a signing key and sign a new certificate with that signature. However, that certificate is not considered valid unless it has been directly or indirectly signed by a trusted CA. A trusted certificate authority is an entity that has been entitled to verify that someone is effectively who it declares to be. In order for this model to work, all the participants on the game must agree on a set of CA which they trust. All operating systems and most of web browsers ship with a set of trusted CAs.

What is a botnet?

A botnet is a number of Internet-connected devices, each of which is running one or more bots. Botnets can be used to perform distributed denial-of-service attack (DDoS attack), steal data, send spam, and allows the attacker to access the device and its connection.

What is the purpose of using super constructor with props argument?

A child class constructor cannot make use of this reference until super() method has been called. The same applies for ES6 sub-classes as well. The main reason of passing props parameter to super() call is to access this.props in your child constructors.

What is a stateless component?

A component that just receives props and renders them to the page; a pure function suffices for a stateless component.

How can you validate your html?

A computer program can check html or css code for errors; w3 schools has an online html or css validator.

What is the difference between "not defined" and "undefined" in JavaScript?

A declared variable that has no return value is undefined; a variable that has not been declared throws "not defined" when called.

What is a DDoS attack?

A denial-of-service attack (DoS attack) is an attempt to make a computer resource unavailable to its intended users. Denial of service is typically accomplished by flooding the targeted machine or resource with superfluous requests in an attempt to overload systems and prevent some or all legitimate requests from being fulfilled. In a distributed denial-of-service attack (DDoS attack), the incoming traffic flooding the victim originates from many different sources. This effectively makes it impossible to stop the attack simply by blocking a single source.

What is Git?

A distributed version control system. It can track changes to a file and allows you to revert back to any particular change.

What is the difference between fork, branch, and clone?

A fork is a remote, server-side copy of a repository, distinct from the original. a clone is a local copy of some remote repository. When you clone, you are actually copying the entire source repository, including all the history and branches. A branch is a mechanism to handle the changes within a single repository in order to eventually merge them with the rest of code. A branch is something that is within a repository. Conceptually, it represents a thread of development.

What is scope in javascript?

In JavaScript, each function gets its own scope. Scope is basically a collection of variables as well as the rules for how those variables are accessed by name. Only code inside that function can access that function's scoped variables. A variable name has to be unique within the same scope. A scope can be nested inside another scope. If one scope is nested inside another, code inside the innermost scope can access variables from either scope.

What is postgresql?

Open source object relational database management system that uses and extends the SQL language

What is Ruby on Rails?

Open source web application framework that uses convention to quickly create MVC. Written on top of the Ruby programming language.

How can you prevent SQL injections?

Prepared statements with parameterized queries Stored procedures Input validation - blacklist validation and whitelist validation Principle of least privilege - Application accounts shouldn't assign DBA or admin type access onto the database server. This ensures that if an application is compromised, an attacker won't have the rights to the database through the compromised application.

What is an SSL certificate?

SSL Certificates are small data files that digitally bind a cryptographic key to an organization's details. When installed on a web server, it activates the padlock and the https protocol (over port 443) and allows secure connections from a web server to a browser.

What is session hijacking?

Session Hijacking involves the exploitation of the web session control mechanism. The attacker basically exploits vulnerable connections and steals HTTP cookies to gain unauthorized access to sensitive information/data stored in web servers.

What is an iframe and how does it work?

an HTML document which can be embedded inside another HTML page.

What is elasticsearch?

open-source, broadly-distributable, readily-scalable, enterprise-grade search engine. Accessible through an extensive and elaborate API, Elasticsearch can power extremely fast searches that support your data discovery applications.

Why should JS scripts go right before the closing </body> tag?

The browser can render all of the markup first; scripts block parallel downloading.

What is OOP?

"Object-oriented programming (OOP) is a programming paradigm using ""objects"" - data structures consisting of data fields and methods together with their interactions - to design applications and computer programs. OOP allows faster development (in the long run) and easier maintenance of code.

What is primary key constraint?

This is the unique identifier of the table. Each row must have a distinct value. Null values are not allowed.

What does stopImmediatePropagation() do ?

Will prevent the same event from firing other event listeners.

What is Capybara?

a web-based automation framework used for creating functional tests that simulate how users would interact with an application. Can be installed as a ruby gem. Is used on top of a web-based driver. Some web drivers also allow it to work with JavaScript.

What is an example of asynchronous JavaScript code?

the setTimeOut() function. $.get() will also run asynchronously.

What is default constraint?

what value the column should use when no value has been supplied explicitly when inserting a record in the table.

What code do you add to get mocha tests working?

// package.json { "scripts": { "test": "mocha" } }

What happens when you type an URL in the browser and press enter?

1. The browser checks the cache for a DNS record to find the corresponding IP address. First the browser cache, then the OS cache, then the router cache, then the ISP cache. 2. If url is not in the cache, ISP's DNS server initiates a DNS query to find the IP address of the server that hosts the url. 3. Browser initiates a TCP connection with the server 4. The browser sends an HTTP request to the web server 5. The server handles the request and sends back a response 6. The browser displays the content sent back.

What is the difference between inline and inline-block?

Compared to display: inline, the major difference is that display: inline-block allows to set a width and height on the element. Also, with display: inline-block, the top and bottom margins/paddings are respected, but with display: inline they are not.

What is the difference between component and container in react Redux?

Component is part of the React API. A Component is a class or function that describes part of a React UI. Container is an informal term for a React component that is connected to a redux store. Containers receive Redux state updates and dispatch actions, and they usually don't render DOM elements; they delegate rendering to presentational child components.

What is CRUD?

Create, Read/Retrieve (Select), Update and Delete are the four basic functions of persistent storage. In a REST environment, CRUD often corresponds to the HTTP methods POST, GET, PUT, and DELETE, respectively. These are the fundamental elements of a persistent storage system.

What is DOM?

Document Object Model;treats an HTML, XHTML, or XML document as a tree structure wherein each node is an object representing a part of the document. When a browser creates a DOM, it must combine the document's content with its style information

What are some advantage of jQuery?

Easy to use and learn. Easily expandable. Cross-browser support (IE 6.0+, FF 1.5+, Safari 2.0+, Opera 9.0+) Easy to use for DOM manipulation and traversal. Large pool of built in methods. AJAX Capabilities. Methods for changing or applying CSS, creating animations. Event detection and handling. Tons of plug-ins for all kind of needs.

What is float in CSS?

Float is a CSS positioning property. Floated elements remain a part of the flow of the web page. This is distinctly different than page elements that use absolute positioning. Absolutely positioned page elements are removed from the flow of the webpage.

Name some performance testing steps

Identify the testing environment Identify performance metrics Plan and design performance tests Configure the test environment Implement your test design Execute tests Analyze, report, retest

When should you use a class component over a functional component (React)?

If the component needs state or lifecycle methods then use class component otherwise use functional component.

How Do You Make Border Rounded With CSS3?

In CSS3, there is a <border-radius> property which allows creating an element with rounded corners. We can apply the same style to all the sides and make the corners round. The <border-radius> property has four individual properties <border-top-left-radius>, <border-top-right-radius>, <border-bottom-left-radius> and <border-bottom-right-radius>.

What is inheritance?

Inheritance is a mechanism in which one object acquires all the properties and behaviour of another object of another class. It is used for Code Resusability and Method Overriding. A child class inherits/reuses methods from its parent class.

What does it mean for a component to be mounted in React?

It has a corresponding element created in the DOM and is connected to that.

How Do You Add Comments In CSS?

Place the comments inside the enclosing /* and */.

What is polymorphic association in Ruby on Rails?

Polymorphic Association allows an ActiveRecord object to be connected with Multiple ActiveRecord objects. A perfect example of Polymorphic Association is a social site where users can comment on anywhere whether it is a videos, photos, link, status updates etc. It would be not feasible if you have to create an individual comment like photos_comments, videos_comment and so on.

What is the difference between procedural and object oriented programming?

Procedural programming is based upon the modular approach in which the larger programs are broken into procedures. Each procedure is a set of instructions that are executed one after another. On the other hand, OOP is based upon objects. An object consists of various elements, such as methods and variables. Access modifiers are not used in procedural programming, which implies that the entire data can be accessed freely anywhere in the program. In OOP, you can specify the scope of a particular data by using access modifiers - public, private, internal, protected, and protected internal.

What is the difference extend and include in Ruby?

The "include" makes the module's methods available to the instance of a class, while "extend" makes these methods available to the class itself.

Write a single line of Ruby code that prints the Fibonacci sequence of any length as an array.

(1..20).inject( [0, 1] ) { | fib | fib << fib.last(2).inject(:+) }

What are some DOM elements Capybara looks for?

-Text field (fill_in): id, name, related label element -Click link/button (click_link/click_button): id, title, text within tag, value -Checkbox/radio button/dropdown (check/uncheck/choose/select): id, name, related label element -Upload file (attach_file): id, name

Which Property Do You Use To Modify The Face Of A Font In CSS?

-font-family. @font-face { font-family: myCustomFont; src: url(sansation_light.woff); } body { font-family: 'myCustomFont', Fallback, Ariel; }

What do the following status categories mean: 1--, 2--, 3--, 4--, 5-- (e.g. 100, 500)?

1-- for information 2-- for success 3-- for redirect 4-- for client side error 5-- for server side error

In JavaScript, what is the difference between undefined value and null value?

1. A variable will have <undefined> value if it has declaration but not assigned any value. 2. A variable will yield a <null> value if assigned with null. 3. <undefined> is a type itself whreeas <null> is an object. 4. <undefined> value is set via JavaScript engine whereas null value is set directly in the code.

What is the order of events that occurs with AJAX?

1. An event occurs in a web page (the page is loaded, a button is clicked) 2. An XMLHttpRequest object is created by JavaScript 3. The XMLHttpRequest object sends a request to a web server 4. The server processes the request 5. The server sends a response back to the web page 6. The response is read by JavaScript 7. Proper action (like page update) is performed by JavaScript

What happens during the lifecycle of a React component?

1. Initialization 2. State/property updates 3. Destruction

What are the two rules of referential integrity?

1. You can not delete a record where another table references that id in a foreign key column. 2. You can not add a foreign key pointing to an id that does not exist.

What are two reasons for using database constraints?

1. constraints are inherent to the database engine and so use less system resources to perform their dedicated tasks. 2. database constraints are always checked by the database engine before insert, update, or delete operation. Invalid operation is cancelled before the operation is undertaken. So they are more reliable and robust for enforcing data integrity.

What are two ways to highlight text in a web page?

1. use a <mark></mark> tag for html5 pages; 2. set the background-color style attribute.

How many resources will a browser download from a given domain at a time?

2-8 depending on the browser; chrome downloads 6 at a time.

What do the following status responses mean: 200, 204, 301, 307, 308, 401, 404?

200 - success 204 - success but no content 301 - moved permanently 307 - temporary redirect 308 - permanent redirect 401 - unauthorized 404 - not found

What is the purpose of a header tag?

<header> is used to contain introductory and navigational information about a section of the page. This can include the section heading, the author's name, time and date of publication, table of contents, or other navigational information.

What is Backbone?

A JavaScript framework that structures JS code into an MVC pattern; Especially useful for organizing and maintaining large amounts of code tying together a complex user interface.

What is Mocha?

A JavaScript test runner that runs both on Node.js and in the browser. It provides functionality for testing both synchronous and asynchronous code with a very simple and similar interface.

What Are Pseudo-Classes In CSS?

A Pseudo-Class is a CSS technique to set the style when the element changes its state. Examples: -Edit the style upon mouse hover event. -Set the style when an element gets focus. -Apply different styles for visited/unvisited links.

What is yield in Ruby?

A Ruby method that receives a code block invokes it by calling it with the "Yield".

What Are Child Selectors In CSS?

A child selector looks up for the child of some element. To form a child selector, we need two or more selectors separated by "greater than" symbol. Let's take an example. We have a <ul> tag inside a paragraph. Here, <ul> is the child of the paragraph element. So, to apply the CSS styles, we can use the following syntax.

What is a higher order function in JavaScript?

A function that takes another function as an argument.

What is an anonymous function in JavaScript?

A function without a name declared; uses functional operator rather than declaration; typical use case is when a variable points to an anonymous function. Unlike function definitions they are invoked at runtime. It is more flexible than a declaration.

What is the difference between load and stress testing?

A load test is usually conducted to understand the behaviour of the system under a specific expected load. This load can be the expected concurrent number of users on the application performing a specific number of transactions within the set duration. This test will give out the response times of all the important business critical transactions. A stress testing instead is performed to understand the upper limits of capacity within the system. This kind of test is done to determine the system's robustness in terms of extreme load and helps application administrators to determine if the system will perform sufficiently if the current load goes well above the expected maximum.

What is RubyGems?

A package manager for the Ruby programming language that provides a standard format for distributing Ruby programs and libraries (in a self-contained format called a "gem"), a tool designed to easily manage the installation of gems, and a server for distributing them; A tool to install, create, manage and load Ruby library packages in your Ruby environment.

What is Agile development?

A software development methodology that delivers functionality in rapid iterations, measured in weeks, requiring frequent communication, development, testing, and delivery.

What is object relational mapping?

A technique that connects the objects of an application to a relational database system.

What is a class?

A template from which objects are created; a blueprint from which an objects properties and methods are inherited. In Ruby classes are first class objects.

What is Rake?

A tool that is available to us in Ruby that allows us to automate certain jobs--anything from execute SQL to puts-ing out a friendly message to the terminal. Rake allows us to define something called "Rake tasks" that execute these jobs. Once we define a task, that task can be executed from the command line.

What is Rspec?

A unit test framework for the Ruby language. Rspec emphasizes testing behavioral output rather than inner workings. Can be installed as a gem.

What is abstraction?

Abstraction is a process of hiding the implementation details and showing only functionality to the user. Abstraction lets you focus on what the object does instead of how it does it.

What Are Different Types Of Popup Boxes Available In JavaScript?

Alert - It just has an <Ok> button to proceed. Confirm - It pops up a window showing up <Ok> and <Cancel> buttons. Prompt - It gives a dialog asking for user input followed by showing <Ok>/<Cancel> buttons.

What is ActiveRecord?

An Object Relational Mapping framework;

What is the point of Redux?

Application state management that is easy to reason about, maintain and manage in an asynchronous web application environment.

How Does JavaScript Handle Automatic Type Conversion?

As per ECMA Script standard, JavaScript is dynamic as well as weakly typed language with first-class functions which means a function can accept other functions as arguments. Also, it does support auto-type conversion. Whenever an operator or a statement doesn't get a value of the expected type, then the conversion takes place automatically.

What is AJAX?

Asynchronous JavaScript and XML; AJAX just uses a combination of: A browser built-in XMLHttpRequest object (to request data from a web server) JavaScript and HTML DOM (to display or use the data). Note that you can also transport plain text or JSON.

How can you force uniqueness on the database side?

By using unique indexes; For example: add_index :users, :email, unique: true Or from command line: rails generate model user email:string:uniq

What is asynchronous code?

Code that schedules some task to be completed in the future, but lines of code coming on later lines run first.

What is XML?

Extensible Markup Language; A software- and hardware-independent tool for storing and transporting data.It does not do anything by itself: someone has to write software to send, store, or display it.

What is impersonation?

For IT Systems impersonation means that some specific users (usually Admins) could get an access to other user's data.

How do you set the primary language of a webpage?

For example: <html lang="en">

What is the difference between a functional test and an acceptance test?

Functional testing: This is a verification activity; did we build a correctly working product? Does the software meet the business requirements? A functional test verifies that the product actually works as you (the developer) think it does. Acceptance testing: This is a validation activity; did we build the right thing? Is this what the customer really needs? Acceptance tests verify the product actually solves the problem it was made to solve. This can best be done by the user (customer), for instance performing his/her tasks that the software assists with.

What is the difference between a gem and a plugin in Ruby?

Gem: A gem is a just ruby code. It is installed on a machine, and it's available for all ruby applications running on that machine. Plugin: Plugin is also ruby code, but it is installed in the application folder and only available for that specific application.

What Is HTML5 Web Storage?

HTML5 brought this new ability to store web pages within the browser cache. This web storage is not only faster than the cookies but secured too. It is capable of storing a large amount of data without compromising the performance of the website. Also, note that the cached data is not must for every server request. Instead, it gets utilized only when the page asks for it. And only the web page which gets the data stored can access it.

What is one scenario where a Rails uniqueness validator fails to protect database integrity?

If two web processes run at a nearly similar time and both try to create a user with the same email address, then the validation for a unique email address will fail, and two users with identical email addresses will be created.

Where is the state kept in a React + Redux app?

In the store.

Where does Mocha look for tests?

In the test directory at the root of the project.

What is the new DOCTYPE?

Instead of typing out a ridiculously long DOCTYPE statement to tell the browser how to render your webpage, this long line of code has been truncated to <!doctype html>.

What does the $ mean in jquery?

It is an alias for jQuery. $(document).ready is equivalent to jQuery(document).ready

Why is it best to put stylesheets in the head of html?

It is w3c standard and it allows the page to load progressively.

What is the CSS display property?

It specifies the type of rendering box for an element. Some possible values: inline, inline-block, block, none, inherit.

What is prototypal inheritance?

JavaScript uses prototypal inheritance. Objects inherit directly from other objects, rather than taxonomies of classes with class inheritance. In JavaScript, all objects have a hidden prototype property that is either another object or null.

What does the command 'rails server' do?

Launches a web server named WEBrick.

What is one bad scenario that same origin policy prevents?

Let us say you are somehow tricked into visiting www.your-bank.bad-site.com. On that bad site, there is an iframe that loads www.your-bank.com, where you proceed to login legitimately. After logging in, a simple JavaScript call on the bad site could be used to access the DOM elements of www.your-bank.com loaded in the iframe, such as your account balance. This is prevented by SOP because because they have different domains and thus can not access each other's resource attributes.

What is PredictionIO?

Machine learning server built on an open source stack; supports scaling and simplifying of the development of machine learning technology.

How Do You Enable Pagination Using CSS3?

Making use of a <ul-li> structure, we can allow Pagination with CSS3. <div class="main_container"> <div class="pagination"> <ul> <li><a href="#"></a></li> <li><a href="#"></a></li> <li class="active"><a href="#"></a></li> <li><a href="#"></a></li> </ul> </div> </div>

What is entity integrity?

Means that the value of a primary key can not be null and must be unique. Every table must have its own primary key; all rows in a table must be unique.

What Are Media Queries In CSS3 And Why Do You Use Them?

Media queries are one of the latest features of CSS3 used to define responsive styles for devices of different shapes and sizes. They are the powerful CSS tool which makes it easy to create responsive design for tablets, desktop, mobiles devices. They can help adjusting the Height, Width, Viewport, Orientation and Resolution. @media screen and (min-width: 480px) { body { background-color: #ffffff; } }

What are html meta tags?

Meta tags always go inside head tag of the HTML page. Meta tags is always passed as name/value pairs. Meta tags are not displayed on the page but intended for the browser. Meta tags can contain information about character encoding, description, title of the document etc,

What is BEM CSS?

Methodology for structuring CSS code that uses Block, Element, Modifiers.

How does Rack middleware work?

Middleware are the building blocks of larger applications built using the Rack pattern. Each middleware is a Rack compatible application, and our final application is built by composing together, or nesting these middleware.

What is mocking (context: testing) ?

Mocking is primarily used in unit testing. An object under test may have dependencies on other (complex) objects. To isolate the behavior of the object you want to replace the other objects by mocks that simulate the behavior of the real objects. This is useful if the real objects are impractical to incorporate into the unit test. In short, mocking is creating objects that simulate the behavior of real objects.

What is the difference between a class and a module? (Ruby)

Modules are collections of methods and constants. They cannot generate instances. Classes may generate instances (objects), and have per-instance state (instance variables). Modules may be mixed in to classes and other modules. The mixed in module's constants and methods blend into that class's own, augmenting the class's functionality. Classes, however, cannot be mixed in to anything. A class may inherit from another class, but not from a module. A module may not inherit from anything.

Can you inherit private members of a class?

No, you cannot inherit private members of a class because private members are accessible only to that class and not outside that class.

What is npm?

Node Package Manager; npm provides following two main functionalities: Online repositories for node.js packages/modules which are searchable on search.nodejs.org Command line utility to install packages, do version management and dependency management of Node.js packages.

What is Node.js?

Node.js is a web application framework built on Google Chrome's JavaScript Engine (V8 Engine). Node.js comes with runtime environment on which a Javascript based script can be interpreted and executed (It is analogus to JVM to JAVA byte code). This runtime allows to execute a JavaScript code on any machine outside a browser. Because of this runtime of Node.js, JavaScript is now can be executed on server as well.

What are the core data types of JavaScript?

Number Object String Boolean Function Null Undefined

What is profiling (context: testing) ?

Profiling measures how long various parts of the code take to run. Profilers are implemented a lot like debuggers too, except that rather than allowing you to stop the program and poke around, they simply let it run and keep track of how much time gets spent in every part of the program. This is particularly useful if you have some code that is running slower than you need it to run, as you can figure out exactly where all the time is going, and concentrate your efforts on fixing just that bottleneck.

Describe the difference between progressive enhancement and graceful degradation?

Progressive enhancement refers to a feature of your web site that enhances the experience for browsers that support it, but has no impact if your browser does not. Graceful degradation takes that modern feature and acts as if it is the default, but will not completely break the older browser.

What is the rack interface?

Rack defines a very simple interface. Rack compliant code must have the following three characteristics: It must respond to call The call method must accept a single argument - This argument is typically called env or environment, and it bundles all of the data about the request. The call method must return an array of three elements These elements are, in order, status for the HTTP status code, headers, and body for the actual content of the response.

What is rack? (Ruby)

Rack is the underlying technology behind nearly all of the web frameworks in the Ruby world. "Rack" is actually a few different things: An architecture - Rack defines a very simple interface, and any code that conforms to this interface can be used in a Rack application. This makes it very easy to build small, focused, and reusable bits of code and then use Rack to compose these bits into a larger application. A Ruby gem - Rack is is distributed as a Ruby gem that provides the glue code needed to compose our code.

What is a Rails engine?

Rails::Engine allows you to wrap a specific Rails application or subset of functionality and share it with other applications or within a larger packaged application. Every Rails::Application is just an engine, which allows for simple feature and application sharing. Any Rails::Engine is also a Rails::Railtie, so the same methods (like rake_tasks and generators) and configuration options that are available in railties can also be used in engines.

What is React?

React is an open-source JavaScript library created by Facebook for building complex, interactive UIs in web and mobile applications. React's core purpose is to build UI components; it is often referred to as just the "V" (View) in an "MVC" architecture.

What is ReactJS?

ReactJS is an open-source frontend JavaScript library which is used for building user interfaces especifically for single page applications. It is used for handling view layer for web and mobile apps

What can you do with AJAX?

Read data from a web server - after the page has loaded Update a web page without reloading the page Send data to a web server - in the background

what is redis?

Redis is an in-memory data structure store, used as database, cache and message broker. Supports caching, where some data is stored in a cache for faster retrieval.

What is REST?

Representational State Transfer; In a RESTful web service, requests made to a resource's URI will elicit a response with a payload formatted in HTML, XML, JSON, or some other format. The response can confirm that some alteration has been made to the stored resource, and the response can provide hypertext links to other related resources or collections of resources. When HTTP is used, as is most common, the operations available are GET, POST, PUT, DELETE, and other predefined CRUD HTTP methods.

What are singleton methods in Ruby?

Singleton methods are methods that live in the singleton class and are only available for a single object (unlike regular instance methods that are available to all instances of the class). Methods defined with dot notation are singleton methods for the receiver object. 1. s = 'a string' 2. def s.meth; end 3. s.singleton_methods # => [:meth]

What is a self-closing tag?

Some tags do not need to have an adjoining closing tag. Example: <meta> <meta /> are both okay in html5.

Explain Null and Undefined in JavaScript

Something hasn't been initialized : undefined. Something is currently unavailable: null.

What is the use of super in Ruby?

Super is used to call the parent classes initialize method from the child initialize method. Super has following forms of implementation. 1.Calling only the super means 2.Call the parents initialize

What is encapsulation?

Surrounding something, not just to keep the contents together, but also to protect those contents. Restricts access to the inner workings of a class or any objects based on that class; this is referred to as information hiding or data hiding.

What does "use strict" do?

The 'use strict' literal is entered at the top of a JavaScript program or at the top of a function and it helps you write safer JavaScript code by throwing an error if a global variable is created by mistake. For example, the following program will throw an error:

What Is The Difference Between LocalStorage And SessionStorage Objects?

The <localStorage> object doesn't have an expiry for the stored data whereas the <sessionStorage> object keeps it only for a single session. The <localStorage> object doesn't have a provision to delete the data upon closing of browser window whereas the <sessionStorage> object clears it simultaneously with the window closing down.

What Is The Use Of <This> Keyword In JavaScript?

The <this> keyword refers to the current object in the program. It is usually available inside a method for referencing the current variable or current object.

What is the Charset in html5?

The CharSet is a new meta tag attribute in HTML5 which configures the character encoding. <meta charset="UTF-8″>

What are HTTP methods? List all HTTP methods that you know, and explain them.

The GET method requests a representation of the specified resource. Requests using GET should only retrieve data. The POST method is used to submit an entity to the specified resource, often causing a change in state or side effects on the server. The PUT method replaces all current representations of the target resource with the request payload. The PATCH method is used to apply partial modifications to a resource. The DELETE method deletes the specified resource. also: options, connect, head, trace.

What is hoisting in JavaScript?

The default behavior of moving declarations to the top of the script; without strict, or using var, a variable may be accessed before it is declared.

What is the difference between NIL and FALSE in Ruby?

The differences between NIL and FALSE in Ruby are: •FALSE is a boolean data type, whereas NIL is not •NIL cannot be a value, whereas a FALSE can be a value •A method returns true or FALSE in case of a predicate, otherwise, NIL is returned •NIL is an object for NilClass, whereas FALSE is an object of for FalseClass

What happens when you call setState?

The first thing React will do when setState is called is merge the object you passed into setState into the current state of the component. This will kick off a process called reconciliation. The end goal of reconciliation is to, in the most efficient way possible, update the UI based on this new state. To do this, React will construct a new tree of React elements (which you can think of as an object representation of your UI). Once it has this tree, in order to figure out how the UI should change in response to the new state, React will diff this new tree against the previous element tree. By doing this, React will then know the exact changes which occurred, and by knowing exactly what changes occurred, will able to minimize its footprint on the UI by only making updates where absolutely necessary.

What is a CSS selector?

The instruction that indicates the element to which the style applies

What is the same-origin policy? Why is it important?

The same origin policy states that a web browser permits script contained in one page (or frame) to access data in another page (or frame) only if both the pages have the same origin. By same origin, it means that both the pages should have been generated from same domain or sub domain. This is to prevent theft of data.

What is the rails asset pipeline?

The tools and mechanisms by which Javascript files, stylesheets, and images are processed and prepared for use by the browser.

What is virtual DOM?

The virtual DOM (VDOM) is an in-memory representation of Real DOM. The representation of a UI is kept in memory and synced with the "real" DOM. It's a step that happens between the render function being called and the displaying of elements on the screen. This entire process is called reconciliation.

What Is Z-Index And How Does It Work?

The z-index is a CSS property which defines the stack order of web elements. Higher order elements will appear before any lower order element. Note - The z-index only applies to the positioned elements. For example, position:absolute, position:relative, or position:fixed.

What are levels of method access control for classes in Ruby?

There are three levels of method access control for classes: 1.Public Methods: It can be called by all objects and subclasses of the class in which they are defined in. 2.Protected Methods: It can be only accessible to objects within the same class. 3.Private Methods: It is accessible in the same instance.

What is the difference between CSS reset and CSS normalize?

These come into play with cross-browser readibility. CSS reset clears all styles; CSS Normalize keeps some useful defaults.

In Ruby, what is the difference between string and symbol?

They both act in the same way only they differ in their behaviors which are opposite to each other. The difference lies in the object_id, memory and process tune when they are used together. Symbol belongs to the category of immutable objects whereas Strings are considered as mutable objects.

What is referential integrity?

This is the concept of foreign keys; is concerned with relationships. The rule states that the foreign key value can be in two states. The first state is that the foreign key value would refer to a primary key value of another table, or it can be null. Being null could simply mean that there are no relationships, or that the relationship is unknown.

How does Rails guard against CSRF (cross site request forgery?)

To protect from CSRF attacks, you have to add "protect_from_forgery" to your ApplicationController. This will cause Rails to require a CSRF token to process the request. CSRF token is given as a hidden field in every form created using Rails form builders.

What is flux?

Unidrectional application flow paradigm popular a few years back in React; mostly superceded by Redux these days.

What is the difference between unit tests and functional tests?

Unit tests test just one unit, such as a single function. Functional tests test a slice of functionality in a system and thus many methods, and may interact with dependencies.

What is one way to get better rankings from a search engine?

Use a meta tag with keywords and description.

How can you include a different language on a webpage?

Use the lang attribute, which can work with most elements: <blockquote lang="fr"> <p>Le plus grand faible des hommes, c'est l'amour qu'ils ont de la vie.</p> </blockquote>

What is SQL injection?

User enters SQL statement into a form instead of a name or other data. Accepted code becomes part of database commands issued. Improper data disclosure, data damage and loss possible. Well-designed applications make injections ineffective .

What are some advantages of validating html and css code?

Using a validation engine improves cross-browser compatibility, improves search engine rankings by eliminating errors, and is insurance against future web browser editions throwing errors with your code.

What is reconciliation in React?

When a component's props or state change, React decides whether an actual DOM update is necessary by comparing the newly returned element with the previously rendered one. When they are not equal, React will update the DOM. This process is called reconciliation.

What is polymorphism?

When two different objects respond to the exact same message in different ways. Two different classes might have the same named method that is implemented in a manner specific to that class.

What is progressive rendering?

With HTML progressive rendering is chunking the HTML into separate bits and loading each block as it's finished. Usually, the backend code loads the HTML at once, but if you flush after finishing one part of the structure, it can be rendered immediately to the page.

What is the difference between html and xhtml?

XHTML stands for EXtensible HyperText Markup Language XHTML is almost identical to HTML XHTML is stricter than HTML XHTML is HTML defined as an XML application XHTML is supported by all major browsers

Can you call a private method outside a Ruby class using its object?

Yes, with the help of the send method. Given the class Test: class Test private def method p "I am a private method" end end We can execute the private method using send: >> Test.new.send(:method) "I am a private method"

What are some examples of what is and is not permitted by the same origin policy?

a site with origin A: -Can load a script from origin B, but it works in A's context --Cannot reach the raw content and source code of the script -Can load CSS from the origin B -Cannot reach the raw text of the CSS files in origin B -Can load a page from origin B by iframe -Cannot reach the DOM of the iframe loaded from origin B -Can load an image from origin B -Cannot reach the bits of the image loaded from origin B -Can play a video from origin B -Cannot capture the images of the video loaded from origin B

What is user-defined integrity?

allows the user to apply business rules to the database that aren't covered by any of the other three data integrity types.

What are the three character data types in postgresql?

character varying(n), varchar(n): variable-length with limit character(n), char(n): fixed-length, blank padded text: variable unlimited length

What are the variable types in Ruby?

class, instance, global, and local. @@ class, @ instance, $ global, local are not prefixed.

What is A/B testing?

comparing two versions of a web page to see which one performs better

What is the difference between git pull and git fetch?

git pull does both a git fetch and git merge

What is the difference between an attribute and a property (context: html and JS)?

html tags have standard attributes that are turned into properties when a JavaScript object. Standard html attributes get turned into properties. HTML attributes are case insensitive and are always strings. DOM properties are not always strings.

Why should a website use https rather than http?

https is a secure communication channel where information is encrypted against interception and the identity of the website is verified. Google also prefers it for search engine ranking.

What is the CSS box model?

is essentially boxes within boxes that wraps around HTML elements, and it consists of from outer box to inner box: margins, borders, padding, and the actual content.

Write a simple unit test to see if a method returns "hello world"

it "the say_hello method should return 'hello world' do hw = ClassName.new message = hw.say_hello expect(message).to eq "hello world" end

What is a JavaScript promise?

object represents the eventual completion (or failure) of an asynchronous operation, and its resulting value. Promises have 3 states: pending, rejected, or fulfilled. Promises in JS also supply a .then() method. .catch() can also be used for error handling.

What are strong parameters?

parameters which requires us to tell Rails exactly which parameters are allowed into our controller actions; they are used to deal with the problem of mass-assignment attack; called in the controller with .permit.

How can you reverse a rails generate?

rails destroy <model, controller, or whatever>

How would you prevent a component from rendering in React?

return null from the render method.

What is event bubbling and how can it be prevented?

the concept in which an event triggers at the deepest possible element, and triggers on parent elements in nesting order. As a result, when clicking on a child element one may exhibit the handler of the parent activating. One way to prevent event bubbling is using event.stopPropagation() or event.cancelBubble on IE < 9.

What is the difference between var and let?

var is scoped to the neatest function block and let is scoped to the nearest block. let was added by ES6 standards. Let also does not make the variable accessible before it is declared; it is also not hoisted to outer scope.

What are some Capybara commands?

visit click_link click_button fill_in choose check uncheck select attach_file

How do you set an image as draggable in html5?

<img draggable="true">

What is Bootstrap?

A Web design framework that provides ready-made css, and javascript components to create responsive web sites.

What is the difference between authentication and authorization?

Authentication is the process of ascertaining that somebody really is who he claims to be. Authorization refers to rules that determine who is allowed to do what.

What are some disadvantage of OOP?

OOP requires larger program sizes (all else being equal) and reduces the speed of the program.

What are some language features of JavaScript?

Object Oriented language; Client Side language that can also be used server side; Interpreter based; scripting language of the WWW; Used principally to act on the DOM server-side; inheritance is prototype oriented.

What is an object in OOP?

Objects are instance of classes. It is a basic unit of a system. An object is an entity that has attributes, behavior, and identity. Attributes and behavior of an object are defined by the class definition.

What is the difference between a presentational component and a container component?

Presentational components are concerned with how things look. They generally receive data and callbacks exclusively via props. These components rarely have their own state, but when they do it generally concerns UI state, as opposed to data state. Container components are more concerned with how things work. These components provide the data and behavior to presentational or other container components. They call Flux actions and provide these as callbacks to the presentational components. They are also often stateful as they serve as data sources.

How does React work?

React creates a virtual DOM. When state changes in a component it firstly runs a "diffing" algorithm, which identifies what has changed in the virtual DOM. The second step is reconciliation, where it updates the DOM with the results of diff.

What is the starting point of code execution in jQuery?

The starting point of jQuery code execution is $(document).ready() function which is executed when DOM is loaded.

What is ES6?

Version 6 of the ECMAscript standards. Introduced let, const, arrow functions, default function parameters, and classes.

What is metaprogramming?

Ways a program has knowledge of itself or can change itself. Code that operates on code rather than data. The writing of programs that write or manipulate other programs.

What is w3c?

World Wide Web Consortium; international organization that maintains standards for the world wide web.

How do you select element by id using jQuery?

$('#idName') with # for ids.

What are some elements that provide better structuring in html5?

<article> - This element allows to specify an article. <aside> - It allows to view content other than the page content. <bdi> - It lets a part of text getting formatted in a different direction from other text. <command> - It displays a button element which processes a command upon user action. <details> - It adds additional details that a user can show or hide. <dialog> - It initializes a dialog box or popup window. <figure> - This element can show illustrations, diagrams, photos, and code listings. <figcaption> - It adds a caption for the image specified by a <figure> element. <footer> - This tag appends a footer to a document. <header> - This tag inserts a header into a document. <hgroup> - If a page includes multiple headings, then this tag groups them into a set of <h1> to <h6> elements.

What is the difference between an element and component in React?

A React element is an object representation of some UI (it describes what you want to see on the screen). A React component is a function or a class which optionally accepts input and returns a React element (typically via JSX which gets transpiled to a createElement invocation).

What is the difference between a pull request and a branch?

A branch is just a separate version of the code. A pull request is when someone take the repository, makes their own branch, does some changes, then tries to merge that branch in (put their changes in the other person's code repository).

What is jQuery?

A library of JavaScript functions which make coding interactive web behaviors easier than plain JavaScript

What is CORS and how do you enable one?

A request for a resource (like an image or a font) outside of the origin is known as a cross-origin request. CORS (cross-origin resource sharing) manages cross-origin requests. CORS allows servers to specify who (i.e., which origins) can access the assets on the server, among many other things. Access-Control-Allow-Origin is an HTTP header that defines which foreign origins are allowed to access the content of pages on your domain via scripts using methods such as XMLHttpRequest. For example, if your server provides both a website and an API intended for XMLHttpRequest access on a remote websites, only the API resources should return the Access-Control-Allow-Origin header. Failure to do so will allow foreign origins to read the contents of any page on your origin.

What are the four principles of object oriented programming?

Abstraction, Encapsulation, Inheritance, Polymorphism

What is an API?

An application programming interface (API) allows application developers to bypass traditional web pages and interact directly with the underlying service through function calls. Web APIs respond with raw data not meant for rendering a user experience.

What is an intrusion detection system?

An intrusion detection system (IDS) is a device or software application that monitors a network or systems for malicious activity or policy violations. Intrusion detection check following: Possible attacks Any abnormal activity Auditing the system data Analysis of different collected data etc.

What is Cross Site Scripting (XSS)?

Cross-site scripting (XSS) - Injects scripts into web application server to direct attacks at unsuspecting clients (Cross-site scripting attacks occur when attacker takes advantage of web applications that accept user input without validation and then present back to user For example: Input that the user enters for Name is not verified Instead is automatically added to a code segment that becomes part of an automated response An attacker can use this vulnerability in XSS attack by tricking valid website into feeding malicious script to another user's web browser to execute

What were some of the goals of html5?

Deliver rich content (graphics, movies, etc.) without the need for additional plugins, such as Flash. Provide better semantic support for web page structure through new structural element tags. Provide a stricter parsing standard to simplify error handling, ensure more consistent cross-browser behaviour, and simplify compatibility with documents written to older standards. Provide better cross-platform support whether running on a PC, Tablet, or Smartphone.

What is Sass?

Sass or Syntactically Awesome StyleSheets is a CSS preprocessor that adds power and elegance to the basic language. It allows you to use variables, nested rules, mixins, inline imports, and more, all with a fully CSS-compatible syntax. Sass helps keep large stylesheets well-organized, and get small stylesheets up and running quickly.

What is the difference between props and state?

The state is a data structure that starts with a default value when a Component mounts. It may be mutated across time, mostly as a result of user events. Props (short for properties) are a Component's configuration. They are received from above and immutable as far as the Component receiving them is concerned. A Component cannot change its props, but it is responsible for putting together the props of its child Components. Props do not have to just be data - callback functions may be passed in as props.

What are the three main ways to apply CSS to a web page?

With an inline style attribute of an element, with a style block in the head section of the html, and with an external link using the link tag.

Where in a React component should you make an AJAX request?

componentDidMount is where an AJAX request should be made in a React component. This method will be executed when the component "mounts" (is added to the DOM) for the first time. This method is only executed once during the component's life. Importantly, you can't guarantee the AJAX request will have resolved before the component mounts. If it doesn't, that would mean that you'd be trying to setState on an unmounted component, which would not work. Making your AJAX request in componentDidMount will guarantee that there's a component to update.


Conjuntos de estudio relacionados

Chapter 17: Bites and stings (HW/STUDY QUESTIONS)

View Set

Unit 4 test study guide 12 edition

View Set

Principles of marketing Ch 2, 17, 18, 20

View Set

International Business Ch. 7 w/ Kevin Zhao

View Set

Chapter 19: Electric Charges, Forces, and Fields

View Set

Homework: 2.2 Organizing Quantitative Data and Skewness

View Set

Structure of Healthcare Enterprises

View Set

ATI CHAPTER 5 MENINGITIS - MEDICAL SURGICAL NURSING

View Set

Chapter 4 States of Consciousness

View Set