all questions

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

" State vs Behavior

States refer to features of an object, and more than likely fields. They differ from behaviors, or methods, the latter describing actions that an entity can take.

What are the data types in Java? (8)

byte - 8 bits, short - 16 bits, int - 32 bits, long - 64 bits, float - 32 bits, double - 64 bits, char - 16, boolean - 1*

What is Encapsulation?

data hiding.

What are the types of Constructors?

default, no-args, parameterized (with args)

What does the keyword "static" mean?

execute first, belongs to class, not instance

Which are the scopes of a variable?

"-static/class -> accessible anywhere in the class -instance -> variable specific to an instance -method scope -> only accessible w/in a method -block scope -> ex. in a loop. For example using a for loop the int it can only be used in the loop not anywhere outside

" TreeSet vs HashSet?

"1) HashSet gives better performance (faster) than TreeSet for the operations like add, remove, contains, size etc. HashSet offers constant time cost while TreeSet offers log(n) time cost for such operations. 2) HashSet does not maintain any order of elements while TreeSet elements are sorted in ascending order by default.

" LinkedList vs ArrayList

"1) LinkedList uses double linked list to store elements while ArrayList uses dynamic array to store elements. 2) Manipulating(inserting/removing) elements of a LinkedList is faster than ArrayList because ArrayList requires shifting of elements in memory. 3) LinkedList is faster for manipulating, ArrayList is faster for storing and accessing data.

What is the difference between a List and a Set?

"1) List maintains insertion order, Set doesn't 2) List allows duplicates, Set does not 3) List allows null values, Set only allows one

" What is Multithreading? How do you do it?

"A multi-threaded program contains two or more threads that can run concurrently and each part can handle a different task at the same time making optimal use of the available resources

What is Abstraction?

"Abstraction is the concept associated with hiding the implementation details and providing just the functionality.

Difference between Exception and Error?

"An Error ""indicates serious problems that a reasonable application should not try to catch."" An Exception ""indicates conditions that a reasonable application might want to catch.""

" What is a List?

"An ordered collection. The user of this interface has precise control over where in the list each element is inserted. The user can access elements by their integer index, and search for elements in the list.

What are some types of exceptions?

"Arithmetic Exception - It is thrown when an exceptional condition has occurred in an arithmetic operation. ArrayIndexOutOfBoundException - It is thrown to indicate that an array has been accessed with an illegal index. The index is either negative or greater than or equal to the size of the array. ClassNotFoundException - This Exception is raised when we try to access a class whose definition is not found FileNotFoundException - This Exception is raised when a file is not accessible or does not open. IOException - It is thrown when an input-output operation failed or interrupted (cont ->)

" What is a Generic?

"Generics are a facility of generic programming. They are designed to extend Java's type system to allow a type or method to operate on objects of various types while providing compile-time type safety

HashTable vs HashMap

"Hashtable is synchronized, whereas HashMap is not. This makes HashMap better for non-threaded applications, as unsynchronized Objects typically perform better than synchronized ones. Hashtable does not allow null keys or values. HashMap allows one null key and any number of null values.

What is the Garbage Collector?

"It allows developers to create new objects without worrying explicitly about memory allocation and deallocation, because the garbage collector automatically reclaims memory for reuse. This enables faster development with less boilerplate code, while eliminating memory leaks and other memory-related problems. At least in theory. Ironically, Java garbage collection seems to work too well, creating and removing too many objects. Most memory-management issues are solved, but often at the cost of creating serious performance problems. Making garbage collection adaptable to all kinds of situations has led to a complex and hard-to-optimize system.

" Is Java 100% Object Oriented Programming? Why or why not?

"Java is not a pure Object Oriented Language, but is a so-called ""Hybrid"" language. For any language to be 100%, it must follow these 6 rules: 1) It must have full support for Encapsulation and Abstraction 2) It must support Inheritance 3) It must support Polymorphism 4) All predefined types must be Objects 5) All user defined types must be Objects 6) Lastly, all operations performed on objects must be only through methods exposed at the objects. Java supports 1, 2, 3, and 5, but fails to support 4 and 6.

" Can you override static methods?

"No, static methods are looked up at compile-time and overriding a method occurs during runtime

What is varargs?

"Simplifies the creation of methods that need to take a variable number of arguments. This feature is called varargs and it is short-form for variable-length arguments. A method that takes a variable number of arguments is a varargs method.

" JDK vs JRE vs JVM

"The Java Development Toolkit (JDK) is a software development environment used for developing Java applications and applets. It is a superset of the Java Runtime Environment (JRE) which provides the libraries, the Java Virtual Machine (JVM) and other components to run applets and applications written in Java. The JVM executes a computer program compiled into Java bytecode.

What are the types of Inheritance Models?

"* Table per heirarchy * Table per subclass * Table per concrete class

What is WSDL?

"- Web Service Definition Language. - It's a language agnostic XML document that defines the structure of our SOAP web service. - The WSDL is an XML-based lenguage for describing web services

" Annotations for Eureka

"@EnableEurekaServer - in Spring Driver @EnableDiscoveryClient

" What are common annotations associated with Kafka?

"@EnableKafka @KafkaListener(""{{topic}}"")

What are the annotations used in Web Services?

"@WebService @WebMethod @WebParam @WebResult

" What are Closures?

"An inner function that has access to the outer functions variables. Scope Chain

What are the Transaction Properties?

"Atomicity Consistency Isolation Durable

What is a Proxy?

"Classes functioning as an interface to something else. In the case of Hibernate, classes generated dynamically to help with lazy loading

What are the set operators?

"Conbine results of two queries into a single set ex. Union union all intersect minus

" What is CDN?

"Content Distribution Network - a way of importing angularJS files form the web: <script src=""<url>.js"" ></script>

" How do I enable/configure annotations?

"Enable annotation based bean configuration by including the ""context:annotation-config tag in the Spring XML based configuration file.

" What is IAM?

"Identity and Access Management- a web service that helps you securely control access to AWS resources. You use IAM to control who is authenticated (signed in) and authorized(has permissions) to use resources

" What is IaaS?

"Infrastructure as a Service. It takes care of the Virtualization, Storage, Networking and Servers.

" Inversion of Control

"Inversion of Control is a principle in software engineering by which the control of objects or portions of a program is transferred to a container or framework.

What is a HashSet?

"Java HashSet class is used to create a collection that uses a hash table for storage.

" What is a TreeSet?

"Java TreeSet class implements the Set interface that uses a tree for storage. The objects of TreeSet class are stored in ascending order.

" What is minification?

"Reducing source code down to the bare minimum representation -remove all whitespace,linebreaks,etc that do not serve function -remove all comments and unused code -reduce variable and method names, if possible, down to few characters (e.g. int a instead of int alpha)

What is TCP/IP?

"TCP/IP stands for Transmission Control Protocol/Internet Protocol, which is a set of networking protocols that allows two or more computers to communicate.

Explain Spring Boot

"Takes an opinionated view of building production-ready Spring applications. Spring Boot favors convention over configuration and is designed to get you up and running as quickly as possible.

" What is a Process?

"The ProcessBuilder.start() and Runtime.exec methods create a native process and return an instance of a subclass of Process that can be used to control the process and obtain information about it. The class Process provides methods for performing input from the process, performing output to the process, waiting for the process to complete, checking the exit status of the process, and destroying (killing) the process.

What is a RequestDispatcher?

"The RequestDispatcher interface provides the facility of dispatching the request to another resource it may be html, servlet or jsp.

" What is a SortedSet?

"The SortedSet interface extends Set and declares the behavior of a set sorted in an ascending order.

" What is the purpose of ZooKeeper?

"Used by Kafka as a data store (repository for persistent data) and in general it is used as an open-source server used for distributed system

" What is the lifecycle of a servlet?

"init method service method destroy method

What are template literals?

'string literals that allow ${embedded} values'

" What do you need to make a REST application into a RESTful service?

@RestController

What is a Database?

An organized collection of data.

what are the variable scopes

Class, Method, Block,

" Monolithic Application Diagram summary

Client <----> Controllers <----> Services <----> Repositories <----> Database

Functions vs Stored Procedures

Functions compute values and cannot perform changes to SQL DB, Stored procedures can also return 0 to multiple values, can't use SP in select/where/having statement

Which method does the garbage collector call?

System.gc(), belongs to System class

" What is mappedBy?

The mappedBy property is what we use to tell Hibernate which variable we are using to represent the parent class in our child class.

what is jdbc

a API that allows Java programs to access database management systems

" What is the CLI command to generate a component?

ng generate component <name>

Is JS case-sensititive?

" JavaScript is a case-sensitive language. This means that language keywords, variables, function names, and any other identifiers must always be typed with a consistent capitalization of letters. The while keyword, for example, must be typed "while", not "While" or "WHILE".

What is XSLT? (XSL + Transformations)

" XSLT stands for XSL Transformations XSLT is the most important part of XSL XSLT transforms an XML document into another XML document XSLT uses XPath to navigate in XML documents

What is a Singleton?

" The singleton pattern is a design pattern that restricts the instantiation of a class to one object. This class provides a way to access its only object which can be accessed directly without need to instantiate the object of the class.

How do you write servlet context and servlet config on the web.xml?

" <servlet> <servlet-name>controlServlet</servlet-name> <servlet-class>com.jenkov.butterfly.ControlServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>controlServlet</servlet-name> <url-pattern>*.html</url-pattern> </servlet-mapping>

" What is an Injectable?

" @Injectable decorator identifies services and other classes that are intended to be injected. It can also be used to configure a provider for those services.

InputStream vs Reader

" InputStreams are used to read bytes from a stream. So they are useful for binary data such as images, video and serialized objects. Readers on the other hand are character streams so they are best used to read character data

" SpringMVC Workflow

"(1) client sends HttpRequest to Server (2/3) our request is directed to our MasterServlet/DispatcherServlet (4) DispatcherServlet consults handler mapping to determine the appropriate controller to handle our request (5) controller handles the request andsends response back to DS (6/7) D.S. consults the view resolver( or doesnt ) and generates the appropriate view (8) view is returned to client

" Microservices vs SOA

"* SOA is more about orchastrating several enterprise applications * Microservices are mainly about decomposing a single application |-> our services are more choreographed vs orchastrated * orchastrated analogy: vehicular traffic patterns (lanes, rules, lights) * choreagraphy analogy: pedestrian traffic (autonomous, self-governed)

" Microservice Disadvantages

"* complexity is moved from the application layer to the ops layer * services may be unavailable * transactions are absent when data is spread across services * loss of ACID properties during transaction * Chatty

" Microservice Advantages

"* no single point of failure * easier to test individual service * easier to scale individual service * ability to use the proper language or framework for the job * ability to use a persistence model suited to the services data * data is more secure

"Microservice Application Diagram summary"

"* services can (optionally) get their config from the config server * all services must register w/ the discovery service * API Gateway consults the discover service to forward a request to the proper service

" How are web services and SOA related?

"- A web service is a basic building block in a SOA. - When multiple services are combined, we have an application that falls under SOA

" What is REST?

"- REpresentational State Transfer (REST) is an architectural style that defines a set of constraints and properties based on HTTP. Web Services that conform to the REST architectural style, or RESTful web services, provide interoperability between computer systems on the Internet. REST-compliant web services allow the requesting systems to access and manipulate textual representations of web resources by using a uniform and predefined set of stateless operations. - REST describes a set of architectural principles by which data is transfered over a standarized interface (such as HTTP).

" What is SOAP?

"- SOAP (originally Simple Object Access Protocol) is a messaging protocol specification for exchanging structured information in the implementation of web services in computer networks. Its purpose is to induce extensibility, neutrality and independence. It uses XML Information Set for its message format, and relies on application layer protocols, most often Hypertext Transfer Protocol (HTTP) or Simple Mail Transfer Protocol (SMTP), for message negotiation and transmission. - SOAP is an XML-based protocol for accesing web services.

What is SOA?

"- Service Oriented Architecture - It's an architectural concept which focuses on having different services communicating with each other to carry out a bigger job. - Services have simple well-defined interfaces. - Promotes loose coupling. - Services are black-box

" What are some benefits to using REST?

