Revature Super Study Guide

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

What is 'state', in the context of a component?

Data that is managed within the component

Pillars of OOP

Abstraction, Polymorphism, Encapsulation, and Inheritance

Is SQL considered a procedural, declarative, or functional language?

Declarative

Who made React?

Facebook

What are the three high level steps in the React component lifecycle?

mount, update, unmount

What sort of joins exist in SQL?

-INNER JOIN -OUTER JOIN -LEFT JOIN -RIGHT JOIN -CROSS JOIN -SELF JOIN

What are the advantages of abstraction

-It reduces the complexity of viewing the things -Avoids code duplication and increases reusability. -Helps to increase security of an application or program as only important details are provided to the user.

What are the two rules for creating React components?

1. Start naming with a capital letter. 2. Return either JSX/TSX that has one root tage

What are the normal forms, and to what level do we usually comply to?

1st, 2nd, 3rd (3rd is what we want to normally comply to)

What port does a React app's development server spin up on by default?

3000

What is the difference between a Statement and a PreparedStatement?

A Statement is subject to SQL Injection, PreparedStatement provides better performance than Statement object because of pre-compilation of SQL query on the database server. When you use a PreparedStatement, the query is compiled the first time but after that it is cached at the database server, making subsequent runs faster.

What is the difference between a union and a join?

A UNION will not have repeated rows whereas a FULL JOIN would

What is multiplicity?

A multiplicity is made up of a lower and an upper cardinality. A cardinality is how many elements are in a set. Thus, a multiplicity tells you the minimum and maximum allowed members of the set.

What is a natural key?

A natural key is a primary key that is made from real data EX a book ISBN, a business Tax ID

What is a phantom-read? What isolation level(s) resolve this phenonmenon?

A phantom read occurs when, in the course of a transaction, new rows are added or removed by another transaction to the records being read. Serializable

What is a primary key?

A primary key is a field in a table which uniquely identifies each row/record in a database table.

What is a relational database?

A relational database is a type of database that stores and provides access to data points that are related to one another.

What is a self-join? Provide an example of when you might use one

A self JOIN is a regular join, but the table is joined with itself.

What is a subquery?

A subquery is a SELECT statement nested inside another statement such as SELECT, INSERT, UPDATE, or DELETE

What is a transaction?

A transaction is a sequence of operations performed (using one or more SQL statements) on a database as a single logical unit of work

What is ad hoc polymorphism?

Ad hoc polymorphism is a kind of polymorphism in which polymorphic functions can be applied to arguments of different types, because a polymorhic function can denote a number of distinct and potentially heterogeneous implementations depending on the type of argument(s) to which it is applied. It is also known as function overloading or operator overloading.

What are the advantages of using polymorphism

Adds flexibility to the program by allowing a single method to perform different actions.

What is a result set?

An SQL result set is a set of rows from a database, as well as metadata about the query such as the column names, and the types and sizes of each column.

What are some alternatives to using React?

Angular

What is the syntax used for interpolating values into JSX/TSX?

Any valid JS

What is the file name of the default root component in a React app?

App.tsx or App.jsx

What is ACID?

Atomicity, Consistency, Isolation, Durability

Define Encapsulation

