CIS 4339 Exam Review

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

What are advantages of MongoDB

- easy to scale up or down - uses a dynamic db schema - supports primary/secondary index on any fields

What is the purpose of v-for directive?

Allows us to loop through items in an array or object.

What is the MongoDB Shell?

An environment used for interacting with MongoDB deployments to test queries and operations with your database.

What is a document in MongoDB

An ordered set of keys with associated values.

What is the most loved language of a full stack developer and why?

Any that can be used to design the front end and backend like HTML, CSS, Python, and JS.

In VUEJS's basic app folder structure, what two files lie inside the src directory?

App.vue and Index.js

What's the output? async function getData() { return await Promise.resolve('I made it!'); } const data = getData(); console.log(data); A: "I made it!" B: Promise {<resolved>: "I made it!"} C: Promise {<pending>} D: undefined`

C: Promise {<pending>}

What is CORS?

Cross Origin Resource Sharing, it is used to gain authority of different web resources on different domains.

What is the REST request structure?

HTTP method, an endpoint, headers, body

What is the axios library used for in web application development?

It is a javascript library used to make http requests. It allows APIs to communicate between webpages and app environments like node.js.

Difference between SQL and NoSQL in terms of language?

SQL restricts the user to working within a predefined tabular schema, while NoSQL lacks the standard interface SQL provides.

Difference between SQL and NoSQL in terms of Scalability?

SQL scales vertically by increasing the processing power of existing hardware. NoSQL scales horizontally by using additional servers or nodes.

What are directives in Vue.js?

Special token in the markup that tells the library to do something to a DOM element.

Describe the difference for SQL vs. NOSQL in terms of Properties?

They comply with separate rules for resolving transactions. SQL must exhibit four ACID properties, while nosql adheres to properties of the cap theorem.

How to add data in MongoDB

Use the insert() method. db.books.insertOne({"title" : "Start With Why"})

What is a Git repository?

A git repository is an online storage location where git users can commit, push, and pull to the online repository. Multiple git users can use a repository with the right permissions and collaborate on a git repo to create a project.

What are databases in MongoDB

A group of collections.

What is a Collection in MongoDB

A group of documents

What is cross-site request forgery?

A hacker gets a victim's browser to make requests, with login credentials included without their knowledge.

What is the difference between a library and a framework?

A library is a set of helper fuctions/modules which your app code calls for a specific func. A framework is a open unimplemented function that the developer uses to create a custom app.

What is DevOps

A newly emerging practice that focuses on delivering software products faster and lowering the failure rate of releases between software devs and IT pros.

What is Callback Hell?

When multiple asynch functions are chained together leading to hard to read code.

When to use MongoDB?

When you are building internet and business applications that need to evolve quickly and scale to high levels.

How to perform queries (search/read) in MongoDB? Please name the command and explain some details on how to use it.

You can use the find() method to read a row in mongodb.

Describe the following VUEJS Basic App folder structure

1 - App.vue This is typically the root of your application defined in Vue Component file format. It's usually something that defines the template for your page. 2 - main.js This is usually the JavaScript file that will initialise this root component into a element on your page. It is also responsible for setting up plugins and 3rd party components you may want to use in your app. 3 - router folder may contain the index.js file which contains all the router configurations. 4 - views folder contains components that are related to differnt views 5 - contains all other components (*.vue files) 6 - the assets folder contains images, css etc. that are used by components

//???????? var mongoose = require('mongoose'); //???????? mongoose.connect('mongodb://localhost:27017/mongodb'); //??????? var userSchema = mongoose.Schema({ name: String, //?????????? username: { type: String, required: true, unique: true }, //???????? p password: { type: String, required: true }, admin: Boolean, location: String, created_at: Date //??????? }); //??????? var User = mongoose.model('User', userSchema); //?????? var userDetails = new User({ name: 'Test user',username:'testuser',password:'test12@',location:'mohali' }); userDetails.save(function (err) {if (err) console.log ('Error on save!')}); console.log(userDetails);