"-REST allows a greater variety of data formats, whereas SOAP only allows XML. -Coupled with JSON (which typically works better with data and offers faster parsing), REST is generally considered easier to work with. -Thanks to JSON, REST offers better support for browser clients. -REST provides superior performance, particularly through caching for information that's not altered and not dynamic. -It is the protocol used most often for major services such as Yahoo, Ebay, Amazon, and even Google. -REST is generally faster and uses less bandwidth. It's also easier to integrate with existing websites with no need to refactor site infrastructure. This enables developers to work faster rather than spend time rewriting a site from scratch. Instead, they can simply add additional functionality.

What is contract first and contract last?

"-When WSDL is created first and then the application is then structured around the definition provided in the WSDL -application is created first and then our WSDL is generated based on our application code

" What is a messaging queue?

"-a queue of messages sent between applications -in a queue, a pool of consumers may read from a server and each record goes to one of them

" What is a Web Service?

"-a software that makes itself available over the internet -uses a standardized messaging system -typically used in B2B (Business to Business integration)

" Microservices Definition

"-an architectural style of developing applications and an alternative to the traditional "monolithic" applications -decomposition of a single system into a suite of small services: -each service runs on an independent process -inter-service communication is performed using standardized, open protocols

" Any disadvantage in using microservices?

"-complexity is moved from the application layer to the ops layer -services may be unavailable -transactions are absent when data is spread across services -loss of ACID properties during transaction -chatty

Main advantage of using Microservices?

"-no single point of failure -easier to test individual service -easier to scale individual service -ability to use the proper language or framework for the job -ability to use a persistence model suited to the services data -data is more secure

" Microservices Features

"-services are separately written, deployed, and maintained -services encapsulate business functionality(instead of a functionality being encapsulated using language constructs (classes, packages, etc.)) -services are independently replaceable + upgradeable

What are the Ready States in HTTP?

"0 - UNSENT 1 - OPENED 2 - HEADERS_RECEIVED 3 - LOADING 4 - DONE

" What is the AJAX workflow?

"1) Make XHR object 2) Define readystatechange function 3) open 4) send

" Bean Lifecycle

"1) request bean (ac.getBean(""name"")

What is the general flow of Hibernate to the RDBMS?

"1. Load the Hibernate configuration file and create configuration object. It will automatically load all hbm mapping files. 2. Create session factory from configuration object 3. Get one session from this session factory. 4. Create HQL query. 5. Execute query to get list containing Java objects.

What are the HTTP statuses?

"100s - Informational 200s - Success 300s - Redirection 400s - Client side errors 500s - Server side errors

HTTP Error codes: 200, 202, 204, 300, 400, 401, 403, 404, 415, 418, 420

"200- OK! Success 202 accepted 204 no content 300 Multiple choice 400- Bad Request - Invalid request 401- Unauthorized- missing/incorrect authentication credentials 403- Forbidden - Request is understood but its been refused, w/ explaining why 404 Not found 415 Unsupported Media Type 418 I'm a teapot 420 Enchance your calm- too many requests

" c) Configuration Server.

"<!-- Config Server: Configuration Service used to configure other services, registered to Eureka --> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-config-server</artifactId> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-eureka</artifactId> </dependency>

a) Eureka (Discovery).

"<!-- Eureka: Service registration and discovery --> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-eureka</artifactId> </dependency> <!-- Eureka Server --> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-eureka-server</artifactId> </dependency>

" b) Zuul (Gateway).

"<!-- Zuul: Gateway API Service used to access our services registered to Eureka --> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-zuul</artifactId> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-eureka</artifactId> </dependency>

What do elements and attributes need to be to achieve XHTML?

"<!DOCTYPE html> html, head, title, body inside the html tag it must specify xml namespace

" e) Hystrix (Monitoring).

"<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-hystrix</artifactId> </dependency>

" d) Kafka (Messaging).

"<dependency> <groupId>org.springframework.kafka</groupId> <artifactId>spring-kafka</artifactId> </dependency>

" What do you need to include in the hibernate.cfg.xml file?

"<hibernate-configuration> <session-factory> <property name=""some property""> some properties: hibernate.dialect - (what type of sql?) hibernate.connection.driver_class (what driver our DB uses) hibernate.connection.url (url of DB) hibernate.connection.username/hibernate.connection.password mapping resource=""Classname.hbm.xml""

" What do you need to include in the HBM?

"<hibernate-mapping> <class> -name -table -catalog <id> -name -type, and in it <column>, perhaps also <generator> any number of <property> -name -type, also requiring <column> <one-to-one>,<one-to-many>,<many-to-many>, or <many-to-one> -- should provide name,class, and cascade fields

What are some common tags?

"<html> <body> <link> <a> <h1> <p> <img>

" What tag do you use to create an image?

"<img> ex: <img src=""..."">

" What are the important tags you need to include within Context-Param and Init-Param

"<param-name> <param-value>

What tag would you use to create lists?

"<ul> or <ol> and <li> should be nested within for each item

" @Autowired vs @Inject vs @Resource

"@Autowired and @Inject Matches by Type Restricts by Qualifiers Matches by Name @Resource Matches by Name Matches by Type Restricts by Qualifiers (ignored if match is found by name)

" Difference between @BeforeClass and @Before?

"@BeforClass will run once before any of the test methods in the class. @Before runs before @Test

" SpringMVC Annotations

"@Controller @InitBinder @ModelAttribute @RequestMapping @RequestParam @SessionAttributes

" Annotations of Eureka and what they do.

"@EnableEurekaServer: start-ups a registry that other applications can talk to. (service) @EnableDiscoveryClient:uses the Spring Cloud DiscoveryClient abstraction to interrogate the registry for it's own host and port. (client)

" Annotations of Zuul and what they do.

"@EnableZuulProxy: turns the Gateway application into a reverse proxy that forwards relevant calls to other services.

Annotations of Hysterix and what they do?

"@HystrixCommand: wraps method in a proxy connected to a circuit breaker so that Hystrix can monitor it. @EnableCircuitBreaker: tells Spring Cloud that the application uses circuit breakers and to enable their monitoring, opening, and closing.

Annotations

"@Ignore, @Test, @After, @Before, @AfterClass, @BeforeClass

" Soap Annotations

"@WebService @WebMethod @WebResults @RequestWrapper @ResponseWrapper

" URL vs URI vs URN

"A URL is a URI that identifies a resource and also provides the means of locating the resource by describing the way to access it Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet

" What is a URI?

"A Uniform Resource Identifier (URI) is a string of characters designed for unambiguous identification of resources and extensibility via the URI scheme.

What is a callback function?

"A callback function, also known as a higher-order function, is a function that is passed to another function (let's call this other function "otherFunction") as a parameter, and the callback function is called (or executed) inside the otherFunction.

" What does it mean to be Layered?

"A client cannot ordinarily tell whether it is connected directly to the end server, or to an intermediary along the way. Intermediary servers may improve system scalability by enabling load-balancing and by providing shared caches. Layers may also enforce security policies.

What does it mean to be "Falsy"?

"A falsy value is a value that translates to false when evaluated in a Boolean context. Boolean, Null, Undefined, 0, NaN, Empty Strings

" What is a Sequence?

"A feature supported by some database systems to produce unique and automatically incrementing value on demand.

" What is a Provider?

"A provider is an instruction to the DI system on how to obtain a value for a dependency. Most of the time, these dependencies are services that you create and provide. e.g. providing a service or httpservice...

" What is a Schema?

"A schema is a collection of database objects associated with one particular database username.

" What is Elastic Beanstalk?

"A service used for deploying and scaling web applications and services developed with different languages. Elastic Beanstalk also handles the deployment, from capacity provisioning, load balancing, auto-scaling to application health monitoring

What are Tables?

"A table is a set of data elements using a model of vertical columns and horizontal rows, the cell being the unit where the two intersect.

" What is Normalization? What is it used for?

"A technique used to restructure an relational database (RDS) to reduce data redundnacy and promotes data integrity

" What is a Cursor?

"A tool that is used to iterate over a result set, or to loop through each row of a result set one row at a time.

What are Triggers? When can it execute?

"A trigger is a of stored procedure that automatically executes when an event occurs in the database server. Triggers execute when a user tries to modify data through a data manipulation language (DML) event.

" What is Docker Swarm?

"A way of creating multiple instances of docker container nodes with one queen image and many worker nodes, with all nodes as candidates to take the place of the queen, should the queen fall

What is a Pipe?

"A way to edit data. eg. changing a date format Pipes can be chained after the next.

What are actuators in Spring Boot?

"Actuator is a library that brings production-ready features to an application. The main benefit of it is that we can get production grade tools without having to actually implement these features ourselves.

" Autowiring. How to configure it?

"Add the context schema to your configuration XML and use the @Autowired annotation.

" How do you reload any changes in Spring Boot withou having to restart it?

"Add the dependency of spring-boot-devtools in pom.xml: <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <version>1.3.0.RELEASE</version> </dependency>

" What is AMI?

"Amazon Machine Image is a special type of virtyal appliance that is used to create a virtual machine within the EC2. It serves as the basic unit of deployment for services delivered using EC2

What is AWS?

"Amazon Web Services is a secure cloud services platform, offering compute power, database storage, content delivery and other functionality to help businesses sclase and grow.

" What is ANSI?

"American National Standards Institute- is a private, non-profit organization. that administers and coordinates the U.S. voluntary standards and conformity assessment system.

" What is ASCII?

"American Standard Code for Information Interchange- is a character encoding stadard for electronic communication

" What is an ERD?

"An Entitiy Relationship Diagram is a graphical representation of an information system that depicts the relationships among people, objects, places, concepts or events within that system.

What does it mean to be a Single Page Application?

"An application that creates or emulates the user experience of having one HTML page that updates in real time, as opposed to chaining redirects and refreshes to pages

" What is an Index?

"An index is a copy of selected columns of data from a table that can be searched very efficiently.

What is an index?

"An index is used to speed up the performance of queries. It does this by reducing the number of database data pages that have to be visited/scanned.

" What is an Observable?

"An object that provides support for passing messages between publishers and subscribers in an Angular application. methods: next (get a value), error (error), complete (complete) -an observable is used by SUBSCRIBING to an observable. in an assigment operation, you are usually doing .subscribe( aliasToNext => (do some crap with aliasToNext))

" What is a Webpack?

"An open source JavaScript module bundler. It takes modules with dependencies and generates static assets representing those modules.

" What are the Lifecycle Hooks?

"Angular keeps tabs on a component's lifecycle. NgOnInit() NgOnDestroy() NgOnChange() NgDoCheck() and many more..

" What is Code-On-Demand?

"Any technology that sends executable software code from a server computer to a client computer upon request from the client's software. Some well-known examples of the code on demand paradigm on the web are Java applets, Adobe's ActionScript language for the Flash player, and JavaScript.

" What are the types of ELB?

"Application Load Balancer - handles advanced traffic routing from other services or containers at the application level Computing - speads app or network traffic across EC2 instances

" What are the Data Structures in Java?

"Array Linked List Stack Queue Binary Tree Binary Search Tree Heap Hashing Graph Matrix

Array vs ArrayList

"Array is a fixed size data structure while ArrayList is not. Array can contain primitives and objects while ArrayList can only contain objects.

What is an ArrayList?

"ArrayList supports dynamic arrays that can grow as needed.

" What is AOP?

"Aspect-Oriented Programming (AOP) complements Object-Oriented Programming (OOP) by providing another way of thinking about program structure. The key unit of modularity in OOP is the class, whereas in AOP the unit of modularity is the aspect.

What is AJAX?

"Asynchronous JavaScript & XML: Update a web page without reloading the page Request data from a server - after the page has loaded Receive data from a server - after the page has loaded Send data to a server - in the background

What is resiliency?

"Basically the ability to quickly recover and continue to operate in the event of a disruptions

" ApplicationContext vs BeanFactory

"BeanFactory is older, lazily intantiates, and must be provided a resource object. Application Context is newer/includes more functionalities, eagerly intantiates, and creates and manages their own resource object.

" How do I create a bean in the container?

"Beans.xml <beans> <bean name=""beanA"" class=""com.example.bean.BeanA""> <property name=""beanB"" ref=""beanB""/> </bean> <bean name=""beanB"" class=""com.example.bean.BeanB""> </bean> </beans>

Advice Kinds

