Interview Questions

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

write code to find the checkboxes on page that are checked. What different kinds of loops are there? Demonstrate 3 in JS.

$("#log").html($("input: checked").val()) see :checked in jquery in slack radio button: .val() checkbox: only use $(input:checked) to get the array 1) for(i = 0; i<10; i++){}; 2) while(){ }; 3) do {} while ();

write a selector that will select all elements witha class name of "findme" Write a selector that will find img elements within div elements that have a class name of "imgHolder" what si a modal window?

$(".findme") $("div.imgHolder img") find THE div that has imgHolder and go inside that div and find img tags div .imgHolder img: go find a div, then go inside and find imgHolder then go inside and find img modal window is an alert pop up window that can contain html and overlays the main page

How do you caputre the first time the html document is ready to be manipulated? Write out 2 different ways to accomplish this

$(document).ready(function(){ // do something }); $(document).ready(sabio.startup.layout) or name the function inside the .ready()

what is an "if" statement what is a switch/case statement how do you exit a loop before its normal loop cycle completes? Demonstrate:

'If' conditional statement that checks 1 or more conditions. swtich/case statement: in a switch statement there are multiple case values and depending on the situation you'll use one of those or none of them. it takes the place of an else if, if you have a bunch of else if, and you're testing one single value use break statement to stop it (break;) you can use "default:" if nothing else works Example: restration partial view and base controller for(i=0; i<10; i++){ if (i==5){ break; //break out of this loop and move on } }; you can use continue; to

How many layout files can a view be associated with at any one time? How many layout files can your application have? Can layout files be strongly typed as well?

1 at a time as many as you want yes, they should. Layout uses Base View Model. ViewBag: MVC uses data to pass in between without being strongly typed, but it's not good practice.

What is the difference between JSON and XML?

1) Serialization and types: converting objects into a type of string that can be sent to a system. You'd use it to translate data from one system to another into a language that the system will understand. JSON: javascript objects notation, { key: value; } url-encoding: $form.serialize (from browser to chipin.dev?key:value&key? XML serialization: extensible mark-up language: it's a long mark-up and a lot more verbose. JSON serialization: before RESTful pattern became popular, people would use XML JSON 40k vs XML is 70k JSON is more lightweight and easier to read, so it's cheaper to send data, since you're paying for bandwidth

5 steps of software development life-cycle (SDLC)

1) id a need 2) design solution 3) develop solution 4) test solution 5) deploy solution

where can you define where an html form sends its data? describe all ways is there a way that you can cancel the action of a submit button? what is the default action of a Submit button vs a regular button?

1) js service file with ajax calls 2) sending form without js: default behavior in browser for all forms, that will send data (post) to server through a submit button, through an attribute "action" attribute inside html (inside a tag). used in webforms. cancel add prevent default with jQuery, ore create another button with a specific fx to cancel the default action of a submit button is to submit, while regular button doesn't do anyting until defined.

String Concatenation in C#: 2 main approaches

1) plus sign: string animal = "dog" + "cat"; C# stores a memory for each variable (i.e. dog), then copies it to store another (dog, cat). Use it only when you know how many strings you'll concatenate and limited size 2) StringBuilder C# optimizes storage by creating memory space one time until you call the function EX: create a new instance new StringBuilder(){ stringBuilder.add("dog"); stringBuilder.add("cat");} .ToString();

What are some fundamentals that a developer should consider when they're working to wire up model binding correctly?

1) proper naming 2) requirements from client: business rules 3) type: most important when determining which rule to use

If you were to encounter a "resource not found" error 404

404 error: check your routes,

What are the basic elements that exists in all HTML pages between the start and close <html> tags?

<head><body> elements (like a human being)

What are the new HTML5 elements what is docType what are 3 new form elements of html5?

<video> <article> <figure> <nav> <section>see slack post it's used at the top of the html doctument. <!DOCTYPE html>, which tells the browser which type of html it's used. W3C <datalist> <keygen> <output>

what is the difference between == and ===? what are some out of the box ways to style text differently in HTML?

== 0 will be set to false, it only checks the value === strict, exact value and type html tools: <h1> - <h6> <em> italics <strong>

Web Service XML Simple Object Access Protocol (SOAP)

