User:Hydrostatics/sandbox

= All-Round/Hybrid Developer Questions =

Core Java

 * Threading: What do I need to be aware of if Multiple events observers are registering an interest in a single observer. What type of collection is best suited to this task?
 * What's the difference between Callable and Runnable?
 * How would you make an Object immutable? Why it could be useful?
 * What's the better way to define constants?
 * What are generics? How they're implemented?

Adobe CQ

 * How would I listen for activation events within Apache Felix
 * Can you explain the principles of OSGi? How does it differ from J2EE or a simple servlet container?

Testing

 * What is TDD?
 * If I said Red, Green, Refactor what would I mean?
 * What are the basic steps/principles of TDD? (Only write enough of a test to fail, not compiling is failing. Only write enough of the code to pass the test. Refactor)
 * What is an acceptance test? How does it differ from a unit test?
 * What is BDD? Does it differ from TDD?
 * What are the signs of a good unit test? (Can only fail in one way, well named, maintainable, good use of fixtures, mocked out interactions etc)
 * What is a mock? Why would I use a mock over a fake object?
 * What is your favourite mocking framework?
 * How would you test a contact form on WGSN?
 * What is the page object pattern? Why is it better or worse than traditionally approaches?

Software Professionalism

 * What are the SOLID principles?
 * Why should changability drive the development of a system?
 * What is the release reuse equivalency Principle? (bonus points due to obscurity... basically keeping code into small deliverables so they can be pushed to production)
 * ... Common closure principle (/\... Code which changes together should be kept together)
 * ...Common reuse principle (.. Code which is used together should be kept together)
 * ... Acyclic deps princple (packages and code should not have circular dependency..)
 * ... stable deps principle (You should depend on the most stable components of the system. Not code in flux)
 * ... Stable abstraction princple (abstractness increases the more mature/stable a system is... and also should become more abstract as a system becomes more stable)
 * Why should you depend on abstractions within a system rather than concrete implementations?
 * When implementing a behaviour, do you prefer composition or inheritance? Why?
 * How would you define clean code?
 * What's refactoring? Why it is important?

Design Patterns

 * What is inversion of control? Why is it beneficial?
 * What is dependency injection? Why is it useful for testing?
 * Can you name any techniques which allow us to use DI within Apache Felix?
 * What is a flyweight pattern? How is it used within Java?

OOP Design

 * If I asked you to design a car park how would you go about it? (start with objects, responsibilities, interactions.. design patterns, data structures.. add complexity)

Architecture

 * If I wanted to design a very simple CMS system which allowed an editor to upload images to a file store that are subsiquently displayed to users on a simple gallary page how would you architect the system
 * --- What layers?
 * --- How would you support disaster recovery?
 * --- How would you maintain availability?
 * --- What caching mechanisms would you use?

Security

 * In the context of a website, what is XSS? How can you prevent it? Are you aware of any sites which you can gain knowledge of the latest bugs/flaws/exploits
 * How can you assure the security of a logged in user on a website? (this is more of a mitigation process.... secure cookies, HMAC hashing, time boundaries, short lived sessions etc)
 * If you build a restful web service which a number of clients consume, how can you avoid replay attacks?

Operations Dev/Ops

 * If you had total freedom what would your deployment process look like? (what would you deploy to? What systems would you use, automation etc, vms)

Agile/Lean

 * What are the lean software development principles?
 * Lean is a concept which encourages rapid, non-blocking development. We often need to develop multiple components of the same system together. If you were building a restful web service which expose d an article via json how could you avoid blocking another developer which was developing a front end for that data? (could be worth flipping this around and seeing how they'd play the story)
 * As a new team member there's a plethora of improvements that can be made to our process. if you had a new proposal how may you introduce it?
 * How do you assure quality of your software?
 * What is a story?
 * How large should a story be?
 * How would you break down a story?
 * what are the disadvantages of a large card?

Continuous Integration

 * What is CI?
 * Why is it important?
 * What is your ideal CI setup?
 * What feedback would you like to see?
 * What is your opinion of test coverage metrics? What are the advantages/disadvantages?

Example Tests
'''Please note: a test should be SIMPLE. It is designed to see if they can write the most basic code.. It is used to filter out non-programmers'''

Simple tests

 * The Fibonacci sequence is 0,1,1,2,3,5,8... Please write an algorithm to return the 5th number in the sequence (5). (TESTS ARE REQUIRED!)
 * Given 2.5 pounds what is the minimum number of coins you could get to make this number? (2x2. 1x 50p)
 * Given a string of letters, how could I determine whether each character was unique
 * Fizzbuzz test, unrecommended as everyone knows it
 * Write a method (any language, java maybe) to determine if an integer is a power of 2. (prefer no use of loops)

Test Driven Development focussed tests

 * Given an amount in pounds please calculate the amount of interest accrued in a year based on the following rules
 * -- Between 0-1000 pounds you can 1.5% interest
 * -- Between 2000-3000 Pounds you gain 2.5% interest
 * -- Above 3000 pounds you can 3% interest

Each amount is exclusive (if you have 1500 you gain 2.5% on the TOTAL amount)