Java thread and interview questions

A collection of the posts I saw recently.

Java World
Introduction to Java threads

Java 101: Understanding Java threads, Part 1: Introducing threads and runnables

Others
Java Callable Future Example

Java – Multithreading

Java Thread Tutorial: Creating Threads and Multithreading in Java

Vaadin chat example
It needs multi session (thread) support when we need to use tabs to chat back and forth. The app description is here.

The annotation to support this: @VaadinSessionScope

Java interview questions
Placeholder: I still need to clean up the list below (to incorporate my recent interview experience).

aop
dependency injection
refactor
agile
test driven
code review (what to look)
static vs. final
interface
spring
hibernate

java generics

Spring, Spring Boot, React and OAuth

Baeldung : A Comparison Between Spring and Spring Boot

Tutorials from Okta
To be done
Secure Service-to-Service Spring Microservices with HTTPS and OAuth 2.0 (Matt Raible)

Completed
Build Spring Microservices and Dockerize Them for Production by Raphael do Vale. As I was finishing up the regular part (the exercise before docker), the service discovery reminded me of Hashicorp Consul tutorial I followed along a while ago. Note this tutorial used Netflix Eureka which is a bit more cool than pure command lines from Consul / Vagrant 🙂 Note this for Docker (quote the tutorial): You must store the file school-ui.properties in the same folder specified on the volume mapping (in the example above, the relative folder ./config-data). This is also my first complete tutorial on Docker container running java web apps (on my local MacBook and Windows 10). In the past I followed tutorial that runs Chef as well as Tomcat / Jenkins on docker (GCP).

Build a Secure Notes Application with Kotlin, TypeScript, and Okta by Matt Raible. Note the last part also talked about how to push code to Pivotal Cloud Foundry and deploy the apps there. This is interesting as I have done the PCF 15 minutes tutorial in the past (and recently).

Bootiful Development with Spring Boot and React (Matt Raible at Okta): I followed this tutorial until the point that I get the basic beer list (in other words, I made both the basics of Spring Boot and React work). This is my very first venture into React, and I had to install “yarn” as well using brew install. In the process I had to upgrade the Xcode via command line.

Also: Use React and Spring Boot to Build a Simple CRUD App (Matt Raible at Okta): I made small mistake when initiating the project with Spring website: I copied / pasted the dependency frameworks, which seems does not have any effect when the pom.xml was created. So I added the dependencies manually.


			org.springframework.boot
			spring-boot-starter-web
		
		
			org.projectlombok
			lombok
			provided
		
		
			com.h2database
			h2
			runtime
		

Also in my Eclipse, I need to install Lombok manually by following instruction here. Note Matt did mentioned the IDE cannot recognize some of the Lombok things if there is no plugin. In the past I used to install Plugin via the menu inside Eclipse. I noticed “Whitelabel error” when I was hitting the end points: http://localhost:8080/api/groups/ (this is working as expected actually, before I add any JUG meeting to the list, as I don’t have access to the default list).

Last but not least: I need to make a small adjustment in GroupEdit.js sample code

'X-XSRF-TOKEN': this.state.csrfToken, (it was just csrfToken and Yarn did not like it)

Continue reading “Spring, Spring Boot, React and OAuth”

h2 database

H2 Database – Installation

H2 Database – JDBC Connection (the only differs from the docs is we need to add “mem” before the “:~/test”. Otherwise it gives me error.

Mixed mode

Another Java H2 tutorial

Last but not least, how much time should a coding test be? I feel couple hours are probably the way to go (think of Filtered AI, Hacker Rank etc). The other approach is more like open-ended projects: those could take from a few hours to a few days 🙁 In some cases I was suspecting the hiring companies could use this opportunity to get some real work done (if they ask for source code 🙂

Something to keep in mind when doing code test.

Database deployment automation

DB deployment (schema or DDL, package)
Continuous integration and deployment of database is a main issue for many legacy monolithic web app. I came across this article recently, and I think it touched some good points.

On a related matter, Jeff Atwood (cofounder of stack overflow), has a good piece on database version control.

I understand the world is going microservice, and the monolithic relational database is not used as frequently as it’s being used in those legacy web apps. But nonetheless, it helps the dev team to be agile if version control / CI / CD can be applied to database update as well as the application update.

Tracking data changes in DB
This also reminds me of an app I worked in 2010/11, in which we have an DB audit log for many (if not most) database changes: add, update, delete. It’s usually achieved via trigger in Oracle, or interceptor in Java. I read an article from a startup engineering blog (credit karma? Or something like this), they detailed how this is implemented.

Working from home friendly companies

Or companies that allows or encourages remoting.

Zapier (Emily Irish) The Remote Work Survival Guide: 9 Do’s & Don’ts Every Remote Worker Needs to Know

stackoverflow remote dev jobs:
e.g., MobyMax: this is very interesting because I learned about Mobymax because my daughter’s school has the subscription.

Top 30 Companies for Work-from-Anywhere Remote Jobs in the U.S.

Work From Home 2018: The Top 100 Companies For Remote Jobs

Last but not least, LinkedIn has the top startup list for 2017 and 2018. Note many startup like people to work onsite for more communication but there are some exceptions (InVision for one).

Webhooks

(Update 03-21-2019) Add the Power of Webhooks to Your App with Okta’s System Log (Joël Franusic at Okta).

(Original 12-28-2008)
Webhooks
I heard webhooks from Zapier the first. Below is an good article written by the folks at Zapier.
What are the webhooks? (Zapier)

Was trying to follow the tutorial from the above
requestbin tool

requestbin works like described (encountered a few 500 errors, but mostly working)

It seems I could not open the hurl.it link from runscope community page.

I am reading this more technical webhooks blog by @brandur

My interest in webhooks is also inspired by this little JS program I wrote a long time ago. And this was rekindled recently due to the atomist-sdm (GitHub) (node.JS based SDM, automation, quick start here).