Technical Interview Questions

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

What is TCP?

Transmission Control Protocol: is more reliable than UDP

Describe what happens when a browser requests a web page.

1. You type a URL in your browser and press Enter 2. Browser looks up IP address for the domain 3. Browser initiates TCP connection with the server 4. Browser sends the HTTP request to the server 5. Server processes request and sends back a response 6. Browser renders the content

What is a block level element?

A Block-level element occupies the entire horizontal space of its parent element (container), and vertical space equal to the height of its contents, thereby creating a "block".

Explain the relationship between a class and an object.

A class is like a blueprint for creating objects and it provides initial values for state and implementations of behavior. An object is an in-memory data structure that combines state and behavior into a usable abstraction, and only exist as instances or members of a class.

Explain the difference between a primary key and a foreign key in a relational database.

A primary key ensures data in the specific column is unique, while a foreign key is a column or group of columns that provides a link between data in two tables. A foreign key will usually reference the primary key of another table.

How does a reference datatype differ from a primitive?

A primitive datatype stores actual values, while a reference datatype stores the addresses of the objects they belong to in heap memory.

What is the Query String?

A query string is the portion of a URL where data is passed to a web application and/or back-end database. The reason we need query strings is that the HTTP protocol is stateless by design. For a website to be anything more than a brochure, you need to maintain state (store data).

What's an abstract class and how does it differ from an interface?

An abstract class is a class that cannot be instantiated. Abstract classes are used to provide a template for future specific classes, and helps you to define a common interface for its subclasses. Abstract classes should be used when various implementations of the same kind share a common behavior. Abstract classes differ from interfaces in that an abstract class can provide implementations for its methods, while an interface cannot. All of an interface's methods are public, while an abstract class can declare methods with any access modifier. Lastly, a class can only inherit one abstract class, but can inherit many interfaces.

Explain Client/Server

Client-server denotes a relationship between cooperating programs in an application, composed of clients initiating requests for services and servers providing that function or service.

What is encapsulation?

Encapsulation refers to the bundling of data with the methods that operate on that data, or the restricting of direct access to some of an object's components. So for example, let's say you have a class called 'Account' with private member variables like accountNumber and accountBalance. Because of encapsulation, the only way for another class to access the data in the private member variables is to use public getters and setters, which are defined in the 'Account' class.

Give an example when you've used inheritance in a past project.

For one of my exercises, I had an application that would calculate how many gallons you needed to paint a wall. The application could do calculations for rectangular walls, square walls, and triangular walls, based on the dimensions that the customer would provide. In that application, I had a Rectangle Wall class, a Triangle Wall class, and a Square Wall class that all inherited from the abstract class Wall. All of the subclasses had the color attribute that was super-ed in from the parent class. All of the subclasses also had to override the getArea method, which calculated the area of the Wall, and provide unique implementations for how to calculate the area of the wall based on what type of wall it was.

What is the difference between POST and GET?

GET retrieves a representation of the specified resource. POST is for writing data, to be processed to the identified resource.

What is the difference between HTML, CSS, and JavaScript?

HTML provides the basic structure of sites, which is enhanced and modified by other technologies like CSS and JavaScript. CSS is used to control presentation, formatting, and layout. JavaScript is used to control the behavior of different elements.

Why is HTTP stateless?

HTTP is called a stateless protocol because each request is executed independently, without any knowledge of the requests that were executed before it, which means once the transaction ends the connection between the browser and the server is also lost.

What is a request header?

Headers contain information about the request, such as the format of data sent or expected, whether to cache information, and authentication information.

Interfaces vs Superclasses - be prepared to describe both and why you would use each.

If you only want to inherit method signatures (name, arguments, return type) in the subclasses, use an interface, but if you also want to inherit implementation code, use a superclass.

What is inheritance?

Inheritance is the act of having one class adopt the properties and methods of another class. Inheritance prevents code duplication by allowing you to share code across classes while having the source code live in only one class file. Inheritance is important in programming due to code reusability. So for example, let's say you have a class called 'Clock', and it has attributes like 'int hour', 'int minute' and 'int second'. If you created another class called CuckooClock that extended the class 'Clock', you could call the super method in the constructor for your CuckooClock to avoid having to re-write attributes like 'hour', 'minute', and 'second', because the two classes would have a is-a relationship.