1. //include the js library 2.//establish database connection 3.//Create schema 4.//create User Object 5.//Save User details in database

How to make a component in VUEJS?

By inserting it into the .vue files or single file components.

Mention what happens when an application takes user inserted data and sends it to a web browser without proper validation and escaping?

Cross site scripting happens when an application takes user inserted data and sends it to a web browser without proper validation and escaping.

Fullstack: A backend generally includes a server that communicates with a ___________ to serve requests

Database

Name a few git commands and their function

Git add - Add one or more files to the staging area Git init - Initialize an empty git repository

Describe the differences between git and GitHub.

GitHub serves as a cloud location for uploading copies of a Git repository. Git is a command-line tool that is installed locally on the system.

Name 3 out of the List Top 10 OWASP Vulnerabilities

Injection Cross site scripting Failure to restrict

What are the Common defenses against XSS?

Input Validation and Output Validation with putting concentration on upcoming things.

What is the --save option for npm install?

It installs the modules and updates package.json automatically.

What are the lifecycle methods of VueJS?

Lifecycle hooks are a window into how the library works behind the scenes.

Pros and cons of promise?

Pro: Promise can solve callback hell, which enhances readability. Con: Unable to cancel promise and errors need to be captured by callback function.

What is asynchronous programming?

Programming that doesn't wait on an order of execution to start its process. It allows tasks to run concurrently within an app.

What is a Rest API?

Provides the platform to allow apps talk to each other. REST specifies how data is presented to a client.

Which software-development methodology would be best if an organization needed to develop a software tool for a small group of users in the marketing department? Why?

RAD is a fast software development approach ideal for smaller projects. It emphasizes creating a working model quickly and allows user feedback during development.

Describe the difference for SQL vs. NOSQL in terms of Structure?

SQL db schemata represent relational, tabular data, with rules about consistency and integrity. NoSQL doesn't stick to this format and can hold semi-structured data.

Describe the difference for SQL vs. NOSQL in terms of Support and communities?

SQL dbs represent massive communities, stable codebases, and proven standards. NoSQL are smaller communities and more fractured that benefit from open systems.

What is the Bootstrap toolkit used for?

The bootstrap toolkit is for implementing css styling from its library on a webpage.

NodeJS backend: How can we utilize environment variables in NodeJS? Name a packge and explain how to use it.

The dotenv package is used for environment variables by creating an .env file with key value pairs and accessing them using process.env.

What is the NodeJS Event Loop

The event loop waits for tasks, executes them and then sleeps until it is called upon again. It executes them in a queue of events that also uses callbacks and promises.

What does the git push command do?

The git push command is used to push content from a local repo to a remote repo.

What is likely causing the following error? npm ERR! enoent ENOENT, open 'C:\vueproject\package.json' npm ERR! enoent This is most likely not a problem with npm itself npm ERR! enoent and is related to npm not being able to find a file. npm ERR! enoent npm ERR! Please include the following file with any support request: npm ERR! C:\vueproject\npm-debug.log

There is an error with package.json and the issue with that is there is no JSON file in the vueproject directory that matches with package.json. Either it doesn't exist or it's called differently.

How can you share code between files in NodeJs?

You export variables and functions by attaching them to the module.exports object.

VUEJS: What is an SFC?

A Single File Component. Usually the file type is .vue.

What is Cross-site scripting?

A client-side code injection problem. An attacker getting a victim's browser to run script content like Javascript within their browser.

What is a Collection in MongoDB?

A collection in MongoDB is like a table in an RDMS that allows documents with varying fields and with no strict schema at the collection level.

What is the difference between package.json and package-lock.json in a Node project?

package.json is a config file that contains the scripts and commands like npm or start. package-lock.json is automatically configured to store each specified version of each dependency in the project.

Fullstack: Front-end is the part of a web application that users can _____ .

see and interact with.

Fullstack: Backend refers to the _______-side of an application

server

