Laura's Questions Flashcards

1
Q

Difference between abstract class and interface

A

Both:define methods and properties
Abstract: can only extend to one class can have method bodies or properties Interface: implement as many as needed but cant have method bodies or fields

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Difference between stack and heap

A

Stack - not flexible and responsible for handling what you are executing in your code, memory management is LIFO, cheaper and faster than heap,
Heap - is dynamic memory allocation, keeps track of your objects, slower than stack

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Static Access Modifier

A

Static - attributes and methods belong to the class instead of the object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Difference between overriding and overloading

A

Overloading same method name with different parameters (better performance than overriding
Overriding - a subclass or child class to change function of a method that is already provided by a parent class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

difference between array and array list

A

Array - fixed length, collections of the same data type
Array List - can store different data types and is not a fixed length

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How are strings different from other data types

A

Strings are immutable so if if it needs changes it will need to be reassigned

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

*What is pass by reference?

A

Pass by value means to pass a copy of the variable to the method. Pass By Reference means passing access to the variable to the method. the variable of a reference type contains a reference to its data. Variable of a value type contains its data directly

A reference parameter is a reference to a memory location of a variable. When you pass parameters by reference, unlike value parameters, a new storage location is not created for these parameters. The reference parameters represent the same memory location as the actual parameters that are supplied to the method.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

*Singletons

A

creational design pattern that lets you develop one persistent instance throughout an application

ensures only one object of its kind exists and provides a single point of access to it,

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What different testing in software can you tell me about

A

Unit - test for small piece of code, like a method
Integration - units are integrated and tested together to confirm all parts are working cohesively
Functional - establishs whether each feature works per the software requirements/end user’s expectation
End-to-End - verifies the functionality and performance of an entire software application from start to finish simulating real-world user scenarios and replicating live data
Performance - determine stability, speed, scalability & responsiveness of applications
Test Driven Development - test cases are created before code is fully written

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

== vs .equals()

A

both compare objects on their equality but == comparison operator and .equals() method compares the contents of a string

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Key Principles of OOP

A

Inheiritance - parent/child classes, implicitly extends the object class (root of all classes) giving the same attributes and methods to the child class, car > civic and limo
Encapsulation - class is an example, bundles data and methods that work on data in one unit, SSN in bank transaction as needed
Polymorphism - One thing that can be many things, animal - makenoise/move cat vs dog
Abstraction - principle to some, similar to encapsulation, isolate the interface of a class from its implementation and focus on the interface

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

dependency injection

A

allows for inversion of control between classes and their dependencies, reduces tight coupling between software components

Client Class: The Client Class (dependent class) is a class that depends on the Service Class. That means the Client Class wants to use the Services (Methods) of the Service Class.
Service Class: The Service Class (dependency) is a class that provides the actual services to the client class.
Injector Class: The Injector Class is a class that injects the Service Class object into the Client Class.

It allows a programmer to remove hard coded dependencies so that the application becomes loosely coupled and extendable. design pattern that implements inversion of control using the dependencies from the class (interfaces of the classes in our case, the thing the program needs) to inject (or pass into) out class at runtime rather than creating a new one every time it runs. inverts control of the instantiation of dependencies from the class itself to the container. says that you don’t care how the two classes work together, you just put in what you need to make them both work since they sort of rely on each other, which promotes loose coupling, allows one path to retrieve data
client means your implementing component (class)
service(means your dependency/dependencies(another class)
interface means the interface that is used to bridge between your client and service
passing the service to the client rather than allowing a client to build or find the service is the fundamental requirement of the pattern. a client who wants to call some services should not have to know how to construct those services.
In ASP.NET Core you go into the startup file, tell it what interface you want to use and then the concrete implementation of it

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Difference between a value /primitive data type and a reference type

A

Reference types are too big to be saved on the stack so the variable doesn’t save the actual value, it saves the location of the value on the heap.
Value/Primitive types are saved directly on the stack

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

.NET vs C#

A

.NET - Framework, has a library of thousands of classes to be used right out of the box
C# - language built and run on .net framework, has specific syntax

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Common Classes we use in ADO.NET

A

Command - ExecuteReader() - returns data to client as rows and used for select
Execute Scalar - returns only a single value returns number of robes or calculated value
Execute Non Query - used for insert update and delete and returns number of rows affected
Data Reader class
Connection Class
Data Adaptor
Data set

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

ADO.NET

A

set of classes that expose data access services for .NET Framework devs (relational, XML and application), provides communication between the front end controls and back end database

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

internal access modifier

A

internal means it cant be accessed at all whether its though the class itself of an instantiation of it

18
Q

RestSharp

A

HTTP client library used to build and send rest requests and interpret responses client side

19
Q

ASP.NET

A

platform for building websites and services cross platform using mvc pattern, open source web application framework for building modern web applications and services, server side and what is used to build server

20
Q

What does REST stand for

A

REpresentational State Transfer

21
Q

Asynchronous communication and why do we need it?

A

technique that enables your program to start a potentially long-running task and still be able to be responsive to other events while that task runs, rather than having to wait until that task has finished

22
Q

What is RESTful API

A

architectural style for designing the interaction between client (user-facing) and server

23
Q

What are some status codes you know ?

A

200-OK
300 - multiple possible responses
400 - client errors
500 - server errors

24
Q

what is serialization

A

converting an object into a string representation like JSON

25
Q

what is deserialization?

A

converting the string representation of an object to an object

26
Q

what happens when I got to URL X in my browser what does the server do?

A

GET Request is sent from the browser
the Request goes to the the DNS, which is like an address book
The DNS tells the Request which IP Address to go to
The Request goes to the server/API at that IP Address
the Server/API runs the request method and returns a response
Response contains the HTML that displays in the webpage
so GET Request -> DNS -> IP Address -> Server/API -> Response sent back -> Browser displays

27
Q

JWT

A

JSON web token - standard way to share info between client and server securely, authentication token specific to one user

28
Q

what is top level domain

A

.com, .org, .net

29
Q

what is mvc and what does each part do?

A

It’s an architectural pattern that separates the application into 3 components, Model View Controller
Model being the data related logic that the user works with
View being the User Interface logic, contains text boxes, dropdowns, etc the user is able to interact with
Controller being the part that receives requests and manipulates the data using the model data and sending it to the view.

30
Q

how would you explain MVC to a non technical person

A

Controller - waiter, model - kitchen, view - food, lets us build scalable applications to be able to test easily, help bridge big gaps

31
Q

is the git version of control system client/ server, distributed, peer-to-peer or something different

A

distributed because your local copy of a git repo contains the full history of the repository instead of the latest revision meaning your repo can act as a standalone repository. Technically decentralized but most organizations use some kind of centralized solution to manage git

32
Q

common git commands and what do they do

A

add - adding code to staging area
commit - saving your code to your local repository, with a message of what changes you’ve made
pull - pulling peer’s changes into our local repository
push - pushing updates into remote repository

33
Q

Explain branching

A

Whenever you make changes to your repository it spawns a new branch to encapsulate your changes

34
Q

What is the purpose of semantic HTML

A

for accessibility and readability of a webpage, sectioning things off so they are easier to work with

35
Q

What can you tell me about specificity in CSS

A

Algorithm browsers use to determine what styling to apply to which element
- id is the most specific, will point to one specific tag
-class is next most specific, many elements can have any classes
-type (p, h1, etc)
-no value/ universal selectors (*)

36
Q

What is cardinality in SQL

A

cardinality refers to the uniqueness of data values contained in a particular column (attribute) of a database table, the lower the cardinality the more duplicated elements in a column. 1:1. 1:many. many:many

37
Q

what is sql injection and how do you protect against it

A

an attack on your database, need to write parameterized queries with bound typed parameters

38
Q

similariteies between primary and foreign keys

A

Primary is used to ensure uniqueness between rows of data (protects referential integrity)
Foreign Key - used to relate data between tables

39
Q

purpose of database normalization

A

to prevent data duplication

40
Q

what is a left outerjoin?

A

pulls all data from the left table and all matching data from the right even if there is no match

41
Q

*When designing a query against a relational database, is it better to try to hit the clustered index or non clustered index

A

clustered index (sorts and stores data rows in table based on their key values) is better because its faster and more efficient especially if your are querying frequently because it doesn’t require additional disk space

42
Q

access modifier

A

Access modifier is used to set the access level and visibility for classes, fields methods and properties
Public - property or method can be accessed from everywhere (default)
Protected - can be accessed within the class and classes derived from that class
Private - can only be accessed within the class