A Web service enables this communication by using a combination of open protocols and standards, chiefly XML, SOAP and WSDL. A Web service uses XML to tag data, SOAP to transfer a message and finally WSDL to describe the availability of services. The Simple Object Access Protocol or SOAP is a protocol for sending and receiving messages between applications without confronting interoperability issues (interoperability meaning the platform that a Web service is running on becomes irrelevant). Another protocol that has a similar function is HTTP. It is used to access Web pages or to surf the Net. HTTP ensures that you do not have to worry about what kind of Web server -- whether Apache or IIS or any other -- serves you the pages you are viewing or whether the pages you view were created in ASP.NET or HTML.

ASP.net

Active Server Pages (ASP) Microsoft's first server-side script engine for dynamically generated web pages. 3 ways: 1) ASP.NET Web Forms: uses controls and an event-model for component-based development 2) ASP.NET MVC focus on separation of concers and easier test-driven development, more maintainable and scaleable 3) ASP.NET Web Pages: single page model that mixes code and HTML markup

What are the differences between an API controller and "regular" controller in the .net MVC

Api controller contains the methods that routes the data to the database. It returns data from the server serialized as JSON. (tug boats) Brings data. View controller serves HTML. (ocean liner) what client sees Both have routes, take requests, authorize annotations.

10. "What questions do you have for me?"

At the end of every job interview, you'll likely be asked if you have any questions. At this stage, ask open-ended questions about office culture and those that clarify the role. Also ask about next steps in the hiring process and the employer's timeline for getting back to you. Avoid questions about benefits and pay; hold those for once you have an offer. Here are some of the best questions you can ask at an interview.

Authorization?

Authorization is allowing only people we want can access it. happens at controller level We use annotations [] to implement this attributes: routing, authorizing

When creating a new controller, what class do you inherit from

Base Controller, and Base API Controller built by Sabio, it extends Controller (at the top of the chain), which is built from

CSS attribute clear used for? see bootstrap doc What's the difference between the CSS attributes display and visibility How do you change the color of a font in CSS? How would you fade in an element? (see CSS3)

Bootstrap uses float a lot to achieve the grid used to remove content from one or both sides for display display: none (element is there, but it does not take up space) visibility: hidden (element will be there, but hidden, white space or whatever is behind) p{ color: white; } transition from one class to another .animate jquery: .fadeIn(), .fadeOut() NG: ng-animate

What is data normalization? Why would we go through the process of normalizing our data? How many normal forms are there?

DRY principle applied to db, make sure that same fields are not in multiple tables. Ensure that fields are not repeated in different tables. Reduce data redundancy normalized data by moving address into a different table and simply using foreign key Mostly maintainability and performance issures are solved by using normalization 3 normal forms: look it up

What is a database? relational database? database "table"?

Database is a software that gives you persistent storage for your data. NoSQL Relational db have information in multiple tables that are connected with other tables by specific keys. SQL and Oracle are relational db NoSQL, Reddit, Surge are not relational Table are a collection of data stored in a form.

If you want to delete info from a table what statement would you use? What is the truncate statement? Main difference between delete * and truncate?

Delete from trucate statement is used to clear the table from all of the data. delete from will delete the rows, but will keep the identity specs. truncate resets the identity specs back to one.

3. "Why are you thinking about leaving your job?" Or: "Why did you leave your last job?"

Don't discuss conflicts with your manager or co-workers, complain about your work or badmouth employers. Job seekers are commonly advised to say they're seeking new challenges, but that only works if you're specific about those new challenges and how this job will provide them in a way your last job didn't. It's also fine to cite things like a recent or planned move, financial instability at your organization or other reasons that are true.

Write the same add function in C# Describe the main differences or considerations between the 2 languages.

