Home Depot Interview Questions Flashcards
What is Agile Development?
Agile software development is a group of software development methods in which requirements and solutions evolve through collaboration between self-organizing, cross-functional teams. It promotes adaptive planning, evolutionary development, early delivery, continuous improvement, and encourages rapid and flexible response to change.
What are the 12 Agile Principles?
- ) Customer satisfaction by rapid delivery of useful software
- ) Welcome changing requirements, even late in development
- ) Working software is delivered frequently (weeks rather than months)
- ) Close, daily cooperation between business people and developers
- ) Projects are built around motivated individuals, who should be trusted
- ) Face-to-face conversation is the best form of communication (co-location)
- ) Working software is the principal measure of progress
- ) Sustainable development, able to maintain a constant pace
- ) Continuous attention to technical excellence and good design
- ) Simplicity—the art of maximizing the amount of work not done—is essential
- ) Self-organizing teams
- ) Regular adaptation to changing circumstance
What is SCRUM?
Scrum is a management framework for incremental product development using one or more cross-functional, self-organizing teams of about seven people each. Scrum has only three roles: Product Owner, Team, and Scrum Master.
What is an alternative to Waterfall development?
Scrum’s incremental, iterative approach trades the traditional phases of “waterfall” development for the ability to develop a subset of high-value features first, incorporating feedback sooner.
Waterfall
Requirements Analysis
Desgin
Code
Integration
Test
Deploy
SCRUM Incremental
What is a Static Variable?
A static variable is one that’s associated with a class, not objects of that class.
What are some Sorting Algorithms in JAVA?
bubble sort
selection sort
insertion sort
quick sort
merge sort
http://www.java2novice.com/java-sorting-algorithms/
Explain Bubble Sort
Bubble sort, also referred to as sinking sort, is a simple sorting algorithm that works by repeatedly stepping through the list to be sorted, comparing each pair of adjacent items and swapping them if they are in the wrong order.
Worst Case time complexity: O(n^2)
Best Case time complexity: O(n)
(See image in dropbox)
Explain Selection Sort
The selection sort is a combination of searching and sorting. During each pass, the unsorted element with the smallest (or largest) value is moved to its proper position in the array. The number of times the sort passes through the array is one less than the number of items in the array. In the selection sort, the inner loop finds the next smallest (or largest) value and the outer loop places that value into its proper location.
Time Complexity: O(n^2)
(See image in dropbox)
Explain Insertion Sort
Insertion sort is a simple sorting algorithm, it builds the final sorted array one item at a time. It is much less efficient on large lists than other sort algorithms.
Advantages of Insertion Sort:
1) It is very simple.
2) It is very efficient for small data sets.
3) It is stable; i.e., it does not change the relative order of elements with equal keys.
4) In-place; i.e., only requires a constant amount O(1) of additional memory space.
Explain Quick Sort
Quicksort or partition-exchange sort, is a fast sorting algorithm, which is using divide and conquer algorithm. Quicksort first divides a large list into two smaller sub-lists: the low elements and the high elements. Quicksort can then recursively sort the sub-lists.
Time complexity: O(n log(n))
(See image in dropbox)
Explain Merge Sort
Merge sort is a divide and conquer algorithm.
Steps to implement Merge Sort:
1) Divide the unsorted array into n partitions, each partition contains 1 element. Here the one element is considered as sorted.
2) Repeatedly merge partitioned units to produce new sublists until there is only 1 sublist remaining. This will be the sorted list at the end.
Time complexity: O(n*log(n))
(See image in dropbox)
What is Object Oriented Programming?
Object-oriented programming (OOP) is a programming paradigm based on the concept of “objects”, which are data structures that contain data, in the form of fields, often known as attributes; and code, in the form of procedures, often known as methods.
Give an example of Object Oriented Programming
Base class - Aninmals
Lion class extends Aninmals Class
Cat class extends Aninmals Class
public class Animal { public void sleep() { System.out.println(”Sleeping: Zzzzz”); } public void makeNoise() { System.out.println(”Noises...”); } public void roam() { System.out.println(”Roamin’ on the plain.”); } } -----------------------------------------------------------
Lion IS-A Animal
Override the makeNoise() method.
public class Lion extends Animal { public void makeNoise() {
System.out.println(”Roaring: Rrrrrr!”); } }
Cat IS-A Animal
Override the makeNoise() method
Public Class Cat extends Animal{
Public void makeNoise(){ System.out.println(”Miaowing Miaooooo”); }
}
The Launcher
public class AnimalLauncher {
public static void main(String[] args) {
System.out.println(”\Lion\n=====”);
Lion lion = new Lion();
Lion.makeNoise(); //from lion
lion. roam(); //from lion
lion. sleep(); //from lion
System.out.println(”\Cat\n=====”);
Cat cat = new Cat();
cat. makeNoise(); //from cat
lecato. roam(); //from cat
cat. sleep(); //from cat
}
}
Output
Lion
=====
Roaring: Rrrrrrr!
Roaming: I’m with my pack.
Sleeping: Zzzzz
Cat
=====
Roaring: Miaooo!
Roaming: I’m roaming alone.
Sleeping: Zzzzz
What are the four fundamental concepts of object oriented programming?
Encapsulation, Data Abstraction, Polymorphism, Inheritence
What is Polymorphism?
Means having many forms. One interface, multiple functions.
Another way objects work together is to define methods that take other objects as parameters.
Example:
Class PrintData{
public Static void print(int i){ Console.Writeline("Printing int:{0}",i); } Static void print(double F){} Static void print(string S){} Static void main(string[] args){ Printdata p = new printdata(); p. print(5); p. print(500.263); p. print("hello c++");
}
- class Bike{
- void run(){System.out.println(“running”);}
- }
- class Splender extends Bike{
- void run(){System.out.println(“running safely with 60km”);}
- public static void main(String args[]){
- Bike b = new Splender();//upcasting
- b.run();
- }
- }
What is Inheritance?
a way of obtaining code without writing it. In particular, subclass can inheirt the implementations of its super class’s methods.
Example:
public class Animal { public Animal() { System.out.println("A new animal has been created!"); } public void sleep() { System.out.println("An animal sleeps..."); } public void eat() { System.out.println("An animal eats..."); } }
public class Bird extends Animal { public Bird() { super(); System.out.println("A new bird has been created!"); } @Override public void sleep() { System.out.println("A bird sleeps..."); } @Override public void eat() { System.out.println("A bird eats..."); } }
public class Dog extends Animal { public Dog() { super(); System.out.println("A new dog has been created!"); } @Override public void sleep() { System.out.println("A dog sleeps..."); } @Override public void eat() { System.out.println("A dog eats..."); } }
public class MainClass { public static void main(String[] args) { Animal animal = new Animal(); Bird bird = new Bird(); Dog dog = new Dog(); System.out.println(); animal.sleep(); animal.eat(); bird.sleep(); bird.eat(); dog.sleep(); dog.eat(); } }
What is encapsulation?
Encapsulation is the hiding of implementation details so that they are inaccessible outside of the module providing the implementation.
What is Data Abstraction?
Data Abstraction is the reduction of a particular body of data to a simplified representation of the whole.
In other words, Abstraction is the process of hiding the implmentation details and showing only the functionality.
What are the four kinds of Abstraction?
- procedural abstraction
- data abstraction
- iteration abstraction
- type hierarchy
What is Procedural Abstraction?
Procedural abstraction is a particular mechanism for separating use from implementation.
The idea, that each conceptual unit of behavior should be wrapped up in a procedure.
What is the difference between Java and C#?
Other then some small syntax differences for example Console.write vs System.out.println, Java does not have delegates.
Example:
public delegate void printString(string s); ... printString ps1 = new printString(WriteToScreen); printString ps2 = new printString(WriteToFile);
Delegates are used to pass methods as arguments to other methods
What is big O notation?
Big O notation is the language we use for articulating how long an algorithm takes to run. It’s how we compare the efficiency of different approaches to a problem. With big O notation we express the runtime in terms of—brace yourself—how quickly it grows relative to the input, as the input gets arbitrarily large.
What is the synchronization() method in java and give a situation in which it would be used?
Threads communicate primarily by sharing access to fields and the objects reference fields refer to. This form of communication is extremely efficient, but makes two kinds of errors possible: thread interference and memory consistency errors. The tool needed to prevent these errors is synchronization.
Example:
An ATM machine with two threads trying to access a share variable “Checking_Account”, thread 1 named deposit and thread 2 named withdraw. Both excute and try to access the shared variable “Checking _Account”, with using the synchronization method we can make sure thread 1 and thread 2 do not block each other.
public synchronized void Deposit
public synchronized void Withdraw
Define software desgin pattern.
Software desgin pattern is a general reusable solution to a commonly occurring problem within a given context in software design. A design pattern is not a finished design that can be transformed directly into source or machine code. It is a description or template for how to solve a problem that can be used in many different situations.
What are 5 software desgin patterns and explain each one.
- Algorithm strategy patterns addressing concerns related to high-level strategies describing how to exploit application characteristics on a computing platform.
- Computational design patterns addressing concerns related to key computation identification.
- Execution patterns that address concerns related to supporting application execution, including strategies in executing streams of tasks and building blocks to support task synchronization.
-
Implementation strategy patterns addressing concerns related to implementing source code to support
- program organization, and
- the common data structures specific to parallel programming.
- Structural design patterns addressing concerns related to high-level structures of applications being developed.
Why would one choose to use a DB2 database vs. an oracle database?
Biggest reason DB2 database can cost less then an Oracle database.
What are the differences between Java 5, 6, 7, 8?
Java 8 (a.k.a 1.8)
<a>JSR 337</a>, <a>what’s new</a>
Language changes:
- lambda expressions (JSR 335, includes method handles)
- continuation of Project Coin (small language improvements)
- annotations on Java types
Library changes:
Java 7 (a.k.a 1.7)
<a>JSR 336</a>, <a>features and enhancements</a>
Language changes:
- Project Coin (small changes)
-
switch
on Strings - try-with-resources
- diamond operator
-
Library changes:
- new abstracted file-system API (NIO.2) (with support for virtual filesystems)
- improved concurrency libraries
- elliptic curve encryption
- more incremental upgrades
Platform changes:
Java 6 (a.k.a 1.6)
<a>JSR 270</a>. <a>features and enhancements</a>
Mostly incremental improvements to existing libraries, no new language features (except for the @Override
snafu).
Java 5 (a.k.a 1.5)
<a>JSR 176</a>, <a>features and enhancements</a>
Language Changes:
- generics (that’s the big one)
- annotations
-
enum
types - varargs, enhanced for loops (for-each)
Library changes:
- concurrency utilities in
java.util.concurrent