"Before: Advice that executes before a join point, but which does not have the ability to prevent execution flow proceeding to the join point (unless it throws an exception). After returning: Advice to be executed after a join point completes normally: for example, if a method returns without throwing an exception. After throwing: Advice to be executed if a method exits by throwing an exception. After: Advice to be executed regardless of the means by which a join point exits (normal or exceptional return). Around: Advice that surrounds a join point such as a method invocation. This is the most powerful kind of advice.

" What are some common decorators?

"Class decorators, e.g. @Component and @NgModule Property decorators for properties inside classes, e.g. @Input and @Output Method decorators for methods inside classes, e.g. @HostListener Parameter decorators for parameters inside class constructors, e.g. @Inject

What is a Restriction?

"Class that contains static methods to narrow Criteria searches

" What is a Projection?

"Class that contains static methods to narrow Criteria searches. Most of the functions act like aggregate functions

" What does it mean to be Cacheable?

"Clients can cache responses. Responses must therefore, implicitly or explicitly, define themselves as cacheable, or not, to prevent clients reusing stale or inappropriate data in response to further requests. Well-managed caching partially or completely eliminates some client-server interactions, further improving scalability and performance.

" Load time vs Compile time Weaving

"Compile-time weaving: The AspectJ compiler takes as input both the source code of our aspect and our application and produces a woven class files as output Post-compile weaving: This is also known as binary weaving. It is used to weave existing class files and JAR files with our aspects Load-time weaving: This is exactly like the former binary weaving, with a difference that weaving is postponed until a class loader loads the class files to the JVM

Compiling vs Transpiling?

"Compiling is the general term for taking source code written in one language and transforming into another Transpiling is a specific term for taking source code written in one language and transforming into another language that has a similar level of abstraction

Complex Types vs Simple Types

"Complex type is an element that contains other elements/attributes Simple type is element which cannot have element content and cannot carry attributes

" Microservice features

"Componentization via Services * services encapsulate business functionality |-> not based on a single tech stack |-> suitable for cross-functional teams * services are small, independently deployable applications |-> no language/framework lock |-> polygot persistence |-> individual services are more easily scaled, maintained, and deployed

What are components?

"Components are the most basic building block of an UI in an Angular application. An Angular application is a tree of Angular components. Angular components are a subset of directives. Unlike directives, components always have a template and only one component can be instantiated per an element in a template.

How do you consume a Web Service?

"Consuming a SOAP service with a Java Application 1. Apache CXF dependencies in our pom 2. Create the same models (pojos) as are defined in the SOAP service, these are the complex types defined in the WSDL 3. Create an interface which declares all of the service methods, found in our operation tags in our WSDL -don't provide any implementing class just interface with @WebService -also want to declare exceptions (no need for implementation for here either) 4. JaxWsProxyFactoryBean object is used to interact with our service -set interface and endpoint url -invoke its create() method 5. Client is able to use service methods ~~~~Service is consumed~~~~

" Context-Param vs Init-Param

"Context Param is global for all servlets Init Param is for local servlets

" ContextLoaderListener

"ContextLoaderListener creates a root web-application-context for the web-application and puts it in the ServletContext. This context can be used to load and unload the spring-managed beans ir-respective of what technology is being used in the controller layer

" What is CD?

"Continous Delivery-on top of continuous integration, you automate updates to backend

" What is CDD?

"Continous Deployment- on top of continous delivery, you automate the updates to production

What is CI?

"Contious Integration- is a development practice that requires developers to integrate code into a shared repository several times a day. Each check-in is then verified by an automated build, allowing teams to detect problems early

" Spring Modules.

"Core, Beans, Context, Expression Language, JDBC, ORM, OXM, JMS, Transaction, Web, Web-Servlet, Web-Portlet, AOP, Aspects, Instrumentation, Test

" What are the HTTP Methods? What CRUD operations do they correspond to?

"Create POST Read GET Update PUT PATCH Delete DELETE

What is a Query Interface? What methods does it provide?

"Creates more complicated and specific queries to the database. Where you use HQL (or even SQL but you wouldnt do that). Methods: list(), executeUpdate(), setFirstResult(int startPosition), and setMaxResults(int maxResult)

Difference between HQL and Criteria API

"Criteia performs only ""select"" in a database Criteria is slower, but is safe from SQL injection A Criteria object has methods to to narrow queries

" What is DCL and its keywords?

"Data Control Language Used to modify access. GRANT and REVOKE are both statements that fall into this category

What is DDL and its keywords?

"Data Definition Language Used to define a data structure. CREATE, ALTER, DROP, and TRUNCATE are all statements that fall into this category.

" What is DML and its keywords?

"Data Manipulation Language Used to manipulate data in a data structure. INSERT, UPDATE, and DELETE are all statements that fall into this category

" What is DQL and its keyword?

"Data Query Language A subset of DML (SELECT, JOIN)

" What is a Binding?

"Data binding in Angular is the synchronization between the model and the view.

" What is DataBinding?

"Data binding is the process that establishes a connection between the application UI and business logic. If the binding has the correct settings and the data provides the proper notifications, then, when the data changes its value, the elements that are bound to the data reflect changes automatically.

" What is Referential Integrity?

"Database concept which states that relationships must always be consistent

" What is a deadlock?

"Deadlock describes a situation where two or more threads are blocked forever, waiting for each other. Deadlock can occur in a situation when a thread is waiting for an object lock, that is acquired by another thread and second thread is waiting for an object lock that is acquired by first thread

" What are decorators?

"Decorators are a design pattern that is used to separate modification or decoration of a class without modifying the original source code. In Angular, decorators are functions that allow a service, directive or filter to be modified prior to its usage.

" What are the Access Modifiers?

"Default Protected Public Private

" What is Uniform-Interface?

"Defines the interface between clients and servers. It simplifies and decouples the architecture, which enables each part to evolve independently. The four guiding principles of the uniform interface are: Resource-Based Individual resources are identified in requests using URIs as resource identifiers. The resources themselves are conceptually separate from the representations that are returned to the client. For example, the server does not send its database, but rather, some HTML, XML or JSON that represents some database records expressed, for instance, in Finnish and encoded in UTF-8, depending on the details of the request and the server implementation. Manipulation of Resources Through Representations When a client holds a representation of a resource, including any metadata attached, it has enough information to modify or delete the resource on the server, provided it has permission to do so. Self-descriptive Messages Each message includes enough information to describe how to process the message. For example, which parser to invoke may be specified by an Internet media type (previously known as a MIME type). Responses also explicitly indicate their cache-ability. Hypermedia as the Engine of Application State (HATEOAS) Clients deliver state via body contents, query-string parameters, request headers and the requested URI (the resource name). Services deliver state to clients via body content, response codes, and response headers. This is technically referred-to as hypermedia (or hyperlinks within hypertext).

What is DevOps?

"Development + Operations teams -Seeks to build a relationship between developers & operations team with open communication between the two

What is the Docker workflow?

"Docker file Docker image Docker container

What is DOM?

"Document Object Model - a representation of a doc, with a logical tree-- HTML manipulates the dom

What is DTD?

"Document Type Definition - section in the xml document that determines the legal elements. and attributes

" What are some providers for L2 Caching?

"EHCache, OSCache, SwarmCache, JBoss Cache You will want to look into their concurrency strategies, or their strategies for mediating data storage in cache from safest to unsafe: -Transactional Read-write Nonstrict-read-write Read-Only

" What is First Normal Form?

"Each table cell should contain single value and each record is unique (to that column) and is identified by a primary key

" What is EBS?

"Elastic Block Storage- provides persistent block storage volumes for use with EC2 instances in the AWS Cloud. It protects us from losing data by automatically replicating data within its Availability Zones

" What is EC2?

"Elastic Cloud Compute- Provides scalable computing capacity in the AWS cloud. It allows us to develope applications faster. Allows us to scale up or down to handle changes in requirements or spikes in popularity, reducing your need to forecast traffic

" What is ELB?

"Elastic Load Balancing It automatically distributes incoming application traffic and scales resources to meet traffic commands

What are the rules for an element in XML?

"Element names are case-sensitive. Element names must start with a letter or underscore. Element names cannot start with the letters xml (or XML, or Xml, etc) Element names can contain letters, digits, hyphens, underscores, and periods. Element names cannot contain spaces.

What are common commands found in a Dockerfile (explain those listed)

"FROM <image> [AS <name>] FROM <image>[:<tag>][AS <name>] FROM <image>[@<digest>][AS <name>] ARG EXPOSE <port> LABEL <key>=<value> ... ADD --- copies files and adds to the filesystem of the image at the path COPY --- 2 forms similar to ADD WORKDIR -sets working directory for running commands RUN - run commands in a new layer on top of the image and commits the result. CMD - provides defaults for an executing container

three phases of data normalization

"First Normal Form = There is a primary key that uniquely identifies each recordand each column contains atomic values, and there are no repeating groups(unique rows) Second Normal Form += there are no partial dependencies (dependencies on only part of composite key Third Normal Form += There are no transitive dependencies (dependencies between fields in the same table)

" How to configure SpringMVC?

"First, web.xml is to be set up as you would a servlet config can be done with java or xml: in Java: with Annotations, define an MVC bean InternalResourceViewResolver bean = new InternalResourceViewResolver()

" Forward() vs SendRedirect()

"Forward() - sends the request to another resource within the same server. Also the URL is transparent and you cannot see the change. SendRedirect() - sends the request to another resource outside of the server to another or the same server. The client can then see the change of the redirection in the URL

What is a self-invoking function?

"Functins that invoke themselves. Typically should be used once for event listeners. They are only executed once to ovoid cluttering the global namespace

What are functions in JS?

"Functions are one of the fundamental building blocks in JavaScript. A function is a JavaScript procedure—a set of statements that performs a task or calculates a value. To use a function, you must define it somewhere in the scope from which you wish to call it.

" GET vs POST

"GET - is used to request data from a specified resource POST - is used to send data to a server to create/update a resource

doGet vs doPost vs GET vs POST

"GET and POST are Http methods while doGet and doPost are methods used inside of Service()

How would you express a join in Hibernate?

"HQL provides four ways of expressing (inner and outer) joins:- ● An implicit association join ● An ordinary join in the FROM clause ● A fetch join in the FROM clause. ● A theta-style join in the WHERE clause.

HTML vs CSS

"HTML defines the structure and content of web pages CSS describes how HTML elements are styled

What is HBM?

"Hibernate mapping-- used to declare relationships between hibernate entities.

" How do you achieve Abstraction?

"In Java, this is primarily achieved through the use of interfaces and abstract classes. Interfaces up until Java 8 (inclusion of default and static methods) was pure abstraction as it provided only abstract methods and abstract classes have always had the ability to create concrete methods along with providing abstract methods.

How do you achieve Polymorphism?

"In Java, we see this in method overloading where methods with the same signature are able to be used in different ways depending upon the arguments one passes into them. In method overriding a Parent class can reference a subclass, which in effect gives itself another form by being able to invoke the subclasses overridden method. Another polymorphic aspect is the ability for an interface type to reference any class that implements it. Then you also have covariant return types where an overridden method is able to change its form by being able to return a subclass type.

" How do you expose a Web Service?

"In SOAP: -Make a WAR packaged project, including Apache CXF dependencies & Spring MVC -WEB.XML define CXF Servlet Beans.xml - include schema definitions/namespaces Create an interface annotated with @webservice-- includes all of our service method create an implementing class, which specifies the behavior of the service method Register our service implementation endpoint in our beans.xml run our application on tomcat

" InternalResourceViewResolver

"In Spring MVC, InternalResourceViewResolver is used to resolve "internal resource view" (in simple, it's final output, jsp or htmp page) based on a predefined URL pattern.

" What is XML Namespace?

"In XML, element names are defined by the developer. This often results in a conflict when trying to mix XML documents from different XML applications. Name conflicts in XML can easily be avoided using a name prefix. When using prefixes in XML, a namespace for the prefix must be defined.

What is the IS-A rule?

"In object-oriented programming, the concept of IS-A is a totally based on Inheritance, which can be of two types Class Inheritance or Interface Inheritance. It is just like saying ""A is a B type of thing"". For example, Apple is a Fruit, Car is a Vehicle etc. Inheritance is uni-directional. For example, House is a Building. But Building is not a House. It is a key point to note that you can easily identify the IS-A relationship. Wherever you see an extends keyword or implements keyword in a class declaration, then this class is said to have IS-A relationship.