Example of polymorphism: (no static) public int calculation { public int sum(int a, int b) { return this.Sum (a, b, 0); //the 3rd parameter is optional, so you just put a 0// }; public int sum(int a, int b, int c) { return a+b+c; };} Main difference: c# is an objected oriented language and compiled language. we can use polymorphism b/c it's a strongly typed language js: we'd have to write a logic by creating an if statement

2. "What interests you about this job?"

Focus on the substance of the role and how it interests you. Don't talk about benefits, salary, the short commute or anything else unrelated to the day-to-day work you'd be doing, or you'll signal that you're not particularly enthusiastic about the work itself. Interviewers want to hire people who have carefully considered whether this is a job they'd be glad to do every day, and that means focusing on the work itself — not what the job can do for you.

If you want to visualize the changes you have made to a file in comparison to the last change, what would you do? how do you include a javascript file into your web page? how do you make sure you include this file on all web pages?

Go to team explorer, and check against the server version put it in script tags put it in layout page

"Tell me about a time when ..."

Good interviewers will ask about times you had to exercise the skills required for the job. These may be situations when you had to take initiative, deal with a difficult customer or solve a problem for a client. Prepare for these questions so you're not struggling to think of real examples. Brainstorm the skills you'll likely need in the job and what challenges you'll likely face. Then think about examples from past work that show you can meet those needs. When constructing your answer, discuss the challenge you faced, how you responded and the outcome you achieved.

what online resources do you use? what is responsive design? what are the pros and cons of this technique? what are CSS media queries?

Google, Stackoverflow, w3schools, Bootstrap jQuery and Angularjs.org libraries, Firebug Responsive design: when you make it interactive for mobile and other size screen. pros: for more consistent user experience in different platforms, google recently changed their algorithm that gives responsive design more weigh cons: takes time to build in different sizes CSS Media queries: @media helps you define when you want to set your custom breakpoint, for what the view will look like at different sizes.

Describe the relationship between HTML, CSS, and JS

HTML is the mark-up that allows the browser to generate the content. CSS is the styling that the page uses JS controls the behavior and interface and can manipulate the data.

What is HTML

Hypertext mark-up language that marks-up of a webpage

What do you use to debug C#? How do you start a debug session/ are there multiple ways? What are breakpoints?

I would use breakpoints in Visual Studio working in conjunction with IIS to debug C# by first putting breakpoints, then run IIS, back at the view run the action, step through code. yes, press play or run debug Breakpoints are places you stop and inspect the elements.

What is inheritance?

Inheritance is extending a class, where a child class will inherit all of the properties from the parent class, plus on what it's on its own class 1 of 4 object oriented principle

Basic parts of a simple TSQL Query(stored proc) when are joins used?

Input parameters declare variable other procs within that as begin statement end Joins are used when you want to retrieve data in other tables that relate to the table you're currently using.

IDE

Integrated development environment: software app that consists of a source code editor, compiler,built automation tools and a debugger

7. "What would you do in your first 90 days in this position?"

Interviewers are looking for answers that reveal how you set goals and solve problems, and whether you're ambitious without being unrealistic. You should also acknowledge that you'll need to take time to get to know the team, what's working and what can be improved before you make any big decisions — but your answer should still get into specifics to a reasonable extent.

"What do you know about our company so far?"

Interviewers don't want you to simply regurgitate facts about the company; they're probing to see if you have a general sense of what it's all about. What makes the company different from its competition? What is it known for? Has it been in the news lately? If it looks like you haven't done this basic research, your interviewer will likely wonder how interested you really are and whether you even understand what the company does.

8. "What's most important to you in a new position?"

Interviewers want to understand your career goals and whether this job will fulfill them. After all, if you're looking for a job with lots of public contact and a highly collaborative culture, and this job is mostly solo work, it might not be the right fit for you. It's in your best interest to be candid and specific when you answer this so you land in a job that aligns with what will make you happiest.

What is jQuery?

It's a JS library that is not required to build HTML pages, but it's not necessarily required ot build interactivity in your webpage. It makes it easier.

what are interfaces? What is an abstract class and is this different than an interface? Can you create an instance of an abstract class?

It's a blueprint for a class that is essentially a list of functions. Abstract class is a class give syou the ability to list a fx, it differs in that an abstract class can have code as well as list them. abstract can implement code No, you can't create an instance of an abstract class. (no new BasicUser()) concrete class: a class that inherites the abstract class and can impletement it.

AJAX bene

It's an Asynchronous Javascript And XML It allows us to Use it when you want to access the database from the JS, it can go both ways. We'd use it bc it allows you to update information while being int he same view, without having to change the page

What is a Null Reference Exception?

It's an error that you'tre referencing null 404:not found 200: ok

9. "What salary range are you looking for?"

Job seekers are almost always asked this question, but they often fail to prepare for it and are caught off guard when it comes up. If you wing your answer, you risk lowballing yourself and ending up with a salary offer below what you might have received otherwise. It's crucial to research the market rate for the job ahead of time. Don't let discomfort with talking about money thwart your ability to negotiate well for yourself.

What is the generic name of the library that is used in .Net that is used to communicate with databases? What are the >net objects and classes used to communicate and execute commands at the database?

Library's name is ADO.NET, provided in the System.Data package. ADO.NET provides access to Sql server and it provides ODBC DataProvider (reference to the AdO library, it knows how to talk to the db)is the main one, GetConnection (actual connection to the db), name of the proc., inputParamMapper and map fx. DataProvider.ExecuteNonQry for writes(put, post) DataProvider.ExecuteCmd is used for reads(get) for insert: also include return fx. SqlParameter, ParamCollection,

How do you find duplicate names in a list of Names? ***IMPORTANT What is the best way to concatenate strings in .NET?

List class is wrapping this up. Not able to do with this code if not a list ***IMPORTANT var duplicateKeys = list.GroupBy(x => x) .Where(group => group.Count() > 1) .Select(group => group.Key); class called StringBuilder: optimized for dealing with string + computer sets apart space to code

What does it mean to be an .NET mvc APPLICATION Does .Net support other types of WEb Applications: Yes, there are other types of .Net Web. Example: WebForms, an alternative to Rest Api

MVC has model view controller. It contains a library called ASP.NET MVC 5 library that is open source. You need this library in order to make an MVC application. Model: provides structure for our data View: renders to the page Controller: provides logic for application, however I've found that in that structure. It's a good practice to move that business data logic has been abstracted (hide complexity) away into the service layer, so it's more clean, reusable, and scalable.

.NET Framework

Microsoft's software framework for building web applications: provides consistent object-oriented programming environment. 2 major components: common language runtime (CLR) and .Net Framework Class Library

What is Model Binding and why is it importnat in the context of API controllers

Model binding is the process that is the request procedure where MVC5 framework takes hte data from the request and passes it into the api controller and service. It's important bc it has our validation rules in the client side before it's sent to our database. RESTful api has to implement this model binding. turn it into an object that the framework understands. advantages of MVC5 framework WEB2.0 API allows the model to be bound. C# version model binding is automated.

View Model: 1) view model: base view model (passed from base controller into all of our views): inside it has a domain model (identity user). View model provides the structure for the entire system 2) request model 3) response model 4) domain model

