Team Lead
In part 2, I looked at the additional items you would look for in a FizzBuzz discussion for a lead developer. Without getting too much into what job title means what, the next level up is a team lead.
The road not yet discussed
My discussion here isn't meant to be exhaustive, there are additional areas an interview can and should go; however, this one is really the last one that I think could possibly have source code up on a white board. After this, I really think you should start using boxes and arrows.
RTFM - Read the F*#cking Manual won't cut it
When I started my career, you really could get by with your K&R C manual and the various man pages. That really ended in my SunOS world (we hadn't converted to Solaris yet) when we started developing in X-Windows R4/Motif. You really could not actually do your work without an O'Reilly set of books or the equivalent.
Today, being able to not only code using a library or framework, but also direct those under you in the use of a framework is a essential skill for a team lean.
FizzBuzz on Apache Camel and Spring Boot
I've been using the very popular Spring Boot framework so far, but I've been commenting out it's true power. In this post I will be adding Apache Camel, an integration library that allows for abstracting processing into items called "routes" with input and output being handled by "components" with named endpoints. The code is deceptively simple:
@Component
public class MySpringBootRouter extends RouteBuilder {
@Autowired
FizzBuzz fb;
@Override
public void configure() {
restConfiguration().component("netty-http")
.host("0.0.0.0").port(8888)
.bindingMode(RestBindingMode.json);
rest("/camel").get("/hello/{i}").to("direct:fizzbuzz");
from("direct:fizzbuzz").bean(fb, "process(${header.i})");
// Needed for auto generated unit test only
from("timer:hello?period={{timer.period}}").routeId("hello")
.transform().method("myBean", "saySomething")
.filter(simple("${body} contains 'foo'"))
.to("log:foo")
.end()
.to("stream:out");
}
}
and it's test:
@SpringBootTest
@CamelSpringBootTest
class MySpringRouterTest {
@Autowired
protected CamelContext camelContext;
@Autowired
private ProducerTemplate producerTemplate;
@Test
void test() throws Exception {
// invoking consumer
producerTemplate.sendBodyAndHeader("direct:fizzbuzz",
null, "i", "15");
Object o = producerTemplate.requestBodyAndHeader(
"direct:fizzbuzz",
null, "i", "15");
assertEquals("FizzBuzz", o);
o = producerTemplate.requestBodyAndHeader(
"direct:fizzbuzz", null, "i", "1");
assertEquals("1", o);
o = producerTemplate.requestBodyAndHeader(
"direct:fizzbuzz", null, "i", "3");
assertEquals("Fizz", o);
}
}
Why a framework like Camel?
Assuming they provided something like the fragments colored above, I would expect that a candidate would be able to discuss why they would use Camel:
- The ability to name a route like "direct:fizzbuzz", allows testing of the FizzBuzz business logic without having to test the input or the output.
- We added a REST endpoint into the FizzBuzz logic, but we wouldn't have to. We could use many of the Camel components like:
- "file" - this could allow a set of test input files for complicated inputs to be kept by those testing the code (developers in a DevOps environment, or a dedicated QA group).
- "kafka" - this could allow for queueing, asynchronous or a multitude of other use cases.
- Custom components - I've developed a component to be used with TIBCO Rv, because the steps to develop your own component are well documented.
- We get manageability.
- Spring Boot comes with the /actuator
- Apache Camel allows you to specify thread pools, metrics and other items on a per-route basis.
Why not a framework like Camel?
A developer at this level should also be able to discuss why you might not want to have a framework:
- Team doesn't know it.
- Problem is too small to have a ROI for using a framework.
- Other components around FizzBuzz will be doing the platform level functionality.
Next
The next item I'm going to discuss is deployment. Again, the order isn't important. What is important is that the person being interviewed can cogently discuss things like this and that they can communicate what they have done in the past, and now with the wisdom of hindsight, done differently.
Comments
Post a Comment