" How do you register an annotated POJO?

"In the hibernate.cfg.xml file add: <mapping class=""com.NameOfPOJO""/>

" How do you register a HBM file?

"In the hibernate.cfg.xml file add: <mapping resource=""path/NameOfPOJO.hbm.xml""/>

" What is Interpolation?

"Is inserting something into something else. In angular, we can interpolate values into attributes and strings with {{}}

What are events?

"It essentially executes JavaScript code. Examples are click, image loads, page loads, hovering, key strokes, ect.

" What is Autoscaling?

"It is a feature in AWS that allows us to gurantee that we have enough EC2 instances behind an Elastic Load Balance so data will not be lost

" What is a Cache?

"It is a memory buffer between application and database. It stores recently used data to reduce database hits

What are Generics for?

"It is used for type-safety and also it provides increased flexibility when designing a class by allowing for one to create objects of varying types using a single class.

What is the iterative model?

"Iterative process starts with a simple implementation of a subset of the software requirements and iteratively enhances the evolving versions until the full system is implemented. At each iteration, design modifications are made and new functional capabilities are added.

" JSON vs JS Object

"JSON valuse are limited to strings, numbers, objects, arrays, Boolean, null data types. JS Objects can take a variety of different types of objects. Such as functions

" Which version of JUnit have you used?

"JUnit version 4.12. Its located on the POM.XML as a Dependency -> Dependencies tags.

" What is JAX-RS?

"Java API for RESTful Web Services (JAX-RS) is a Java programming language API spec that provides support in creating web services according to the REST architectural pattern.

" What is JAX-WS?

"Java API for XML Web Services (JAX-WS) is a Java programming language API for creating web services, particularly SOAP services. JAX-WS is one of the Java XML programming APIs. It is part of the Java EE platform.

" What is JAX-RPC?

"Java API for XML-based RPC (JAX-RPC) allows a Java application to invoke a Java-based Web service with a known description while still being consistent with its WSDL description. JAX-RPC is one of the Java XML programming APIs. It can be seen as Java RMIs over Web services.

" What is a LinkedList?

"Java LinkedList class uses doubly linked list to store the elements. It provides a linked-list data structure. It inherits the AbstractList class and implements List and Deque interfaces.

What is a Queue?

"Java Queue interface orders the element in FIFO (First In First Out) manner. In FIFO, first element is removed first and last element is removed at last.

What is Java?

"Java is a general-purpose computer-programming language that is concurrent, class-based, object-oriented, and specifically designed to have as few implementation dependencies as possible

JavaScript vs AJAX

"Javascript is a scripting language which is typically used for client-side functionality although it can exist at server-side (node.js). AJAX (Asynchronous javascript and XML) is the javascript implementation of partial server requests which is typically carried out using the XMLHttpRequest object

" What is JERSEY?

"Jersey RESTful Web Services framework is open source, production quality, framework for developing RESTful Web Services in Java that provides support for JAX-RS APIs and serves as a JAX-RS Reference Implementation.

JoinPoint vs Point cut

"Join point: a point during the execution of a program, such as the execution of a method or the handling of an exception. In Spring AOP, a join point always represents a method execution. Pointcut: a predicate that matches join points. Advice is associated with a pointcut expression and runs at any join point matched by the pointcut (for example, the execution of a method with a certain name).

What is a record?

"Key/Value pair that has a timestamp. Key specifies what partition that the record belongs to and value is the payload

L1 caching vs L2 caching

"L1 is session scoped, L2 is sessionFactory scoped L2 will persist after session closes

" What are the types of Caches? What are the differences? What the levels? L1, L2

"L1, L2, Query Level L1: session cache - mandatory and default L2: persists across multiple sessions-- generally used with third party caches. org.hibernate.cache.CacheProvider

" Spring is loosely coupled. Explain why we say this.

"Loose coupling is achieved by means of a design that promotes single-responsibility and separation of concerns.Loose coupling in Springis made possible through dependency injection. In dependency injection, components define their own dependencies when they need it.

" What is @RequestMapping?

"Maps a URL pattern and/or HTTP method to a method or controller type.

@Autowired.

"Marks a constructor, field, setter method or config method as to be autowired by Spring's dependency injection facilities.

What happens if you don't have a gateway? Can you have microservices without this?

"Microservices do not need a gateway. An API gateway provides a single, unified API entry point across one or more internal APIs. They typically layer rate limiting and security, as well.

What is SpringMVC?

"Module of spring which allows our applications to handle HttpRequest. Epitomizes front controller pattern.

" Contextual Session

"Most applications using Hibernate need some form of ""contextual"" sessions, where a given session is in effect throughout the scope of a given context.

" What is Routing? How do we implement it?

"Navigation from one view to the next without breaking the one-page-application UX Import router module with @angular/router you must then configure a router-module to have 'routes'

" Examples of who is using microservices

"Netflix (Java monolith → microservices) Twitter (Ruby/Rails monolith → microservices) Facebook (PHP monolith → microservices)

" What is a broker?

"Nodes that are found in a cluster that handle a share of the parition

" What are the data types in Angular?

"Numbers Strings Arrays Objects

" What is OBP?

"Object Based Programming-It is not OOP the main difference is instead of traditional inheritance like in OOP, JavaScript supports Protoype inheritance

" What is a Phantom Read?

"Occurs when a row that matches a search criteria is not shown, usually when an outside transaction generates a new row inbetween queries

" What is a Dirty Read?

"Occurs when a transaction reads data that has not yet been commited

" What is a Non-Repeatable Read?

"Occurs when transaction reads same row twice, but gets different data each time

" What are the different relationships in SQL

"One to One, One to Many, Many to Many, Many to One, Self-referencing

PUT vs POST

"PUT -idempotent -will have server store data POST -not idempotent -pushes newly created data to web service

" What 3 parts of a business are associated with DevOps?

"People, Process, and Technology People-involves culture and change Process-Involves the adoption of the process that makes the most sense for your people and your business Technology- is automating everything you can to make it ""Hands-Free""

" What is PaaS?

"Platform as a Service It takes care of the Middleware Applications, Runtime Environments, Operating System(s) Virtualization, Storage, Networking and Servers.

" What is Spring Data?

"Provides a familiar and consistent, Spring-based programming model for data access, from databases and repositories, while still retaining the special traits of the underlying data store.

What are the ORM levels?

"Pure Relational ORM: At this level entire application is designed around the relational model. All the operations are SQL based at this level. Light Object Mapping: At this level entity classes are mapped manually to relational tables. Business logic code is hidden from data access code. Applications with less number of entities use this level. Medium Object Mapping: In this case, application is designed around an object model. Most of the SQL code is generated at compile time. Associations between objects are supported by the persistence mechanism. Object-oriented expression language is used to specify queries. Full Object Mapping: This is one of the most sophisticated object modeling level. It supports composition, inheritance, polymorphism and persistence. The persistent classes do not inherit any special base class at this level. There are efficient fetching and caching strategies implemented transparently to the application.

" SOAP vs REST

"REST -not much implicit documentation (not contract based) -any data format (wml, json, etc) -lightweight -cached -accessed through uri endpoint + http verbs -http SOAP -contract based -only using xml -heavier protocol than REST -accessed through a service endpoint interface -not tied to any paticular protocol (don't have to use http)

" What is RESTful?

"RESTful means a service follows all of the following principles (not all REST services follow these): -It should be stateless -It should access all the resources from the server using only URI -It does not have inbuilt encryption -It does not have session -It uses one and only one protocol that is HTTP -For performing CRUD operations, it should use HTTP verbs such as get, post, put and delete -It should return the result only in the form of JSON or XML, atom, OData etc. (lightweight data )

" What is JAX-RMI?

"RMI (remote method invocation) is a type of RPC (remote procedure call) scheme that is particular to the specifics of the Java language and runtime environment. The purpose of RMI is to allow nearly-transparent access to Java objects running in remote Java address spaces through local interfaces in the local Java address space. RMI makes use of the Java serialisation standard to serialise graphs of objects that might be passed as parameters or returned as results.

What are the different Isolation Levels? What anomalies does each allow?

"Read uncommited - has dirty read,nonrepeatable reads,and phantom Read commited - has nonrepeatable reads and phantom Repeatable Read - phantom Serializable - no problems

" Region vs Availability Zones

"Regions- Are essentially seperated geographic areas. It is designed to be completely isolated from other Amazon EC2 regions Availability Zones- Takes the information from the instances and stores them. You can span your instances across a variety of Availability Zones to essentially always be allowed to acess that information if one goes down.

What is RDS?

"Relation Database System is a web service that makes it easier to set up, operate, and sclae a relational database in the cloud. It provides cost-efficient, resizable capacity for an industry-standard relational database and manages common database administration task

What is an RDBMS?

"Relational Database Management System It uses a structure that allows us to identify and access data in relation to another piece of data in the database. Often, data in a relational database is organized into tables.

WSDL Messaging exchange Formats

"Request-Response - cliend sends request, server sends response One-Way - client sends request, no response from server Solicit Response - server sends request, client sends response Notification- Server sends req, no client Response

" What is a Constraint? Give a few examples.

"Rules used to limit the type of data that can go into a table. -NOT NULL -DEFAULT -UNIQUE -PRIMARY KEY -FOREIGN KEY -CHECK -INDEX

" @EnableFeignClients

"Scans for interfaces that declare they are feign clients (via @FeignClient). Configures component scanning directives for use with @Configuration classes.

What is Serialization?

"Serialization is a mechanism of converting the state of an object into a byte stream. Deserialization is doing the reverse

Servlet Context vs Servlet Config

"Servlet Config- parameters are specified for a particular servlet and are unknown to other servlets. Servlet Context - parameters are specified for an entire application outside of any particular servlet

" What is S3?

"Simple Storage Service- is a object storage built to store and retrieve any amount of data from anywhere. It is dessigned to deliver 11 9's durability. Inside of an S3 there is Buckets, Objects, and Keys

" Bean Scopes.

"Singleton(default), Prototype, request, session, global session

" What is SonarQube?

"SonarQube (formerly Sonar) is an open source platform developed by SonarSource for continuous inspection of code quality to perform automatic reviews with static analysis of code to detect bugs, code smells and security vulnerabilities on 20+ programming languages.

" Spring AOP vs AspectJ

"Spring AOP aims to provide a simple AOP implementation across Spring IoC to solve the most common problems that programmers face. It is not intended as a complete AOP solution - it can only be applied to beans that are managed by a Spring container. On the other hand, AspectJ is the original AOP technology which aims to provide complete AOP solution. It is more robust but also significantly more complicated than Spring AOP. It's also worth noting that AspectJ can be applied across all domain objects.

" What is SQL?

"Structured Query Language is a programming language used to communicate with and manipulate data in a RDBMS.

What is a Structural Directive?

"Structures HTML layout. It reshapes the DOM structure by adding, removing, or manipulating elements.

" What are the EC2 Instance types

"T2- They are designed to provide a baseling level of CPU performance with the ability to burst to a higher level when required by the workload M5-Latest generation of general purpose compute instances. Offers a balance of compute memory and networking resources for a broad range of workloads. Best used for small and mid-size databases, data processing tasks that require additional memory, caching fleets, and for running backend servers for SAP, Microsoft, SharePoint, cluster computing, and other enterprise applications M4-same as M5 but it is the older version

" What is Spring Boot?

"Takes an opinionated view of building production-ready Spring applications. Spring Boot favors convention over configuration and is designed to get you up and running as quickly as possible.

What is your experience with JUnit?

"Talk about how you incorporated unit testing into your java applications using JUnit. YOU DO NOT NEED MAVEN FOR JUnit. Its a plus if you talk about TDD

" Why do we test software?

"Testing verifies that the system meets the different requirements including, functional, performance, reliability, security, usability and so on. This verification is done to ensure that we are building the system right.

How do I create a component? What does it receive?

"The Angular CLI is the easiest way, but the following is needed: -a directory for component files(.ts, .html, .css, .ts, spec.ts) - .ts file must have @Component and an exported class - app.module.ts must have the component imported in its declarations of @NgModule

How to make http calls in Angular.