Model that provides structure to our data that we can pass into our views Related to Response models in hte Api side , giving us structured data from the database into our view. View Model is like a response model but in the client side. It has to have an output ViewModel is a contract bt ctrl and view, so that view can show what's being passed into ctrlr since C# is a strongly typed language Domain model: main representation of your business object. Domain represents a row in the db.

What are namespaces and what are they used for? Are namespaces a client side or server side construct?

Namespaces are a way for developers to organize their code, organize different parts of the MVC, so model is organized into model namespace, controllers into controller namespace. Technically namespaces are required in the server side. C# requires it. On the client side, we use it because it's an easy way to organize JS. make our code maintainable.

why is this broken? <button id = "my button" value="click me">click me"</button> $("#mybutton").on("click", hideElement); var hideelement = function(){ $(this).hide(); }

Nullreference exception: var hideelement has not been declared. it's a local variable.

4 different types of http methods? When would you use these over the others? What are attribute routings?

Post, Put, Get, Delete Attribute routings are route prefix, route, type of request routings are mapped in controllers in api it can also include the types [Route "name", HttpGet]

what is a primary key? foreign key? how many of each can one table have?

Primary key is a field or set of fields that is unique for each record. Foreign key is a field in one table that allows you to access a primary key in another table. Primary key only one in one table, while foreign key as much as you want.

What are the principles of objected oriented programming? What is objected oriented programming?****IMPORTANT uSED IN jAVA, pHP(not typed, but has object oriented)