Better control of class attributes and methods. Class attributes can be made read-only (if you only use the get method, or write-only (if you only use the set method) Flexible: the programmer can change one part of the code without affecting other parts. Increased security of data.

Under what circumstances can two result sets be unioned?

Both query result sets must have the same number of columns and have compatible data type

What keywords are associated with DDL?

CREATE, ALTER, DROP

When would you use a CallableStatement?

CallableStatement interface is used to called the stored procedures and functions.

What are the naming conventions to adhere to when creating React components?

Camel casing starting with the components functionality, followed by the word component

What is the difference between class-based inheritance and prototypal inheritance?

Classical Inheritance: -Classes are immutable. You can't modify or add new methods to them at runtime. -Classes may or may not support multiple inheritance. -It's verbose and complicated. You have abstract classes, final classes, interfaces, etc. Prototypal Inheritance: - Prototypes are flexible. They may be either mutable or immutable. -Objects can inherit from multiple prototypes. -It's simple. You only have objects and extending objects is the only operation required.

Describe Interface Segregation Principle

Clients should not be forced to implement unnecessary methods which they will not use

What is the general purpose of files found within the `remote` directory?

Contains the api clients and their respective indexes

What are the advantages of Encapsulation:

Data Hiding: The user will have no idea about the inner implementation of the class. It will not be visible to the user that how the class is storing values in the variables. It is only known that we are passing the values to a setter method and variables are getting initialized with that value. Increased Flexibility: We can make the variables of the class as read-only or write-only depending on our requirement. If we wish to make the variables as read-only then we have to omit the setter methods like setName(), setAge() etc. from the above program or if we wish to make the variables as write-only then we have to omit the get methods like getName(), getAge() etc. from the above program. Reusability: Encapsulation also improves the re-usability and easy to change with new requirements. Testing code is easy: Encapsulation code is easy to test for unit testing.

What are the sub-languages of SQL?

Data Manipulation Language DML, Data Definition Language DDL, Data Control Language DCL, Data Query Language DQL, Transaction Control Language TCL

In 'React.Component<any, any>', what does the '<any,any>' represent?

Defining the type of props and state passed into the component respectively, in this instance any type of props or state

Describe Dependency Inversion Principle

Depend on abstractions, not on concretions

Describe Liskov's Substitution Principle

Derived types must be completely substitutable for their base types

What is normalization?

Designing a DB in such a way to eliminate data redundancy as much as possible

What are some different inheritance strategies?

Dynamic Polymorphism or Runtime Polymorphism (Method Overriding) - a derived class is implementing a method of its super class. The class to override the method is resolved at runtime.

What is JSX/TSX? How is it different from HTML?

Extensions to JS/TS, they combine formatting and logic with loose coupling through components, single parent tag with nested tag and otherwise won't compile, camel casing to represent HTML elements that are reserved for JS

What keywords are associated with DCL?

GRANT, REVOKE

What keywords are associated with DML?

INSERT, DELETE, UPDATE

Under what circumstances should you "not" include a constructor in a component class?

If you aren't maintaining any state or binding event handlers in the component, if values are set to the state by pulling from the API

Describe the general structure of a React app.

Inside src directory should be split into actionMappers, components, reducers, and remote

Why should we use React instead of vanilla JS?

It is easier to create and render complex views

Define Inheritance

It is the process where one object acquires the properties of another. With the use of inheritance the information is made manageable in a hierarchical order.

Define Polymorphism

It is useful for code reusability: reuse attributes and methods of and existing class when you create a new class.

Describe the advantage of inheritance

It is useful for code reusability: reuse of attributes and methods of an existing class when you create a new class.

Are DML statements in JDBC automatically committed? Is this a problem?

JDBC is automatically set to auto commit, iut can be but it depends on the needs of the application.

What is JDBC?

Java Database Connectivity, it allows the programmer to connect and interact with the database.

Is React considered to be a library or a framework?

Library

Explain how you would connect your Java application to a database using JDBC

Load Driver Create Connection Create Statement Execute the Query Close the Connection

Describe the Single Responsibility Principal

One class should have one and only one reasonability

Name some common RDBMS platforms/vendors

MySQL, Oracle, Microsoft Access

Can you have more than one root JSX/TSX element returned from a component's render method?

No, there can only be one

What is a non-repeatable read? What isolation level(s) resolve this penonmenon?

Non Repeatable read occurs when a transaction reads the same row twice, and get a different value each time. Repeatable_read

Describe the characteristics of the object-oriented paradigm

Object- Oriented Programming is a paradigm that provides many concepts, such as inheritance, data binding, polymorphism, etc Advantages of OOP over Procedure-oreitned programming language: 1)OOP makes development and maintenance easier, whereas, in a procedure-oriented programming language, it is not easy to manage if code grows as project size increases. 2)OOP provides data hiding, whereas, in a procedure-oriented programming language, global data can be accessed from anywhere. 3)OOP provides the ability to simulate real-world event much more effectively. We can provide the solution of real world problem if we are using the Object-Oriented Programming language.

What is parametric polymorphism?

Parametric polymorphism is a way to make a language more expressive, while still maintain full static type-safety. Using parametric polymorphism, a function or a data type can be written generically so that it can handle values identically without depending on their type. Such functions and data types are called generic functions and generic datatypes respectively and form the basis of generic programming.

How could you bind the click event of a button within a React component to some method?

Pass the function through onClick and in the function include prevent default

Describe the difference between 'props' and 'state'

Props are immutable and should be passed to the child component, state is mutable, should not be accessed by child components, managed by the view controller

What argument must be provided to the constructor of a component class?