What is MVC? What does each part represent?

MVC is a design model or software architecture containing 3 interconnected verticals or portions. The model contains data associated with the application, and is also where data validation attributes are specified. The View is the user interface of an MVC application. The Controller contains the code that handles endpoint requests and resource requests. We use the MVC design pattern for clarity of work. So large teams of developers can easily divide and organize the code, and can easily find portions of code. Using the MVC also simplifies the testing process.

What is polymorphism?

Polymorphism is the ability of an object to take on many forms. Any Java object that can pass more than one IS-A test is considered to be polymorphic. This means any child class object can take any form of a class in its parent hierarchy and of course itself as well. So basically, the child class object can be assigned to any class reference in its parent hierarchy, as well as itself. So let's say for example, you have a class called Animal, and that class has a method called 'make noise', where it prints out "Sound"Then you have another class called Cat that extends from the class Animal, with the same 'make noise' method, but instead of printing "Sound" it prints "Meow" Then you create an object of either type Animal or Cat, the make noise method will print a different message to the console.

What is Serialization?

Serialization is the process of converting an object into a stream of data, usually JSON format.

What is DNS?

The Domain Name System is like a phonebook for websites. It translates readable domain names to readable IP addresses.

What is the difference between POST and PUT

The difference between POST and PUT is that PUT requests are idempotent. That is, calling the same PUT request multiple times will always produce the same result. In contrast, calling a POST request repeatedly have side effects of creating the same resource multiple times.

What are the key principles of Object-Oriented Programming?

The key principles are abstraction, encapsulation, polymorphism, and inheritance.

What is the Message Body?

The message body is an optional part of the HTTP message that carries data, which is also known as the payload. In an HTTP request the body is usually included if the HTTP request is a POST request. In HTTP responses, the body usually contains a status code.

What is the difference between overriding and overloading a method?

The most basic difference is that overloading is being done in the same class, while for overriding base and child classes are required. Method overriding involves giving a specific implementation to the inherited method. Method overloading involves changing the signature of the method so it takes a different number of arguments or different data types.

Explain to me the most interesting program you've worked on

The most interesting program I have worked on so far is my second Capstone Project, where I built a RESTful API that allowed users to transfer money between themselves, and utilized a PostgreSQL database to store information about the users.

What is the difference between HTTP and HTTPS?

The only difference between the two protocols is that HTTPS uses TLS (SSL) to encrypt normal HTTP requests and responses. As a result, HTTPS is far more secure than HTTP.

Walk me through how you validate that your code works as expected?

To validate that code works as expected, I would create tests using the JUnit framework. First, I would create a test class with several test methods. Each method should create an object and contain at least one assertion, which would compare the result of my code against an expected value.

What is a top-level domain?

Top-level domain (TLD) refers to the last segment of a domain name, or the part that follows immediately after the "dot" symbol.

What is TLS?

Transport Layer Security

What does it mean for a request to be stateless?

When a request is stateless, it means every request happens in complete isolation, so it includes all information necessary for the server to fulfill the request (such as authentication), and the server does not assume any two requests are related/never relies on information from previous requests.

What is the difference between a for and for-each loop? Why use one over the other?

With a for loop, you can start and end in any direction, while a for-each loop can only move forward from the first item. With a for loop, you can retrieve every item, or every other item, or every third item, while a for-each loop retrieves every item. With a for loop, you have access to the index, and thusly can know what position you are in in the collection, while with a for-each loop you don't have access to the index. You would use a for-each loop over a for loop of the iteration order is not important.

Abstract classes - be prepared to define what they are and when to use them, also why you might choose an abstract class over an interface/superclass combination

You would use an abstract class if you needed a template for future classes, and would never need to instantiate the abstract class. You would choose an interface/superclass combination if you at some point needed to instantiate the superclass.

What are the parts of a URL?

protocol domain name path


Conjuntos de estudio relacionados

Langenscheidt Grund- und Aufbauwortschatz Englisch

View Set

Med. Terminology Week 11 Chapter 14/15 Questions

View Set

Ch. 2 Financial Markets & Interest Rates

View Set

Chapter 5 PART 2 Objective Questions

View Set