Programmer's ability to process objects. It's comprised of 4 main principles: 1. inheritance: when one class can extend from another and inherit its properties 2. polymorphism: a program's ability to process objects differently depending on data type or class. Example of the same function with multiple signatures. (Ex: class is shape, program allows for different area methods for circles, squares, etc. 3. encapsulation: a group of related properties or mtheods athat are treated as a single unit or object. It implements the desired level of abstraction. Uses access specifiers: private, public, protected (abstract the function in the service, which allows API controller to use it in one line) 4. abstraction: process of hiding the complexity, by encapsulating into a function. It allows making relevant information visible

Razor? Strongly typed view? How would you define your view as such?

Razor is a templating language used to markup HTML. It's MS's new version of templating language. View layer engine Strongly typed view: knows which class will be attached to it. View model is always attached ot it. Define it by putting the razor syntax at the top of the page as 1st line.

what is source control? what providers are you aware of? what does it mean to "checkin" code? what is a best practices protocol to follow for checkin in code

Source control: central repository where you can store the team's code TeamFoundationServer, Git, Foundation, Mercurial Github is the repository host and provider. Check in code makes the file from your local computer available to the rest of the team in the central repository. Best practices for checkin: shelve, get latest, resolve conflicts, rebuild, shelve, check the files that you're checkin in, write a descriptive comment shelve sets: unique for TFS, Git doesn't have it.

Describe the Request-Response Life Cycle of a typical request made by your browser In an MVC app, what inofrmation is used to route your request?

Starts at the browser, as the user makes an ajax call, sending a request model to the endpoint in the controller, which sends it to the db, which returns response model is the item, or items or error response, which standardizes the output. Domain model is mapped into the response model as it standardizes the output.

"Why would you excel at this job?"

This is your chance to make a case for why you'd shine in the job — and if you don't know the answer to that, it's unlikely your interviewer will figure it out either. Since this gets to the crux of the whole interview, you should have a strong answer prepared that points to your skills and track record of experience and ties those to the needs of the job.

What are Generics in .Net? Why are Generics so important? What is IEnumerable and what significance does it hold?

We used in item/items response models <T> Generics are used as placeholder for another class They're important bc it gives a greater functionality since this is a strongly typed language. If we didn't have generics, we'd have to come up with models for every type and list of type. IEnumerable: interface provided by the system (System.Linq), tells that the underlying type imprelements GetEnumerator. and it lets you loop through an array. implemented by the list class. IEnumerable tells you all the different things you can do with this list. the methods are in ienumerable, but it can be implemented in concrete classes. provided by c# READ MORE ABOUT IT

What does it mean to exercise "defensive programming"? What does your typical error handling code look like? What is the Web.Config? What do you use it for?

Write your code in a maintainable form (other coders can look at it and understand, with proper naming and comments) and error handling is th eprocess of using try/catch to handle errors in a graceful manner. When you make a call to Service from API, it'd be in a try/catch block, so that you'll have different ways to handle errors. The typical error handling code should be the try/catch. See RegisterApiController and copy code many classes extend exception (IdentityResultException is an example that we use from Owin Library) Web.Config: a file that deals with the application's configuration setting and it's used to specify certain settings without having to modify the whole code base. It can also be used to set up a different configuration (values and variables) per environment (development, qa, staging, etc)

How do you send email on the server? How do you know if your JQery selector found any matching elements?

You can set up your own email server. We use SendGrid, which is a 3rd party provider. MailChimp is another. .length jQuery selector outputs an array. if (div).length

Why should we hire you over someone with more experience?

You should hire me because

"Tell me about yourself." This means: "Give me a broad overview of who you are, professionally speaking, before we dive into specifics."

You should prepare about a one-minute answer that summarizes where you are in your career and what you're especially good at, with an emphasis on your most recent job. Keep your personal life out of it; your interviewer isn't asking to hear about your family, hobbies or where you grew up.

Decorate this class to the following specs: F/L Name should be at least 3 chars long and no more than 50. Age should be at least 18 years old.

[Required] [MinLength(3)] [MaxLength(50)] public string FirstName {get; set;} [Range(18,99)] public int Age {get; set;}

what are connection strings? what are the different parts of a connection string?

