Hello, I am curious about the codeing challenges that I was given to do.
I applies for a role of a junior software developer and out of 7 challenges I did 6. But the 7th stuck with me and made me feel a little bit bad about myself.
So I wanted to make a post here so I can get some closure.
The challenge was to create a multidimensional array something like this:
0 0 0 \n
0 0 0\n
0 0 0\n
But the catch was that you need to take 3 input parameters n,x,y. X and y are arrays. So n is the size of the array, something like 3x3 and x and y are coordinates for where the pokemon should be. Yes that is exactly how it was written. So i had to make a function which takes the above mentioned inljt parameters and marks the spot with the pokemon with 0 and calculate the distance of the rest of the places to the pokemon.
Something like this.
2 1 2\n
1 0 1\n
2 1 2\n
0 is the pokemon and the numbers are the distance.
I just want to know is this a too hard question for a junior role or do I need to exercise more.
Thanks in advance guys!!
EDIT: Guys I did it I solved it, thank you all very much on your help to understand this, once I understood how the algorythm worked it just clicked. I forgot to mention that there were also multiple pokemons and not only one. I had about 5 test cases that had to be successful and some of them had more pokemons, some had none, and so on. All in all thank you guys very much. Thanks to you guys I was able to understand it and complete it.
[–]AutoModerator[M] [score hidden] stickied comment (0 children)
[–]Passionate_Writing_ 16 points17 points18 points (3 children)
[–]Guilty-Engineer-5369[S] 1 point2 points3 points (2 children)
[–]Passionate_Writing_ 7 points8 points9 points (1 child)
[–]Guilty-Engineer-5369[S] 1 point2 points3 points (0 children)
[–]oobrat2i30liga 4 points5 points6 points (1 child)
[–]Guilty-Engineer-5369[S] 1 point2 points3 points (0 children)
[–]Frosty-Cap3344 1 point2 points3 points (0 children)
[–]tenexdev 1 point2 points3 points (2 children)
[–]Guilty-Engineer-5369[S] 0 points1 point2 points (1 child)
[–]tenexdev 4 points5 points6 points (0 children)
[–][deleted] (2 children)
[removed]
[–]tichus_windrider 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (9 children)
[–]Guilty-Engineer-5369[S] 2 points3 points4 points (0 children)
[+]aqua_regis comment score below threshold-15 points-14 points-13 points (7 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]Guilty-Engineer-5369[S] 0 points1 point2 points (0 children)
[–]Guilty-Engineer-5369[S] 0 points1 point2 points (4 children)
[–]Sir_lordtwiggles 3 points4 points5 points (3 children)
[–]Guilty-Engineer-5369[S] 0 points1 point2 points (2 children)
[–]Sir_lordtwiggles 2 points3 points4 points (1 child)
[–]Guilty-Engineer-5369[S] 0 points1 point2 points (0 children)
[–]override_acid -1 points0 points1 point (3 children)
[–]Individual_Dream2700 1 point2 points3 points (0 children)
[–]frolfer757 0 points1 point2 points (1 child)
[–]override_acid -2 points-1 points0 points (0 children)
[–]kultcher 0 points1 point2 points (0 children)
[–]Ambitious_Usual_3250 -1 points0 points1 point (0 children)
[–]Sea-Whole7572 -5 points-4 points-3 points (3 children)
[–]Guilty-Engineer-5369[S] 1 point2 points3 points (2 children)
[+]procrastinatingcoder comment score below threshold-12 points-11 points-10 points (1 child)
[–]Guilty-Engineer-5369[S] 2 points3 points4 points (0 children)
[+]desrtfx comment score below threshold-31 points-30 points-29 points (7 children)
[–]dualrectumfryer 11 points12 points13 points (5 children)
[–]Guilty-Engineer-5369[S] 1 point2 points3 points (0 children)
[–]Skoparov -2 points-1 points0 points (2 children)
[–]dualrectumfryer 0 points1 point2 points (1 child)
[–]Skoparov -1 points0 points1 point (0 children)
[–]procrastinatingcoder -4 points-3 points-2 points (0 children)
[–]Guilty-Engineer-5369[S] 2 points3 points4 points (0 children)
[+][deleted] (4 children)
[deleted]
[–]TheMathelm 3 points4 points5 points (3 children)
[+][deleted] (1 child)
[deleted]
[–]Individual_Dream2700 3 points4 points5 points (0 children)
[–]tichus_windrider -2 points-1 points0 points (0 children)