"The HttpClient in @angular/common/http offers a simplified client HTTP API for Angular applications that rests on the XMLHttpRequest interface exposed by browsers.

" What is HTTP?

"The Hypertext Transfer Protocol is an application protocol for distributed, collaborative, and hypermedia information systems.

" What is Spring?

"The Spring Framework is an application framework and inversion of control container for the Java platform. It performs IOC through dependency injection.

" What is the Spring Container?

"The Spring container is at the core of the Spring Framework. The container will create the objects, wire them together, configure them, and manage their complete life cycle from creation till destruction. The Spring container uses DI to manage the components that make up an application.

Cross Cutting Concerns

"The crosscutting concern is a concern which is applicable throughout the application and it affects the entire application. For example: logging, security and data transfer are the concerns which are needed in almost every module of an application, hence they are cross-cutting concerns.

What is the deployment descriptor?

"The deployment descriptor takes the HTTP Request and guides it to the correct servlet. It is also called web xml

" What is an Endpoint?

"The endpoint is a connection point where HTML files or active server pages are exposed. Endpoints provide information needed to address a Web service endpoint. The endpoint provides a reference or specification that is used to define a group or family of message addressing properties and give end-to-end message characteristics, such as references for the source and destination of endpoints, and the identity of messages to allow for uniform addressing of ""independent"" messages.

What is Front Controller?

"The front controller design pattern means that all requests that come for a resource in an application will be handled by a single handler and then dispatched to the appropriate handler for that type of request.

" What is the lifecycle of a Service?

"The life cycle of Web services may be simplified into four stages: design/build, test, deploy/execute, and manage.

" What does it mean to be Stateless?

"The necessary state to handle the request is contained within the request itself, whether as part of the URI, query-string parameters, body, or headers. The URI uniquely identifies the resource and the body contains the state (or state change) of that resource. Then after the server does it's processing, the appropriate state, or the piece(s) of state that matter, are communicated back to the client via headers, status and response body.

What is Cloud Computing?

"The practice of using a network of remote servers hosted on the internet to store, manage, and process data, rather than a local server or a personal computer

" What is Hoisting?

"The process of moving the declaration of a variable NOT the implementation higher up in the code

Difference between the run and start method?

"The start method begins the execution of the thread, while run describes what the thread is going to do.

What are the class members?

"There are FIVE members in a class. Member Variables (States) Methods (Behaviors) Constructor Blocks (Instance/Static Blocks ) Inner Classes.

What is SoapUI?

"Tool for testing web services. Its functionality covers web service inspection, invoking, development, simulation and mocking, functional testing, load and compliance testing.

" What is TCL and its keywords?

"Transaction Control Language Used to manage transactions. SAVEPOINT, ROLLBACK, and COMMIT are all statements that fall into this category

" What are the Hibernate Object States?

"Transient: instantiated on Java side but no representation in the database. Persistent: object managed on the Java side by a hibernate session and has a representation in the database Detached: Object is represented on the databse but is no longer managed by a session

" What is TypeScript?

"TypeScript is a superset of JavaScript that allows for object-oriented properties such as type safety, classes, and interfaces. TypeScript is additionally more robust and easier to test (because you can catch errors in real time).

" What are the RESTful characteristics?

"Uniform Interface Stateless Cacheable Client-Server Layered System Code on Demand (optional)

What is UDDI?

"Universal Description, Discovery, and Integration -XML-based standard for describing, publishing, and finding web services -uses WSDL to describe interfaces to web services

" How do you configure the custom port in Spring Boot?

"Update via a properties or yaml file: server.port=<port> or server: port: <port>

" What design patterns does Kafka employ?

"Uses one parition-multiple subscribers which solves the problems with Queue and Publish/Subscribe

What is the Maven Lifecycle?

"Validate Compile Test Package Integration-test Verify Install Deploy

What are the different types of XML parsing?

"Validating Parser It requires document type declaration It generates error if document does not Conform with DTD and Meet XML validity constraints Non-validating It checks well!formedness for ""ml document It can ignore e""ternal DTD

What is containerization?

"Virtualization method used to deploy and run distributed systems without creating a virtual machine for each app

" What is Capturing?

"When a parent element is clicked it will do that event and then look to the child elements to see if there is any events on those. If so, the child elements will be executed

What is Bubbling?

"When an child element is clicked it will do that event and then look to any of parent elements to see if they have an event. If so, they will be activated too.

" Can you test your entire application with JUnit?

"You can test all of your Units within your application. Meaning that you can test all of your application methods.

" How do you test your application automatically?

"You can use JUnit with other tools to manage automated testing such as Selenium which is a library of web drivers that simulates user interaction, and finally Jenkins to schedule testing. There are many tools to help automate your Unit Testing.

What is GREP?

"a Unix command used to search files for the occurrence of a string of characters that matches a specified pattern

What is IT Infrastructure?

"a combined set of hardware, software, networks, facilities, etc. used to develop, test, deliver, monitor, control, or support IT services

" What is the lifecycle of a component?

"a component goes through an entire set of processes or has a lifecycle right from its initiation to the end of the application, many of its stages can be observed through lifecycle hooks

" What is Bootstrap?

"a free front-end responsive library for designing websites and web applications

What is linting?

"a grammar check for computer programs. beyond checking for compile time errors, linting will encourage best practices.

" What is a container?

"a light weight run-time environment that can be created en-mass with a container manager

What is a servlet?

"a small, server-resident program that typically runs automatically in response to user input.

" What is Kafka?

"a very popular publish/subscribe system (similar to messaging queue), which can be used to reliably process a stream of data

" What are the xmlHttpRequest methods?

"abort() - cancels the current request getAllResponseHeaders() - returns header information getResponseHeaders() - returns specific header infromation open() - method,Url,async,uname,pswd send(string) - sends the request off to the server setRequestHeader() - adds a label/value pair to the header to be sent

" What is a Security Group?

"acts as a virtual firewall that controls the traffic for one or more instances. You can associate one or more security groups with the instance. You can also add rules that allow traffic to or from its associated instances

" What is Javascript?

"an object-oriented computer programming language commonly used to create interactive effects within web browsers.

" What are Meta Tags?

"are snippets of text that describe a pages content. they are litte content descriptors that help tell search engines what a web page is about

Different types of assert methods.

"assertEquals- checks if two primitives/objects are equal assertTrue- Checks to see if the condition is true assertFalse- Checks that a condition is false assertNotNull- Checks that an object is not null assertNull- Checks that an object is null assertSame- see if two object references point to the same object assertNotSame- test if two object references do not point to the same object assertArrayEquals- test if two arrays are equal to each other

What are the Hibernate Collection Types?

"bag, indexed list, sets, sorted set, map, sorted map,arrays

" Different types of Autowiring.

"byName: Autowiring looks for specfic method names to make connections. byType: Autowiring looks for specific input type to make connections.

" What are the types of variables?

"byte (number, 1 byte) short (number, 2 bytes) int (number, 4 bytes) long (number, 8 bytes) float (float number, 4 bytes) double (float number, 8 bytes) char (a character, 2 bytes) boolean (true or false, 1 byte)

" What are the scopes of the variables?

"class/static-belonging to the class, thus persisted in object instances, instance-belonging to a particular object of this class, method-belonging to a method signature (parameters), block-limited to the scope of its logic container (variable declared in a method or loop)

" "Microservice Application development setup flow"

"configuration,then discovery service, then service (Gateway can be made anytime after discovery service)

" Types of Dependency Injection

"constructor injection: the dependencies are provided through a class constructor. setter injection: the client exposes a setter method that the injector uses to inject the dependency. interface injection(not supported in Spring): the dependency provides an injector method that will inject the dependency into any client passed to it. Clients must implement an interface that exposes a setter method that accepts the dependency.

" What is container orchestration?

"container orchestration - when you orchestrate all the containers?

" How do I integrate Spring and Hibernate?

"create table in the database (optional) create applicationContext.xml file It contains information of DataSource, SessionFactory etc. create persistent class (Employee.java) create employee.hbm.xml file It is the mapping file. create EmployeeDao.java file It is the dao class that uses HibernateTemplate. create InsertTest.java file It calls methods of EmployeeDao class.

" Monolithic disadvantages

"difficult to manage a large codebase difficult for a single form to manage a large database language/framework lock only able to use a single data model single part of failure (if all works, or none of it works)

" What are the method signatures of doGet() and doPost()

"doGet() - this method is designed to get response context from web resource by sending limited amount of input data, this response contains response header, response body doPost() - this method is designed to send unlimited amount of data along with the request to web resource

" What are common CLI commands related to docker? (explain those listed)

"docker build -t {{tagname}} . - creates docker image from docker file docker run -d -p {{hostport}}:{{exposedport}} {{imagename}} - builds a container based on a docker image on described ports

What is XML?

"eXtensible Markup Language, designed for storing and transporting data as-is, XML is purely informative--information that's wrapped in tags. It is designed to be both machine and human readable

Monolithic advantages

"easy to understand conceptually easily tested * easily deployed * easily maintained * complexity is managed by language constructs * → easier up to a certain point (easier if smaller app)

getParameter() vs getAttribute()

"getParameter()-returns http request parameters. Those passed from client to the server. Can only return String getAttribute()-is for server-side usage only. you fill the request with attributes that you can use within the same request. can be used for any object

" Forward() vs Include()

"include()- loads the content of the specified resource directly into the servlets response. as if it was part of calling it Forward() - is used for server side redirection where an HTTP response for one servlet is routed to another resource for processing

" What is Kubernetes?

"is a container orchestration system for Docker containers that is more extensive than Docker Swarm and is meant to coordinate clusters of nodes at scale in production in an efficient manner -docker swarm is better for smaller, switch over to kubernetes at a higher scale

" What is Jenkins?

"is a self-contained, open source automation server which can be used to automate various tasks related to building, testing, and delivering or deploying software.

" What is NPM?

"node package manager, a dependency manager for node.js and by extension, Angular.

What are the data types in TS?

"number, string, array, tuple, enum, any, void, null, undefined, never, boolean

What is a Dependency Injection?

"one object supplying the dependencies of another -injectable method from service class -inject into receiving class

" What are the relationships in Hibernate?

"one-to-one, many-to-many, one-to-many, many-to-one

" Spring Cloud

"provides libraries to apply common patterns needed in distributed applications: * Eureka (Discovery Service) * Zuul (API Gateway) * Config Server (Configuration Server) * Hystrix (Circuit Breaker) * Feign (RestTemplate)

What are the benefits to Hibernate?

"reduces need for JDBC and sql ceremonies, allows for object-oriented functionality with interaction with DB, allows you to dynamically generate tables

" What is a Service?

"services allow us to access data and methods form components outside of its own

How do I create queries?

"session.createQuery() session.createSQLQuery() session.createCriteria()

What are the query types in Hibernate?

"session.createQuery() - creates a query in HQL syntax session.createSQLQuery() - creates a query in native SQL dialect session.createCriteria() - creates Criteria object for setting the query parameters.General rule for criteria-- used to make complex query. you can use the .add() method to add additional arguments cr.add(some restriction)

9. Why would you use an Abstract class over an Interface?

, interface when you need multiple inheritance.

What is the extension to an HTML file?

.html

5. Bean Lifecycle.

1. Instantiation 2. Populate Properties 3. BeanNameAware's setBeanName() 4. BeanFactoryAware's setBeanFactory() 5. Pre-initialixr BeanPostProcessors 6. InitializingBeans's afterPropertiesSet() 7. Call custom init-method 8. Post-initialization BeanPostProcessors --------------------------------------------- 1. DisposableBean's destroy() 2. Call custom destroy-method

two ways of starting a thread

1. extend Thread override the run() and create a new object from your class and call start(). 2. pass an implementation of the Runnable interface to the constructor of Thread, then call start().

how can we spin up new thread

1. extend the Threads class 2. implement Runnable interface. with either option, you must override the run() method

" What is the first tag in every html file?

<!DOCTYPE html>

in XML:

<bean id=""viewResolver"" class=""org.springframework.web.servlet.view.InternalResourceViewResolver""> <property name=""prefix"" value=""/WEB-INF/view/"" /> <property name=""suffix"" value="".jsp"" /> </bean> <mvc:view-controller path=""/sample.html"" view-name=""sample"" />