a common defined format string that lets you connect to database server See web.config: 1) hostnamet: datasource: hostname of server (url) 2) port: 008 3) database name: CO9 4) username 5) password

polymorphism

a function that has the same name and multiple functions of the same name with different arguments

What is Micro Templating? When and why would you use this technique?

a way of building your client side by building your ui where you have chunks of html that are bound with data. technique of pieces of html with placeholders for text with code that takes theose templates, combine with data and places on page. We used jQuery and Angular. Binds data and template on the client side.

Write out an example class diagram(a diagram showing how several classes are related) for a base person class employee class manager class robot class include an interface for "people", "robot", and one that can both implement include an example of an abstract method and an abstract class be sure to havean example of how you leverage inheritance

abstract can inherit from one abstract class interface can inherit from multiple classes see picture

how do you declare a variable in C# how do you declare a variable in TSQL what does it mean to be strongly typed language? advantage of strongly typed language?

advantages of strongly typed: maintainability and performance... also less errors,

what are arrays? declare an array in js and c# what are collections in .net

arrays are a group of items (objects, strings, integers) var objects = []; int[] integers; Collections are classes that wraps and extend the primitive data types like int[] or boolean or string

how many attributes can an html element have how many id attributes can an element have? in order to have an html form input send it's data to the server what should you be sure to do?

as many as you want 1 <input> should have the NAME attribute, otherwise it's ignored by jQuery and Angular. Youc an't access it, but it won't check or can create bugs

Write out the JSON object for the following contact object Bob Smith is 30 years old and has 2 direct reports. Sally Smith, 30 y/o and Jane Doe 34 y/o

