Core Programming Concepts
日本語はこちら。
As I wrote in my previous blog, I'm interested in how people learn programming. Programming is a hard skill to learn. It requires knowledge about programming languages, frameworks, how computers work, how networks work, etc. It's also a non-forgiving activity as the results are binary (works or doesn't work), any mistake in your code will result in the compiler emitting bizarre looking errors or your program crashing.
FizzBuzz
As difficult as the process of learning to program can be hard, everyone starts from the basics, the typical "Hello World", learning about variables, conditionals, loops etc.
Thinking about the basics, reminded me of a famous blog post by Jeff Atwood:
Why Can't Programmers.. Program?
The post made the "FizzBuzz" coding problem famous. The FizzBuzz problem was originally created by Imran Ghory in his blog post:
Using FizzBuzz to Find Developers who Grok Coding | Imran On Tech
I won't explain the problem here, but it's a simple problem that can be solved by using if
and for
statements.
According to the above blog posts, it's a suprisingly effective interview question to filter out candidates who can't program.
Breaking Down FizzBuzz
I personally do not use FizzBuzz as an interview question. I don't particularly like coding questions in interviews as I think it's a poor way to evaluate candidates (and I'm not good at it either 🤫).
However, I do see the value in using the question to see if the candidate can program. I believe it covers some very basic programming concepts that are at the core of programming.
A typical FizzBuzz solution would look like this:
for i in range(1, 101):
if i % 15 == 0:
print("FizzBuzz")
elif i % 3 == 0:
print("Fizz")
elif i % 5 == 0:
print("Buzz")
else:
print(i)
The solution above uses
Conditional:
if
Loop:
for
Arithmetic operator:
%
I think these are the most basic programming concepts and any programmer who can code should be able to come up with the solution pretty quickly.
Other Simple Coding Problems
I started to think about other simple coding problems that can be used to evaluate if the candidate can program. I came up with the following (with the aspects that I think it covers):
Fibonacci
Conditional
Loop
Recursion
Memoization (possibly)
Binary search
Conditional
Loop
Recursion
I've thought of other simple coding problems but most of them seem to be covering similar aspects as the ones above.
This suggests that the things people treat as "basic" programming concepts are actually quite limited.
There's More
Ok, so the above problems are simple and cover some basic programming concepts. I know there's more to programming than just these concepts. You need to know about system design, class design, algorithms, data structures. You also need to know about the language and framework you're using. You need the ability to search for good, solid libraries that fit into your system (nobody writes everything from scratch these days).
I wanted to see if I could come up with really core concepts that anyone who can program should know. I do believe the one covered in the previous section are such concepts that people need to be able to wrap their heads around and use it anytime they need to.
Hope this was interesting. I'm still on my journey to find out what people need to know to program. I'll keep writing about it as I learn more.