Developer/Coding Interview Challenge #1

Developer/Coding Interview Challenge #1

This is the first of many in a series of developer coding interview challenges I will be starting for the benefit of graduate IT/developers and those trying to get their first break as a developer or software engineer. Many of us crack and/or get nervous at the interview stage, and we realize only after the interview that "I could have answered that more cleverly" and such. As a graduate developer looking for employment as a Software engineer, you must expect to be prepared not just for the introductory interview (where they want to know you as a person), but for the interview stages to follow after. Always expect a coding challenge, and always expect them to ask you questions relating to the developer position you are applying for. For example, if you are applying for a position as an ASP.NET developer, you don't expect them to ask you questions only about C#, you should expect them to ask theoretical questions like "What is your understanding of the MVC Model?", and the like.

So, in that spirit of preparing you to get to that interview and come out of it with confidence, and expecting more, this is my reason for starting these coding challenges. It will be a mix of theory questions, coding questions, and maybe some MCQ, but mostly questions that you'd expect to be asked at an interview. This will eventually, as we progress, include more questions leading to data structures, design patterns and the more complex stuff that we always ignore once we're done with our studies (BIG MISTAKE!!).

Before I start, firstly, each day's challenge will contain a maximum of 3 to 4 questions, nothing more. You are not expected to answer all the questions. Based on your current knowledge (as even if you are a first-year CS student, you can still give this a try, and by the end of it still learn something your peers do not yet already know and you'll be better prepared when comes time to study that particular section in your studies or if you are lucky enough to get an internship while you're studying), you can answer even one question, or none at all, even if you made an attempt and got stuck somewhere along the way.

Secondly, I ask that if you are going to attempt to answer any of these questions (for each day's challenge) always LIKE my post so that I'm aware of how many of you are participating, and then you will add your answers to the comments in that day's post. You could either post that long answer in the comments directly or share a link to your LinkedIn post (with your answer(s)) if you shared it on any of your social media platforms or even if you decided to add your answer to your GitHub profile to flaunt you solving a particularly difficult challenge (difficult to you), you do that.

Thank you! Let's get to it, shall we?

QUESTION 1: The primary memory in programming is the data structure that is used to store the information that is used by the program to control the execution of a program. Your question here is to identify the different types of data structures that are identified as primary memory.

QUESTION 2: In whatever your language preference, firstly define what is a Singleton Class. Then give your example of a Singleton class.

QUESTION 3 (CODING CHALLENGE): This is a Project Euler question, but we'll refine it a little bit to make it more challenging. You can do both the original challenge, then do the second one. (Again you can either attempt the first or second or both!)

  1. If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 1000.

  2. Find the sum of all the multiples of 3 or 5 or 12 below 1000.

Sure enough, you can find the answers to this question there, but then what's the point of struggling it out yourself? Also, there is more than one way to solve a coding challenge, so let's see yours.

Good luck and Happy Coding!

Just a reminder:

  1. Please like this post if you are attempting to answer at least one of these challenge questions.

  2. Provide your answers in the comments here.

  3. Your answers can be directly in the comments or a link to the post with your answers on social media/GitHub.

  4. You can answer this with whatever your preferred coding language is.

  5. Feel free to Comment on others' answers and provide any helpful feedback.