" What tag would you use to create forms?

<form>

What tag would you use to create tables?

<table>

What are some org.hibernate.annotations.*?

@CascadeType, @SortType, @Fetch, @Proxy, and @Sort

" Stereotype Annotations.

@Component @Controller @Service @Repository

difference between controller and restcontroller

@Controller creates a Map of model object and finds a view. @RestController returns the object and the object data is directly written into the HTTP response as JSON or XML

What are some common annotations?

@Entity, @Table, @Id, @Column, @GeneratedValue, @SequenceGenerator, @OneToOne, @OneToMany, @ManyToMany, @ManyToOne

How do I set up an entity?

@Entity, @Table, have mapping class in hibernate.cfg.xml

Gateway Application annotations needed

@MessagingGateway(name= "")

How do I relate entities?

@OneToOne, @OneToMany, @ManyToOne, @ManyToMany

What is a Map?

A Map is an object that maps keys to values, or is a collection of attribute-value pairs. Note that a Mapis not considered to be a true collection, as the Map interface does not extend the Collection interface. Instead, it starts an independent branch in the Java Collections Framework.

What is a Unique Key?

A constraint that ensures all values in a column are different.

" What is a Primary Key?

A constraint that uniquely identifies a row/record in a table.

What is a Foreign Key?

A constraint that uniquely identifies a row/record in any of the given database tables.

" What is Marshalling?

A feature of JAXB: converting Java objects to XML

What is Unmarshalling?

A feature of JAXB: converting XML back into to Java objects

" What is Angular?

A front-end framework developed by Google to develop single-page applications.

What are the Maven Goals?

A goal represents a specific task which contributes to the building and managing of a project. ex. Maven clean goal (clean:clean) is bound to the clean phase in the clean lifecycle. Its clean:cleangoal deletes the output of a build by deleting the build directory.

" What is Idempotent?

A method that always returns the same result/response

" Aspect

A modularization of a concern that cuts across multiple classes.

" What is Docker?

A platform for containerization

what is a self join

A self JOIN is a regular join, but the table is joined with itself. OR a table has a FOREIGN KEY which references its own PRIMARY KEY

" What is a Thread?

A single path of execution.

Sorted vs Ordered Collection

A sorted collection is sorting a collection by utilizing the sorting features provided by the Java collections framework. Order collection is sorting a collection by specifying the order-by clause for sorting this collection when retrieval.

What is ORM?

A technique for converting data between incompatible type systems using object-oriented languages creating, in effect, "virtual object databases" that can be used from within the programming language.

" When does a test fail?

A test fails when something happens that was not expected

what is a sql trigger

A trigger is a special type of stored procedure that automatically executes when an event occurs in the database server

what is Junit and some annotations

A unit testing framework for the Java programming. @BeforeClass, @Before, @Test, @After, @AfterClass

What does the let keyword mean?

A variable declared using let, uses block-scoping. This means that the variable is not visible outside of block scope.

" What are Views?

A view is a virtual table whose contents are defined by a query.

what is a servlet

A way for java to handle http requests

What are the Cascade Types?

ALL, ALL_DELETE_ORPHAN, DELETE, DELETE_ORPHAN, EVICT, LOCK, MERGE, NONE, PERSIST, REFRESH, REPLICATE, and UPDATE

14. ALTER vs UPDATE.

ALTER is a Data Definition Language statement. UPDATE is a Data Manipulation Language statement. ALTER is used to update the structure of the table. UPDATE is used to update data.

2. What is Abstraction?

Abstraction is the concept associated with hiding the implementation details and providing just the functionality

Advice

Action taken by an aspect at a particular join point.

What is the @NotFound annotation for?

Action to do when an element is not found on a association.

" What is Atomicity?

All of the transactions have to go through or none of them do

What does ORM consist of?

An ORM solution consists of: API for performing basic CRUD operations, API to express queries refering to classes, facilities to specify metadata, and optimization facilities: dirty checking, lazy associations fetching

What is an XML Schema?

An XML Schema describes the structure of an XML document, via XML Schema Definition (XSD)

difference between abstract and interface

An abstract class can have a constructor. An interface may only include static and final variables while an abstract class can also include non-final and non-static variables. An abstract class can implement an interface while an interface cannot extend an abstract class. Prior to Java 8, there was the difference that interfaces could only include abstract methods while an abstract class could include both abstract and concreate methods.

" What is a Docker image?

An immutable snapshot of a specific run-time environment with everything needed to run a container

When is an object ready for garbage collection?

An object is eligible to be garbage collected if its reference variable is lost from the program during execution.Sometimes they are also called unreachable objects.

AngularJS vs Angular4

AngularJS uses JavaScript, Angular 2+ uses TypeScript

" What is Maven?

Apache management tool for building, dependency gathering, testing, and deploying project solutions.

when would you use array vs arraylist

Array: Simple fixed sized arrays, supports primitive data types, data stored in contiguous locations, faster access ArrayList : Dynamic sized arrays, only stores objects, not stored in contiguous locations, collection interface has a set of methods to access elements and modify them

" What are the types of lists?

ArrayList, LinkedList, Vector

difference between arraylist and linked list

ArrayList:-Implemented with the concept of dynamic array, fast data retreval. LinkedList:-Implemented with the concept of doubly linked list. Fast insertion and removals. Have to traverse list to find element

describe ACID properties

Atomicity, Consistency, Isolation,Durability

what is autoboxing, boxing and unboxing? When are they introduced in java

Autoboxing is the automatic conversion that the Java compiler makes between primitivve types and their corresponding object wrapper classes. Converting an object of a wrapper type to its corresponding primitive value is called unboxing. This is done when a wrapper class is passed as a parameter to a method expecting a primitive data type and when assigning a wrapper class object to a primitive data type. Boxing is converting a primitive to a reference type.

What is the finally block?

Block that comes after a try-catch block and essentially contains code that will be run after the try-catch block occurs, unless an exception is thrown

" What are the data types in JS? (7)

Boolean, Number, String, Null, Undefined, Object, Symbol

" What are the different forms of CSS?

CSS, SCSS CSS3

Cache vs Cacheable

Cache adds a caching strategy, allowing to set the usage, region, and whether or not to include all properties. Cacheable enables caching behavior for a method.

What is CSS?

Cascading Style Sheets, describes how HTML elements should be displayed (the styling)

" What is a Wrapper Class?

Class that encompasses a primitive type in order to allow it to provide it additional functionality reserved only for classes, such as being able to use them in collections.

What is the difference between 'Collection' vs 'Collections' vs 'collections'

Collection is the root interface in the collection hierarchy. A collection represents a group of objects, known as its elements. Collections is a class consists exclusively of static methods that operate on or return collections.

what are collections

Collections in java is a framework that provides an interfaces to store and manipulate the group of objects.

What is Durability?

Commits are always final

59. What is constructor chaining?

Constructor chaining is the process of calling one constructor from another constructor with respect to current object. Within same class: It can be done using this() keyword for constructors in same class From base class: by using super() keyword to call constructor from the base class.

3. DATE vs TIMESTAMP.

DATE and TIMESTAMP have the same size (7 bytes). Those bytes are used to store century, decade, year, month, day, hour, minute and seconds. But TIMESTAMP allows to store additional info such as fractional seconds (11 bytes) and fractional seconds with timezone (13 bytes).

" What are subtypes/sublanguages of SQL?

DDL, DML, DCL, DQL, and TCL.

what is DDL

Data Definition Language - used to define a data structure. CREATE, ALTER, DROP, and TRUNCATE are all statements that fall into this category

what is DML

Data Manipulation Language - used to manipulate data in a data structure. INSERT, UPDATE, and DELETE are all statements that fall into this category

what is DQL

Data Querying Language - A subset of DML (SELECT, JOIN)

" What is another name for web.xml?

Deployment Descriptor

" What is a Attribute Directive?

Describes features of HTML elements

What is DTD

Document Type Definition - defines the structure and legal elements and attributes of an XML document.

Connection vs DriverManager

DriverManager is a class and is the basic service for managing a set of JDBC drivers. Connection is an interface and is used to make a connection with a specific database.

what are some interfaces in jdbc

DriverManager, Connection, Statement, ResultSet, Prepared Statetment, Callable Statement

What are the portType elements?

Elements you'll find within the portType element are operations and message.

" What is Second Normal Form?

Follows 1st Normal form, also does not allow partial dependencies

What is Third Normal Form?

Follows 2nd Normal form, does not allow transitive dependencies

How do you invoke a static method?

From inside the same class, using ClassName.staticMethodName() for an outside class, or by calling a static method using an instance (considered bad practice).

What is a Scalar Function?

Function based on user input, returns single value

What is an Aggregate Function?

Function where multiple values from multiple rows are grouped together to form a single value

What is an anonymous function?

Functions that do not have a name

what are some safe methods

GET, HEAD, OPTION

" What are the HTTP methods?

GET, POST, PUT, DELETE, TRACE, HEAD, OPTION

" get() vs load()

Get is eager and immediately hits the database and instantiates an object and populates all of its fields. Load is lazy and will hit the database and populate all object fields when the object is accessed within that session. When an attempt is made to access the object outside of the session, having never being accessed w/in session, a LazyInitializationException will be thrown.

What are the variable scopes in JS?

Global, function, and block

what is the difference between equals and hashcode

Hash code is an integer representation of an object, equals comapres whether two references refer the same object or not.

What are the types of sets?

HashSet, SortedSet, TreeSet

difference between treeset and hashset

HashSet: Elements are not ordered. Faster, allows null objects. Tree set stored in sorted order, does not all null objects

" What is HQL?

Hibernate specific language used to query a database. Stands for Hibernate Query Language.

What is Transactional-Write Behind?

Hibernate, while synchronizing the persistent object changes, optimizes the list of SQL statements issued. This optimization prevents foreign key violations but still be predictable.

" What is HTML?

Hyper text markup language, which is used to define the structure of our web pages.

7. INNER JOIN vs INTERSECT.

INTERSECT operator is used to retrieve the common records from both the left and the right query of the Intersect Operator. INTERSECT does all columns, INNER JOIN only the specified columns. Also INTERSECT creates a temporary table and INNER JOIN works on the actual table.

checked vs unchecked

In Java exceptions under Error and RuntimeException classes are unchecked exceptions, everything else under throwable is checked

what is a view

In SQL, a view is a virtual table based on the result-set of an SQL statement. A view contains rows and columns, just like a real table. The fields in a view are fields from one or more real tables in the database

What is cascade?

In cascade, after one operation (save, update and delete) is done, it will decide whether it need to call other operations (save, update and delete) on another entities which has relationship with each other.

What is the Read Committed Isolation level?

In this isolation level, a lock-based concurrency control DBMS implementation keeps write locks (acquired on selected data) until the end of the transaction, but read locks are released as soon as the SELECT operation is performed (so the non-repeatable reads phenomenon can occur in this isolation level)

" What are the 4 pillars of OOP and examples of each?

Inheritance, Polymorphism, Abstraction, and Encapsulation

What are the 4 pillars of OOP?

Inheritance, Polymorphism, Abstraction, and Encapsulation

What are the different types of Joins?

Inner join, Left join, Right join, Full outer join

" What is xpath?

Is basically stepping thru each element of your HTML document

What makes the String class special?

Is immutable and is stored in string pool inside the heap

What does it abstract?

It abstracts away alot of the boilerplate, "ceremonial" code.

" What is Reflection?

It allows an executing Java program to examine or "introspect" upon itself, and manipulate internal properties of the program. For example, it's possible for a Java class to obtain the names of all its members and display them.

What is XSL? (extensible stylesheet language)

It explains how to display an XML document of a given type

Is a catch block needed?

It is not, but you need at least a try with either a catch or finally block

what is multitrheading

It is the concept of having multiple threads executing concurrently (in parallel) inside of a program

Inheritance

It is the mechanism in java by which one class is allow to inherit the features(fields and methods) of another class.

What is constructor chaining?

It is the process of calling one constructor inside of another constructor

15. What are Generics for?

It is used for type-safety and also it provides increased flexibility when designing a class by allowing for one to create objects of varying types using a single class.

what are generics

It is used for type-safety and also it provides increased flexibility when designing a class by allowing for one to create objects of varying types using a single class.