Props, when overriding pass props to the super constructor

What is a dirty-read? What isolation level(s) resolve this penonmenon?

Querying uncommitted data, Read_committed

What are the arguments passed to 'ReactDOM.render()'?

React element and the container

What must the 'render()' method return?

React elements, arrays and fragments, portal, strings and numbers, booleans or null

What is React?

React is a library for rendering JavaScript. It uses JSX which is pure javascript that resembles HTML.

What object will all custom React component classes exted?

React.Component

What is sub-type polymorphism?

Replacing the supertype's instance with a subtype's instance. This is called inclusion polymorphism or subtype polymorphism.

What keywords are associated with TCL?

SAVEPOINT, ROLLBACK, COMMIT

What keywords are associated with DQL?

SELECT

What is SQL Injection?

SQL Injection usually occurs when you ask a user for input, like their username/userid, and instead of a name/id, the user gives you an SQL statement that you will unknowingly run on your database.

What is the difference between a scalar and an aggregate function?

Scalar Functions that do operations on a single value EX. datetime, conversion, string functions, mathmatical functions Aggregate Functions that do operations on all the values on a single column and return a single value. EX. MIN, MAX, COUNT, AVG, TOP

How can you select all of the entries in a table including all columns?

Select *;

What are the core classes and interfaces found in the JDBC API?

Session, SessionFactory, Connection, Date, Driver, ResultSet

What does the SOLID stand for?

Single Responsibility Open/Closed Liskov Substitution Interface Segregation Dependency Inversion

Describe the Open Closed Principle

Software components should be open for extension, but closed for modification

What are some different types of polymorphism?

Static poly morphism or compilation polymorphism(Method Overloading) - many methods having the same name but different signatures, where the signature can differ by the number of parameters or the type of parameters. Invoked at compilation.

What is SQL?

Structured Query Language; an international standard language for processing a database

What is the DRY Principle

The "Don't Repeat Yourself" (DRY) principle is about reducing the repetition of code. You should extract out the codes that are common for the application, and place them at a a single place and reuse them instead of repeating it.

What is the purpose of the GROUP BY clause?

The GROUP BY clause is used to group the results of a SELECT query based on one or more columns

How can you sort the entries in your result set by a particular column?

The SQL ORDER BY keyword

What is a WHERE clause used for?

The WHERE clause is used to filter records. The WHERE clause is used to extract only those records that fulfill a specified condition.

What is referential integrity?

The main concept of REFERENTIAL INTEGRITY is that it does not allow to add any record in a table that contains the foreign key unless the reference table containing a corresponding primary key

What is a foreign key?

This is a column in one table that points to the primary key in another table.

What are 'props', in the context of a component?

Thought of as functional parameters, they're data passed to the component

Define abstraction

To achieve security- hide certain deteails and only show the important details of an object.

What are the transaction isolation levels?

Uncommitted Read (also called "dirty read"), Committed Read, Repeatable Read, and Serializable

Why does React use a Virtual DOM, rather than the regular DOM?

Using the virtual DOM is faster because it doesn't rebuild the entire DOM, render method creates a node tree from components and they're only updated with data mutations caused by actions

What is a surrogate key?

When a primary key is generated at runtime, EX. when using a trigger to create an ID

What is a composite key?

When two or more columns make up a primary key

Do we use JS or TS when creating a React app?

You can use either, but it is important to be uniform and consistent throughout your application. We have mostly used typescript in our experience

What are the methods invoked during the Unmounting stage of the component lifecycle?

compnentWillUnmount

What are the methods invoked during the Mounting stage of the component lifecycle?

componentDidMount(), constructor, and render()

What are the methods invoked during the Updating stage of the component lifecycle?

componentDidUpdate(), render

What is a command used to start a React app?

npm start

What is the command to create a new React app?

npx create-react-app <name>

How would you create a React app based on TypeScript?

npx create-react-app <name> --template typescript

All React components declared using class syntax must contain what method?

render()


Ensembles d'études connexes

Hardware Security Modules for Government

View Set

Methodology in Cognitive Neuroscience

View Set

MD Life License Chapter 2: Life Insurance Basics

View Set

Chapter 7, 8, & 9, 10, 11, 12, 13, 14, 15, 16 Network Pro

View Set

PSYC 1 - Chapter 7: Thinking and Intelligence

View Set

2.CICLO DE VIDA Y SISTEMAS DE SOFTWARE

View Set