What are directives in Vue.js? List 2 examples and explain what they are used for.

v-if conditionally shows or hides elements based on a condition, like displaying a button when a user is logged in. v-bind dynamically links HTML attributes or properties to data values, allowing for dynamic updates, such as converting a string to a number for calculations.

RestAPI: Name 2 key differences between GET and POST?

GET is used for retrieving data from a server, while POST is used for sending data to a server for processing or storage. GET parameters are included in the URL, making them visible and limited in size, whereas POST sends data in the request body, allowing for larger and more secure data transmission.

What is mongoose in node js?

mongoose is an object modeling package for Node that works like an ORM.

How to call a rest API from VUE JS?

npm install axios --save

How to install mongoose in node js?

npm install mongoose

Fullstack: Front-end refers to the _________-side of an application

Client

What are the major features of VueJS?

Components: Creates resuable custom elements in VueJs Apps Templates: Provides HTML based templates that bind the DOM with the Vue instance.

What are the conditional directives?

1. V-IF : The v-if directive adds or removes DOM elements based on the given expression. 2. V-Else: Displays content only when the expression adjacent v-if resolves to false. 3. V-else-if: This directive is used when we need more than two options to be checked. 4. V-show: This directive is similar to v-if but it renders all elements to the DOM

Explain the difference between embedding and referencing (linking) for MongoDB data modeling

Embedding is storing doc as children inside a parent document. Referenced doc are stored in a separate collection to their own parent doc.

How to defend against CSRF?

Ensuring that GET requests are side-effect free, and ensuring that non-GET requests can only be originated from your client-side code.

What is the vue instance?

Every Vue application works by creating a new Vue instance with the Vue function.

Give an example each for when you would use methods versus computed props in VUJS. Use the examples to explain the difference.

Methods typically change the application depending on the purpose of the function. They react to events triggered by users. For example, using a button for a user to say "yes" or "no" Computed properties are used for manipulating and processing data for display, you can use timestamps to format a date or time.

MongoDB: Explain the difference between using mongoose and the native MongoDB driver/connector?

Mongoose adds schemma-based data modeling and validation while the native driver allows for schema-free interactions with the db.

What are the latest trends in Full Stack Web Development?

More implementation of Vue JS, real-time web apps, progressive apps, and mobile web development.

Name 2 key differences between MySQL and MongoDB.

MySQL is a RDMS that uses structured tables with predefined schemas, while MongoDB is a NoSQL database that stores data in flexible, schema-less documents. MySQL uses SQL for querying data, while MongoDB uses a JSON-like query language for flexible and unstructured data retrieval.

What Is Node.js?

Node.js is a runtime environment that allows users to run JavaScript code on the server to build network applications.

List and explain 2 Pros/Cons each for NoSQL vs. SQL

Nosql offers scalability and flexible schemas but it lacks ACID compliance and is a learning curve for devs. SQL provides ACID compliance and structured data but is limited in scalability and requires a ridge schema.

What are Basic data types in MongoDB?

Null, boolean, and String.

Explain the differences between one-way data flow and two-way data binding?

One way data flow does not update the UI part automatically. Two way data flow automatically updates when data model is changed.

Name differences between the VUESJ Options and Composition API.

Options API is easier to start with as its centered around the concept of a component instance. Composition API is makes code much cleaner and easy to manage as its centered around declaring reactive state variables directly in a function's scope.

What is OWASP?

an organization which supports secure software development.

Fullstack: Backend constitutes everything that happens _________ the scene.

behind

What is the difference between dependencies and devDependencies in package.json?

dependencies are modules your project depends on, devDependencies are modules you use to develop your project.

Fullstack: HTML, CSS, and_____________ are some of the essentials of frontend development.

javascript


Kaugnay na mga set ng pag-aaral

Case study - convolutional neural networks (CNNs)

View Set

Essay Question 14 - Number and Function of Cranial Nerves

View Set

Java Chapter 11: Exceptions and Advanced File I/O

View Set