How does the servlet container track sessions?

It keeps track through HTTP session objects. so when an HTTP session object is created the client interaction is considered to be stateful

What does synchronized mean

It means that two threads cannot execute a method on the same object at the same time

What is JAXB

Java Architecture for XML Binding - a tool used for mapping Java class objects to and from XML representations

What is JDBC?

Java Database Connectivity, Java API that we use to we use to connect to our SQL database.

" What is J2EE?

Java Enterprise Edition - a set of specifications for enterprise features such as distritbutive computing and web services

" how do you see whats common between 2 tables

Joins (INNER, OUTER, RIGHT, LEFT, CROSS, and SELF)

What kind of compiler does Js use/have?

Just-In-Time Compiler (JavaScript is an interpreted language and is compiled by the browser)

What are the different fetching types?

Lazy and Eager

Lazy Fetching vs Eager Fetching

Lazy is the default fetch type and with lazy, Hibernate won't load the relationships for that particular object instance until they are needed (doesn't query for them until necessary). Fetch type Eager is essentially the opposite of Lazy, Eager will by default load ALL of the relationships related to a particular object loaded by Hibernate.

name some hibernate exceptions

LazyInstantiationException, SQLGrammarException, ConstraintViolationException

difference between arraylist and set

List is an ordered sequence of elements and can access elements by their integer index whereas SET = is a distinct list of elements which is unordered, cannot by accessed by index, contains no duplicate elements and at most one null element.

what is an iterator and how is it different from list iterator

List iterators can iterate backwards, obtain the iterator at any point, add a new value at any point, and set a new value at that point

" What is a Listener?

Listener basically just waits for a specific action to take place

Is JS loosely typed or strongly typed?

Loosely typed for example, you do not need to specify the type when declaring variables.

What does a Transaction do?

Manages our ACID compliant transactions. We get transactions from Session.

Can I sort a Map?

Map does not have a sort method, but SortedMap, which extends it, has sorting features. An example of a class that implements SortedMap is TreeMap, which is sorted using the Red-Black tree algorithm.

What is MVC?

Model View Controller

What are the states of threads?

New, Runnable, Blocked, Waiting, Timed_Waiting, Terminated

what are the states of a thread

New, Runnable, Blocked, Waiting, Timed_Waiting, Terminated

Why do you need ORM tools like Hibernate?

ORM tools like Hibernate provide the following benefits: improved performance, improved productivity, improved maintainability, and improved portability.

How many times do Init, Service, and Destroy execute?

Once per Servlet

" What tools do you need to run a SQL statement?

One tool that we use is SQL Developer

Which relationship requires mappedBy parameter refrencing?

One-to-Many

" What are the types of Data Bindings?

OneTime, OneWay, TwoWay

What does attribute 'target="_blank"' do?

Opens the link in a new tab.

method overload vs override

Overloading occurs when two or more methods in one class have the same method name but different arguments.Overriding means having two methods with the same method name and parameters (i.e., method signature). One of the methods is in the parent class and the other is in the child class.

Is JS pass-by-value or pass-by-reference?

Pass by value

How do you configure Hibernate?

Passing a hibernate.cfg.xml file to our configuration object in which we define the parameters needed to connect to our database instance (username, password, url) as well as mappings between pojos.

" What tools should I use to test a Web Service?

Postman, SoapUI, TestingWhiz, SOAPSonar

" What is a Criteria Interface? What methods does it provide?

Programmatic approach to querying the database (object-oriented). Methods: list(), .add(), setFirstResult(int startPosition), and setMaxResults(int maxResult)

What is the difference between protected and default?

Protected is accessible from outside of the package for subclasses, however default only is accessible from within the package

What is a Subquery?

Query nested in another query that is usually embedded within the where clause

what is referential integrity

Referential integrity (RI) is a relational database concept, which states that table relationships must always be consistent. In other words, any foreign key field must agree with the primary key that is referenced by the foreign key

what is reflection

Reflection gives us information about the class to which an object belongs and also the methods of that class which can be executed by using the object. At runtime

" What does a Session do?

Represents a connection to our database. The Session is a persistence manager that manages operation like storing and retrieving objects.

how would you protect a rest endpoint

Require API keys for every request to the protected endpoint.

What is a SOAP Envelope?

Required part of a SOAP message that distinguished the beginning and end of it.

what are constraints

Rules used to limit the type of data that can go into a table. -NOT NULL-DEFAULT-UNIQUE-PRIMARY KEY

What are the APIs used to implement Web Services?

SOAP and REST.

how can we read characters from a file

Scanner

why are string immutable

Security, Synchronization, Caching, Class loading. String is Immutable in Java because String objects are cached in String pool

13. How to implement the Orchestration service?

Service orchestration represents a single centralized executable business process (the orchestrator) that coordinates the interaction among different services. The orchestrator is responsible for invoking and combining the services.

Servlet Hierarchy

Servlet Interface - Generic Servlet - Http Servlet - My Servlet

What are the important interfaces?

Session, SessionFactory, Transaction, Query, and Criteria

" Session vs SessionFactory

SessionFactory is gotten only once and is thread-safe whereas Session is implemented as many times as necessary, not thread-safe, and is obtained using SessionFactory.

which java collection can't have duplicates

Set and Map (Hash Map, Tree Set, Hash set, tree map,Hashtable)

List all design patterns you can think of

Singleton NEEDS MORE

What is Starvation?

Situation where a greedy thread hogs the resource so other threads are unable to access it

" Where are variable references stored?

Stack memory

what is a static block

Static block is used for initializing the static variables.This block gets executed when the class is loaded in the memory

Where are Strings stored in memory?

String pool, which is inside the heap

difference between string, stringbuilder and stringbuffer

Strings = immutable, stored in a string pool, thread safe

what is SQL

Structured Query Language is a programming language used to communicate with and manipulate data in a RDBMS.

12. Which method does the garbage collector call?

System.gc() or finalize()

What are Objects in SQL?

Tables, Views, Triggers, Schemas, Indexes, and Sequences.

What is a short circuit operator?

The && and || operators are short circuit operators. A short circuit operator is one that doesn't necessarily evaluate all of its operands

JVM vs JRE vs JDK?

The Java Virtual Machine is an abstract machine that loads, verifies, and executes code. It also provides a runtime environment.

what is the java collection framework, name 5 methods found

The Java collections framework is a s set of classes and interfaces that implement commonly reusable collection data structures. .size() .add() .equals() .remove() isempty

how to deserialize an object

The ObjectInputStream class contains readObject() method for deserializing an object. using the java.io.Serializable interface.

What's the parent of all exceptions?

The Throwable class

5. What is Casting?

The ability to take an object of a type and convert it to another type.

What is casting?

The ability to take an object of a type and convert it to another type.

29. WHERE vs HAVING.

The difference between the having and where clause in SQL is that the where clause cannot be used with aggregates, but the having clause can.

what is serialization

The process of translating data from a data structure into a format that can be stored, for java that would be byte steamcode. Benefits of this include the ability to save an object and have it travel across a network.

" What is a Singleton?

The singleton pattern is a design pattern that restricts the instantiation of a class to one object. This class provides a way to access its only object which can be accessed directly without need to instantiate the object of the class.

Where are Maven Dependencies stored?

They are stored in your Maven local repository

what are our wrapper classes why are they needed

They convert primitive data types into objects. Objects are needed if we wish to modify the arguments passed into a method (because primitive types are passed by value).

what are wrapper classes

They convert primitive data types into objects. Objects are needed if we wish to modify the arguments passed into a method (because primitive types are passed by value).

What is inverse?

This is used to decide which side is the relationship owner to manage the relationship (insert or update of the foreign key column). In short, the "inverse" decides which side will update the foreign key, while "cascade" decides what's the follow by operation should execute.

ways to sort objects

To sort an Array, use the Arrays.sort(). To sort an ArrayList, use the Collections.sort(). To sort a Object use the Comparable interface and override the compareTo() method. Or sort a object with Object with Comparator

What is the @Type annotation for?

To tell what type of data do you want to store in database

What is Postman?

Tool for testing webservices by sending requests and reading responses

what is TCL

Transaction Control Language - used to manage transactions. SAVEPOINT, ROLLBACK, AND COMMIT are all statements that fall into this category

What is Isolation?

Transactions must act independently of one another

" What is the Web Service Protocol Stack?

Transfer, messaging, description, discovery

What is the Protocol Stack?

Transport, Messaging, Discovery, Definition

What exceptions will get thrown if you try to run the client (single microservice) before the server (eureka)?

TransportException

What does TS transpile into?

TypeScript is transpiled into JavaScript

" What does a Unit refer to?

Units are referred to methods within the application.

Merge vs Update

Update tries to attach the object to a persistant state and if an object with the same indentifier is already in a persistant state a NonUniqueObjectException is thrown. Merge first checks for a persistant object with the identifier of the provided object and if it doesn't exist, instantiates one. It copies over fields from the provided object to the persistent object and returns the persistent object

How do you connect to EC2 from Putty?

Use a ppk,

What does a SessionFactory do?

Use it to get our sessions. Implements Singleton & Factory design patterns.

What is the @JoinTable annotation for?

Used in the mapping of associations. It is specified on the owning side of an association. A join table is typically used in the mapping of many-to-many and unidirectional one-to-many associations.

What is the @CollectionId annotation for?

Used to create a collection id.

What is the @GenericGenerator annotation for?

Used to denote a custom generator, which can be a class or shortcut to a generator supplied by Hibernate.

What is @AttributeOverrides annotation for?

Used to override mappings of multiple properties or fields.

What is @AttributeOverride annotation for?

Used to override the mapping of a Basic (whether explicit or default) property or field or Id property or field.

How do you invoke a Stored Procedure?

Using session.createSQLQuery(), declare a stored procedure using @NamedNativeQueries and calling session.getNamedQuery, or declaring stored procedure in <sql-query> and calling session.getNamedQuery().

VARCHAR vs VARCHAR2

VARCHAR2 does not distinguish between null and empty values

What is @Embedded annotation used for?

We can use the @Embedded annotation to embed an embeddable class (an entity that can be embedded in another entity).

What is Dirty Checking?

When a session is closed, Hibernate checks for any changes in persistent objects and updates the database to those changes.

What is Consistency?

When modifying data, if table is already in consistent state it must stay in that state.

What is Transitive Dependency?

When one or more columns are functionally dependant on a column other than the primary key

" Dynamic Insert vs Dynamic Update

With the dynamic-insert property set to true, Hibernate does not include null values for properties that are not set by the application, during an INSERT. With the dynamic-update property set to true, Hibernate does not include unmodified properties in the UPDATE.

" What is Well-Formed XML?

XML with a beginning and closing tag

45. Can I do a sub query in a DELETE statement?

Yes

" Are JS objects mutable or immutable?

Yes in JavaScript objects and arrays are mutable not primitives

Can I catch an error? Does it make sense?

Yes, but errors are serious problems that a reasonable application should not try to catch

Can an Interface have variables? What are they?

Yes, they are variables that are final and static by default.

" When should you use javax.persistence vs org.hibernate?

You use javax.persistence to keep implementation-agnostic (i.e. you can change to use a different JPA implementation later.) If you want to just go with Hibernate, you can use org.hibernate annotations. But it's advisable to just import the javax classes rather. Then Hibernate will provide the implementation, but can be replaced by just switching in a different dependency.

" What is a topic?

a category which records are published

7. What is an Interface?

a class that does not cotain method implementation, only signature

" What is a module?

a collection of services, directives, controllers, filters, and configuration information

" What is a CLI?

a command line interface. Angular has a nice console thingy.

What is an iFrame?

a nested HTML element-- in essence a page within a page

can a static method call a nonstatic method

a static method can only call other static methods. a static method can be called directly from the class, without having to create an instance of the class. To access a non-static method from a static method, you must create an instance of the class.

What is a Dockerfile?

a text document that contains all the commands a user could call on the command line to assemble an image

what are pipes used for

a way of formating data. a pipe takes in data as input and transforms it to a desired output.

How do you create a SOAP Web Service?

applications.yaml

is there a limit to an array size

arrays use int, so its the max size of int. 2147483647 or 2^31-1

) 2) instantiation 3) populate properties 4) BeanNameAware setBeanName 5) BeanFactoryAware setBeanFactory 6) BeanPostProcessor pre-initialization 7) InitializingBean afterpropertiesSet 8) custom init method(if defined) - best place for custom

