Personal Insights
The SAP Technical ABAP Interview Question You Might Have Never Heard Of
As many of you know, a technical ABAP interview can be quite a daunting prospect. Today I wanted to help with that and highlight a technical ABAP interview question you might have not prepared for or even heard of. A lot of good interviewers out there will want to get a feel for not only your technical ABAP coding skills but also how you approach relatively abstract problems that may not easily translate directly into code.
One such example is the game of FizzBuzz. If you’ve come from other programming languages you might’ve already heard of this but essentially the interviewer would ask you to do the following.
- Output a table list that runs through a number range e.g. from 1 – 100.
- Every time a number is exactly divisible by 3 (no remainders) then replace that number with the word “FIZZ”.
- Every time a number is exactly divisible by 5 (no remainders) then replace that number with the word “BUZZ”.
- And finally if divisible by both 3 and 5 – replace that number with the word “FIZZBUZZ”.
The interviewer will be looking at 3 things:
- How do you approach a simple problem like this.
- Do you just quickly slap together something that works in a more or less functional way OR
- Do you structure things in a more OO fashion with the view of keeping things as readable and maintainable as possible.
- How familiar you are with both old and new ABAP syntax
- The complexity of your finished code i.e. is it simple and easy to read or is it quite complex and hard to make out at first glance.
There are many ways to approach a problem like this but you can find my attempt in the GitHub repository here:
https://github.com/brandoncaulfield/youtube-abap/blob/master/z_fizzbuzz.abap
And also a video demostrating how I put the solution together explaining each step im my logic.
If you guys have a different solution please feel free to leave it in the comments below for us all to see 🙂
Thanks for reading!
Hi Brandon,
We have a monthly code challenge and one of the earlier challenges was FizzBuzz.
Simple, but very interesting to see how people come up with different implementations.
Below is an example of one of our team members solutions.
I personally agree that code challenges to assess/evaluate potential developers is a great approach.
Nice blog!
Cheers,
James
Nice thanks for sharing the code. Another great way to do this.
I really like this solution being a big fan of the REDUCE operator ? Thanks for sharing!
Very nice. You shared the code and the "why" behind it. I've not had that question asked to me yet.
Thanks Michelle Crapo, I've also only seen it come up recently so perhaps we might see a bit more in the future. Always best to be prepared!
I totally agree.
FizzBuzz is a Rosetta Code's task with existing ABAP solutions.
Fun fact: you can use the Scheme solution in ABAP Scheme.
JNN
That’s incredibly interesting, thank you for sharing!
Interviewer: So, how would you implement FizzBuzz in ABAP?
Me: Google-> FizzBuzz site:blogs.sap.com -> jackpot
That's pretty much my typical approach to ABAP development. 🙂
Interesting