contact = { "firstName": "Bob", "lastName": "Smith", "age":30, "reports": [{ "firstName": "Sally", "lastName": "Smith", "age": 30}, { "firstName": "Jane", "lastName": "Doe", "age":34}

How do you store Flags in an enum? What are the first 4 numeric values of a Enum like this?

enum: simple type of class used to enumerate certain options that are available see UserType.cs Member = 0, Merchant =1, Organization=2, Class that ties the value with a lable that can be read in c#

questions for me?

flexible work hours (early riser)

write a program that prints the numbers from 1 to 100. But for multiples of 3 print "fizz" instead of the number and for the multiples of 5 print "buzz". For numbers which are multiples of both three and 5 print "fizz buzz" js fx that will console.log out "Fizz Buzz" ***IMPORTANT***

for (i=1; i<=100; i++) { if (i%3==0 && i%5==0){ ///most specific check first console.log("Fizz Buzz"); else if (i%3==0){ console.log("Fizz"); } else if (i%5==0){ console.log("Buzz"); } else {i} }};

ASP.NET Web API (application programming interface)

framkework that makes it easy to build http services that reach a broad range of clients, browsers and mobile. Web API is ideal platform to build RESTful app on the .NET framework

Sql Injection Attack How do you protect yourself against these

front end: it results from a poorly written js code that allows you to enter in a ... that can be injected into your database and wipe it out. attacks your server. see link in sabio protect yourself by using an actual library to do the binding. we use squl procs and we use dataProvider . use concatenation to change this into a string in c#. inline sequel are bad. prevent it by using a library that binds all of the parameters. DataProvider and Execute Cmd. has logic to sanitize it from sql db any db driver library (Own or odbc library)

overloading method **do more research

functions with same name, but different type or number of arguments

Sql Server stored proc? What language is used to write store procedures? What language do you use to communicate with db?

fx that executes in sql. TSql Transactional Sql. inside stored proc between begin and end, it's one single transaction. Sql statements

how do you horizontally center a div on a page? how about vertically? what is an "em" tag?

horizontally: text-align: center, center block, put it in a container tag, bootstrap: offset-md-4 vertically: using margin: auto; em: emphasis to italicize yes, all require closing tags, but some have a separate closing tag <img/> <br/> not all tags require an id attribute: 1

what protocol is normally used in a "web request"? over what port number is a normal web request made to a webserver? Can you change this? If so, how do you accomplish this and where is this visible?

http: hypertexttransformprotocol Port 80: is the std. port that web servers listen to Yes, through a local server or IIS, which is your web server software. It's visible in your browser in the url. URL:port#

how can you test if an instance of an object implements a particular inteface? what is a static member or property in.net

if statement using keyword "is" member that belongs to a class itself not a particular instance of that class

void return type

if you don't want the function to return a value

how would you show a modal window in your web application? if your web page was taking too long to download, what would you do to try to determine what was taking so long?

in the html, use a class to open a modal window or JS to modal.open (allows you to build custom behavior) use the net tab inside the console and it shows you which resources are being loaded int he page and it tells you how long it takes for each element to download and you can tell which one is the slowest google's pagespeed and it helps you see what you can look at to fix

Where do you put your display or UI logic/business rules in an MVC application? are there any benefits?

in the view you'll put display business logic in the service we separate the display logic from the server code. Main benefit is maintainability.

What are the different types of statements available to you in TSQL? What are indexes?

insert, update, select, delete Index is a way of telling SQL that it's unique. Stores it in different ways so you can search quicker. Adding index can make the search quicker. primary key is one type of index. foreign key is one type of index uniqueIndex is one type fullTextIndex is used if you want to look up data with a search

what are regular expressions? when would you use these?

it's a list of characters that define a pattern code snippets

Http Headers? what do you use to debug JS? What do you look for when debugging JS?

key/value pairs, metadata about request Request headers: sent to the server along with request going to server Response headers: response server sends along with request . we can see these headers in firebug. Debug JS: dev tools in browser: firebug and Chrome dev tools ajax calls logged in the console, the actual data that is sent

what is lazy loading? Can you caputre the click event of a div element? should you wrap a div element in an anchor?

lazy loading is a pattern of programming, where you have a particular code....only load this particular code if the user is using at that moment. Angular has this, and it'll only load when needed on websites with a lot of images, there's image lazy loading yes, with ng-click, jquery no, div is a divider. anchor is a link. createa a div first, then put anchor inside th elink.

Different types of Joins? Examples:

left/right join, inner/outer join default: join is left join Select a.firstName, a.lastName, b.mediasId, b.mediaPath from dbo.users a left outer join Medias b on a.mediaId = b.id; left of the = (all will get pulled, emphasis is there) right outer join = (emphasizes the table from the right hand side and will filter out the ones without) inner:

what are c# extension methods?

methods that extend a class. Example: IDataReader (think GetSafe extension methods to do null checks) It augments the default behavior.

in .net how many classes can one class inherit from declare a variable in js: is variable declaration required in js?

one abstract class can inherit one class a class can implement multiple interfaces(128) my var = no

C#

programming language that is strongly typed, class-based or object-oriented, event-driven, task-driven, generic... dev by MS

Write a C# fx that accepts an array of integers, adds all the members and returns the result

public int sum (int [] intsToAdd){ int n = 0; for (i=0; i<=intsToAdd.length, i++){ n += intsToAdd[i]; } return n; };

3) Write out the .Net class for that Contact object above

public namespace Sabio.Web.Models.Request { public class Contact { [Required] public string FirstName {get; set;} [Required] public string LastName {get; set;} public int Age {get; set;} public List<Contact> Reports {get; set;}}}

what are the possible values for the position attr Explain the purpose of the following headers: cache-control, cookie, content-type

relative, absolute, fixed, initial, inherit, static relative: absolute: Request headers part of an AJAX call cache-control: control what is to be cached and what not: use that to speed up your website. You tell the browser what to cache and not to cookie: files saved in users computer, takes all the files in their local machine and sends to server content-type: the way the data is encoded for the request (common: form/urlencoded another: JSON) POST/PUT are automatically not cached refers to the way that html is encoding that data. (content-type: goes along with img from server)

Using JQuery syntax write out your typical Ajax request and discuss how each part is used.**IMPORTANT***

sabio.page.merchant.create = function(formData, onSuccess, on Error) { var url = "api/merchant"; var settings = { cache: false, // contentType: "application/x-www-form-urlencoded; charset=utf-8" //serialization format urlEncoding, data will be serialized into . (we could send this as a JSON object) data: formData datatype:"JSON" success: onSuccess error: onError type: "POST" }; $Ajax (url, settings); }

What does this selector do: $("img[src=^photos]") Write a selector that limits this search to a div whose id is "targetContainer" What is Bootstrap?

selecting all image tags that have the word photos in the url src. $("#targetContainer img[src=^photos]") //space between targetContainer and img tells to go inside targetContainer first and find images of photos another way: $("#targetContainer").find("img[src=^photos]") Bootstrap: html, css framework for responsive design

what is a html table used for? what are <hr/> What are <span> and when do you use it? How do you restart a website?

show data sets, when you create a table with fields <hr/> tags: horizontal rule, creates a horizontal line span tags: wraps elements, but are considered inline tags and are made to selecting a portion of a text withint a div to apply style or <h1>Stay<span style="color: white">frosty</span></h1> div tags: block element how to restart website: go to IIS, click on chipin.dev, right click, manage website/restart

how does the web server know who you are across different web requests

through cookies... it does not work if you were to switch out browsers in the middle of a session

what are cookies? how are they used? as a dev, where can you find the cookies you have per side/url? how does the browser manage cookies across all the sites you visit

tiny file saved in the user's computer, saving a special value sent from the server. commonly used to keep track of your session. every request that is sent by your computer has this cookie attached to it, so it knows who you are. GetCurrentUserId used this information found in the console. in machine, you can look in Privacy/ It's saved by domain. it saves a file in your system and it's organized by domain name.

what are Nullable types? how do you access the underlying value of a Nullable type? when would you use Nullable types?

type that can be null, if you don't necessarily have a value Nullable type: c# use ? if it's nullable Nullable column: database just like any other property since c# is a strongly typed language, add a null check with defensive code and make the application resilient if (blank = null) when you have a property and you may or may not have a value, use Nullable types to account for that

ul, ol: what is the difference can you change the orientation of either of these elements? yes, you can use the float rule How do you keep a div to display with a maximum height of 100px and hide all other content?

ul: unordered list ol: ordered list ul has bullet points(CSS can remove), ol has numbers(with CSS properties you can use letters) div{ maxHeight: 100px, overflow: hidden;} overflow: scroll (insserts scroll bar for that div)

Adjust the add fx from the previous answer to accept an optional 3rd parameter to throw an error if it's not passed at least 2 arguments. How do you access the arguments without using the parameters' names?

var Add = function (a, b, c) { if (arguments.length>2) { return (a+b+c); }else{ throw "you must pass 3 numbers" }; OR var Add = function (a, b, c) { if (typeof(b) != "undefined") {throw "error" } else{ alert(error) }; var function = function (x, y, z) { return x+y+z}; all js have arguments variable that is an array of everything passed into. arguments.length >2 execute else throw "need 3 parameters"; throw 500

Write out a JS fx that accepts 2 numbers and returns their sum.

var a =3; var b=2; var function = function(x, y){return x+y}; var sum = function(a,b);

What is a view in c#? relationship between a view an da model in a typical MVC application? what is a model?

view is the html that is given to browser to display (display layer) model is used to give structure to the data that is being passed ot the view. strongly type your view. it tells your view what type of data model is a class for storing

declare a new object in JavaScript how would you give this new obj a new prop how would you igive all instances of a JS "personObject" a new property

with a var keyword: var newObject = { properties }; newObject.newString = "hi"; Use prototypes in JS (similar to C#) function.person(first, last, age, eyecolor) { this.firstName = first; this.lastName = last; this.age = age; this.eyecolor = eyecolor; } var father = new person("joe", "doe", "30", "blue"); we use angular inheritance with base view and base controller

can a fx call itself when you encounter an error what are the steps you take to resolve the error?

yes check the conosle, try putting breakpoints in console or c#, add additional console log to isolate where errors are occurring. 404 errors: check the route, validation rules, 500: connection to the database, post: sending info to db and inserting get: selecting info from db http protocol specification: post, get, put, delete


संबंधित स्टडी सेट्स

XCEL Chapter 11 - Laws and Rules

View Set

Consumer and Personal Finance Chapter 16

View Set

Chapter 17: Assessment of Respiratory Function

View Set

Session 4: The Probationary License

View Set

Supply Chain Chapter 11 - Short Answer Test 2

View Set

Testing and Fixing Code Computer Lit

View Set