behavior 9) BeanPostProcessor Post-initialization --------------Bean ready---------------- 10) container is shut down 11) DisposableBean destroy() method 12) custom destroy method

what is a local variables default value

byte = 0

" What is UTF-8?

character encoding using one to four 8-bit bytes-- naturally, it is backward compatible with ASCII

what are the key bulding blocks of angular

components

what is a cursor

cursor contains information on a select statement and the rows of data accessed by it (result set)

1. What is Encapsulation?

data hiding using private fields and public accessors

" What are the types of elements in WSDL?

definitions, types, message, operations, portType, binding, service, port, import

7. Another name for web.xml?

deployment descriptor

What is an XML Schema?

describes the structure of an XML document-- defines what legal elements go into an XML doc

what is the difference between and error and exception

difference between Error and Exception is kind of error they represent. errors which are generally can not be handled and usually refer catastrophic failure e.g. running out of System resources, Exception represent errors which can be catch and dea eg IO

double equals vs triple equals

double equals will perform a type conversion when comparing two things

how to create a checked exception

extend Exception

What is the difference between final, finalize, and finally

final = a keyword used to apply restrictions. Final classes can't be inherited, final methods can't be overwritten, and final variables can not be changed

Final vs Finally vs Finalize

final: a keyword that indicates that its subject is not to be mutated. Finally: a block within a try-catch that always executes. Finalize: calls preparation for garbage collection

What does attribute "required" do?

forces a form field to be filled (will not successfully submit otherwise

difference between redirect and forward

forware server side

what are 5 methods in threads

getId, isAlive, getState, join, resume,start, setPriority, stop, suspend

" What is Hibernate.hbm2ddl?

hibernate mapping to make schema ddl

35. LinkedList vs ArrayList

insertions and removals in arraylist require overhead due to resizing linked list has more overhead because arraylist's index only holds actual data. but linked list hold the data, and address of previous and next node. both find methods require O(n) time

What is Hibernate?

is an object-relational mapping tool that provides a framework for mapping an object-oriented domain model to a relational database.

" what is shadowing?

is when two variables with the same name exist within overlaping scopes

25. What is shadowing?

is when two variables with the same name exist within overlaping scopes

" Is TS loosely or strongly typed?

it is strongly (static) typed.

what does the static keyword do

it means that a variable or method is shared between all instances of that class

what is a java bean

its a convention/standard. All properties private, public no-argument constructor, and Implements Serializable

what is the root class or interface of exceptions

java.lang.Throwable

2. When you start the angular application, what is the entry point of it, where does it

main.ts and app.module.ts

When you start the angular application, what is the entry point of it? Where does it start?

main.ts and then it goes to the component

How do I make an object Serializable?

mark the class with the marker interface syncronizable

" What is a directive?

method of connecting behaviors to elements in the DOM

what new thing is introduced html 5

new tags, such as <article>, <nav>, <header>, <footer>

What is the CLI command to generate a service?

ng generate service <name>

What is ngModel?

ngModel is a directive that binds input to view

11. Can I force garbage collection?

no

what is npm and name some commands

node package manager Adapt packages of code to your apps, or incorporate packages as they are. Download standalone tools you can use right away. npm start, stop, install, uninstall, test

4. What is Polymorphism?

overloading methods with differnt arguments, and overloading child methods of a parent class

" What does AWS focus on?

provide on-demand cloud computing platforms

" How do I insert elements in a map?

put method

how to read bytes from a file

readAllBytes() method of Files class

" FallBack component

response from Hystrix

41. Where are variable references stored?

stack

What is bootstrapping?

starting up an angular application; the application launches by bootstrapping the root AppModule. The bootstrapping process creates the component listed in the bootstrap array and inserts each one into the browser DOM.

difference between .this and super()

super is used to access methods of the base class while this is used to access methods of the current class.

What's the first line in a constructor?

super()

13. What is the finally block?

the finally block always executes when the try block exits.

what is automatic dirty checking

the process of monitoring and updating objects that have been changed

What is Native SQL?

the sql dialect that the database is configured with

" @Before vs @Around

they are not the same

What does the Arrow function (=>) do?

this aliases a lambda function, which means that the left hand side is assigned or used on the right hand side (assuming a, then b is a*2 a =>{b=2*a }

how do you make asynchronous calls using Angular?

through usage of observables, or through promises

what are the states of hibernate

transient (exists as object but not yet persisted), persistent (exists as object, is persisted in database, and is associated with session), detached (object is persisted in database but is no loger identified with session)

what does transient mean

transient is a Java keyword which marks a member variable not to be serialized when it is persisted to streams of byte

what is the string pool

tring Pool in java is a pool of String literals stored in java Heap memory. Strings from the string pool are returned as references and are immutable .

what are the benefits of java

type-safe, platform-agnostic, secure, has a large library and user base, and has strong support for multi-threading.

difference between update and merge

update will throw an exception if there is an object in the cache for that object.(non unique exception) merge will overwrite the persistent object.

What is the final keyword used for?

used to state that a variable is final, so it can't be changed anymore (becomes a constant)

.equals() vs ==

value equality vs memory location

3. What is Inheritance?

when a class aquires the fields and methods of another class

can interfaces have concrete method

yes, default

can interfaces have variables

yes, in newer versions of java

is the sessionfactory thread safe

yes. many threads can access it concurrently.

What is a Collection?

a group of individual objects represented as a single unit

What is an Array?

object that holds a fixed number of values(elements) of a single type

How do you achieve Encapsulation

one way is through private fields and public accessors

How do you achieve Inheritance?

primarily through class extension.

How do you go about starting a thread?

thread.start()

" Can constructors be private?

Yes.

What is a Try-Catch-Finally Block?

"The try block contains set of statements where an exception can occur. A try block is always followed by a catch block, which handles the exception that occurs in associated try block. A try block must be followed by catch blocks or finally block or both. A catch block is where you handle the exceptions, this block must follow the try block. A single try block can have several catch blocks associated with it. You can catch different exceptions in different catch blocks. When an exception occurs in try block, the corresponding catch block that handles that particular exception executes. For example if an arithmetic exception occurs in try block then the statements enclosed in catch block for arithmetic exception executes. A finally block contains all the crucial statements that must be executed whether exception occurs or not. The statements present in this block will always execute regardless of whether exception occurs in try block or not such as closing a connection, stream etc.

" Checked vs Unchecked Exceptions

"Unchecked exceptions: -represent defects in the program (bugs) - often invalid arguments passed to a non-private method. To quote from The Java Programming Language, by Gosling, Arnold, and Holmes: ""Unchecked runtime exceptions represent conditions that, generally speaking, reflect errors in your program's logic and cannot be reasonably recovered from at run time."" -are subclasses of RuntimeException, and are usually implemented using IllegalArgumentException, NullPointerException, or IllegalStateException -a method is not obliged to establish a policy for the unchecked exceptions thrown by its implementation (and they almost always do not do so) Checked exceptions: -represent invalid conditions in areas outside the immediate control of the program (invalid user input, database problems, network outages, absent files) are subclasses of Exception -a method is obliged to establish a policy for all checked exceptions thrown by its implementation (either pass the checked exception further up the stack, or handle it somehow)

" ArrayList vs Vector?

"Vector is synchronized. ArrayList is a better choice if your program is thread-safe. Vector each time doubles its array size, while ArrayList grow 50% of its size each time.

" Why would you choose Java?

"We use Java because it is object oriented, type-safe, platform-agnostic, secure, has a large library and user base, and has strong support for multi-threading. Also, Java is used by a large number of devices and is relatively easy to learn and use.

" What are the Non-Access Modifiers?

"static final abstract synchronized transient volatile native

" What is a Constructor?

A special method (if it can really be called one) that is used to instantiate an object. A class comes pre-equipped with a default, no-args constructor. If a different constructor is declared explicitly, we will need to define this again, or the compiler will expect us to use the newly defined one.

What is a Set?

A Set is a Collection that cannot contain duplicate elements methods: size, isEmpty, contains, add, remove, contains all, clear

Class vs Object

A class is a template for an object, an object is an instance of a class

" Comparable vs Comparator

A comparable object is capable of comparing itself with another object. The class itself must implements the java.lang.Comparable interface to compare its instances. Unlike Comparable, Comparator is external to the element type we are comparing. It's a separate class. We create multiple separate classes (that implement Comparator) to compare by different members.

" Abstract Class vs Interface

An abstract class is a class that is not implemented directly, containing one or more abstract methods, or methods that are not yet implemented. An interface can have only abstract methods, with a caveat in default methods. They are not close enough entities to classes to be thought of as one-- they exist primarily to describe a set of functions that a class that is said to be of that interface should have. (cars should accelerate, brake, and change gears, but you would never say that a car is a child of brakes). An important feature of interfaces is that multiple can be implemented by a class, as opposed to the option of extending a single abstract class.

What is an Exception? What class does it extend?

An exception (or exceptional event) is a problem that arises during the execution of a program. When an Exception occurs the normal flow of the program is disrupted and the program/Application terminates abnormally, which is not recommended, therefore, these exceptions are to be handled. It extends Throwable.

" How do you insert elements in a Map?

Using .put

What is Polymorphism?

The dictionary definition of polymorphism refers to a principle in biology in which an organism or species can have many different forms or stages.

" Throw vs Throws

Java throw keyword is used to explicitly throw an exception. Java throws keyword is used to declare an exception.

" How do I start a thread implementing Runnable?

Overwrite run method and then run the start method

BEAN vs POJO

POJO has no real requirements since it is a Plain Old Java Object, BEAN specifies that it needs to implements serializable, a no-args constructor, and that all properties are private with getters and setters

STACK vs HEAP

STACK is used for static memory allocation and Heap for dynamic memory allocation. Stack is faster and follows a Last in First Out pattern, while HEAP is slower and contains within it the String Pool (a allocation of memory that stores Strings).

" What are the types of Polymorphism?

Static/Dynamic AKA compile-time vs runtime. Achieved through overloading and overriding respectively

What is the difference between StringBuilder and Buffer?

StringBuilder is not synchronized, StringBuffer is synchronized

" STACK vs VECTOR?

The Stack class represents a last-in-first-out (LIFO) stack of objects. It extends class Vector with five operations that allow a vector to be treated as a stack. The usual push and pop operations are provided, as well as a method to peek at the top item on the stack, a method to test for whether the stack is empty, and a method to search the stack for an item and discover how far it is from the top.

What is Inheritance?

The process by which a class (blueprint for an object) acquires the properties (fields and methods) of another (as when a class extends another). Multiple Inheritance can be emulated through interfaces. Multiple Inheritance should not be confused with Hierarchical Inheritance, which enables the IS-A relationship.

What are Wrapper classes?

They convert primitive data types into objects. Objects are needed if we wish to modify the arguments passed into a method (because primitive types are passed by value).

What is the main purpose of Version Control Software?

To manage changes in software and see previous versions and potentially rollback to previous versions.

Why would you use an Abstract class over an Interface?

Use an abstract class when specifying what an object is. Use an insterface when specifying what the object can do.

What is Varargs used for?

Used when a method needs to take a variable amount of a parameter. It's denoted by "..." and should always be the last in the parameter listings. Ex. int ...a

What is a hashCode?

When using a hash table, these collections calculate the hash value for a given key using the hashCode() method and use this value internally to store the data - so that access operations are much more efficient. Simply put, hashCode() returns an integer value, generated by a hashing algorithm. Objects that are equal (according to their equals()) must return the same hash code. It's not required for different objects to return different hash codes.

Can I force garbage collection?

You can use the .gc method to ask for garbage collection, however you cannot actually force garbage collection

Can I instantiate an Abstract class? Constructor?

You cannot instantiate an Abstract class, but it can hava a constructor.

What is an Interface?

a class that does not cotain method implementation, only signature

What are the thread methods?

run(), start(), join(), and wait()


Set pelajaran terkait

3. Test Your Understanding of Body Mechanics and Back Safety

View Set

Rate of perceived exertion: Cardiopulmonary

View Set

US History 2: Hoover Administration + Great Depression Part Three

View Set

Financial Management Chapter 7-9

View Set