Welcome Guest ( Log In | Register )

9 Pages  1 2 3 > » Bottom

Outline · [ Standard ] · Linear+

 Frontend Developers, what's happening?

views
     
TSsilverhawk
post Aug 26 2021, 07:28 PM, updated 7 months ago

I'm Positively Lustrous
Group Icon
Elite
4,534 posts

Joined: Jan 2003


There are some positions open in the company at the moment, so been doing some interviews. We have a warm-up question for the code whiteboarding session that goes like something like this

CODE

Write a function that takes an input number (e.g. 4) and prints:
1 2 3 4
1 2 3
1 2
1


and 90% of the candidates are failing this. All of the frontend candidates could not do this, even after some guidance. The opening is for a senior position with at least 5 years experience. While ability to answer the questions does not determine whether you get the offer or not, I find it quite odd that the warmup question is tripping people up.

Is anyone else facing this issue with their hiring? Should this level of problem solving ability not be expected of frontend devs?
malleus
post Aug 26 2021, 08:58 PM

Look at all my stars!!
*******
Senior Member
2,096 posts

Joined: Dec 2011
would have failed first year uni if not able to do this
FlierMate
post Aug 26 2021, 09:35 PM

On my way
****
Validating
515 posts

Joined: Nov 2020
It took me (as an old-timer) awhile to solve it. Initially I thought single loop was enough, but double loops are necessary. (See https://dotnetfiddle.net/6D78Dv, TQ for the exercise :=)

Maybe this question is too mind-boggling for frontend developers? rclxub.gif By all means, I am not qualified for web frontend tech stack either.


xhruso00
post Aug 26 2021, 09:43 PM

Getting Started
**
Junior Member
63 posts

Joined: May 2018


QUOTE(silverhawk @ Aug 26 2021, 07:28 PM)
There are some positions open in the company at the moment, so been doing some interviews. We have a warm-up question for the code whiteboarding session that goes like something like this

CODE

Write a function that takes an input number (e.g. 4) and prints:
1 2 3 4
1 2 3
1 2
1


and 90% of the candidates are failing this. All of the frontend candidates could not do this, even after some guidance. The opening is for a senior position with at least 5 years experience. While ability to answer the questions does not determine whether you get the offer or not, I find it quite odd that the warmup question is tripping people up.

Is anyone else facing this issue with their hiring? Should this level of problem solving ability not be expected of frontend devs?
*
This looks too simple. Sure it took me 10 seconds to look it has 2 dimensions so nested for loop is necessary. Another solution: 1.Create array of all items 2. Drop last item in each iteration.
TSsilverhawk
post Aug 27 2021, 12:59 AM

I'm Positively Lustrous
Group Icon
Elite
4,534 posts

Joined: Jan 2003


QUOTE(malleus @ Aug 26 2021, 08:58 PM)
would have failed first year uni if not able to do this
*
Pretty much my thoughts, but these are people working in rather reputable companies, some are even leading teams! I'm honestly baffled

QUOTE(FlierMate @ Aug 26 2021, 09:35 PM)
It took me (as an old-timer) awhile to solve it. Initially I thought single loop was enough, but double loops are necessary. (See https://dotnetfiddle.net/6D78Dv, TQ for the exercise :=)

Maybe this question is too mind-boggling for frontend developers?  rclxub.gif    By all means, I am not qualified for web frontend tech stack either.
*
Don't feel bad, even we don't expect people to get it immediately. We just want to see how you think and come to a solution. You came to a solution, so all is good smile.gif

Technically, double loops are not necessary, its just the most straight forward way. Its possible to do it in a single loop. Want to give that a go? biggrin.gif

QUOTE(xhruso00 @ Aug 26 2021, 09:43 PM)
This looks too simple. Sure it took me 10 seconds to look it has 2 dimensions so nested for loop is necessary. Another solution: 1.Create array of all items 2. Drop last item in each iteration.
*
Its meant to be simple, suppose to warm you up and get you comfortable for the harder questions down the road.
flashang
post Aug 27 2021, 10:21 AM

Getting Started
**
Junior Member
175 posts

Joined: Aug 2021


if major task is web app, html + css + javascript should be more appropriate.

design a good question is not easy.

although most of the UI design (layout, animation, verification) could done without script,

at least basic level of coding skill is required.

from the structure of code been used,
you might see if the thought and logic is clear.

it seem can be done with single loop,
but you need some extra control,
which may make the loop - condition not so reading friendly,

as for double loop solution,
which may be more easier to read and understand for most of the people.

this question should not have a "standard answer".
but why they explain why they doing this way.


TSsilverhawk
post Aug 27 2021, 10:31 AM

I'm Positively Lustrous
Group Icon
Elite
4,534 posts

Joined: Jan 2003


QUOTE(flashang @ Aug 27 2021, 10:21 AM)
if major task is web app, html + css + javascript should be more appropriate.

design a good question is not easy.

although most of the UI design (layout, animation, verification) could done without script,

at least basic level of coding skill is required.

from the structure of code been used,
you might see if the thought and logic is clear.

it seem can be done with single loop,
but you need some extra control,
which may make the loop - condition not so reading friendly,

as for double loop solution,
which may be more easier to read and understand for most of the people.

this question should not have a "standard answer".
but why they explain why they doing this way.
*
Yes, there is no standard answer, the problem is that they can't even produce the answer.

You want to do it via nested loop, single loop or even just pop off the array and console.log it at each iteration. I'm ok, as long as you can produce the result and explain the thought process.

The frontend candidates so far seem to think that by asking them questions like these, means we're expecting their workload to be algorithmically heavy and say things like "we don't do calculatiosn in the frontend".
malleus
post Aug 27 2021, 02:56 PM

Look at all my stars!!
*******
Senior Member
2,096 posts

Joined: Dec 2011
QUOTE(silverhawk @ Aug 27 2021, 10:31 AM)
Yes, there is no standard answer, the problem is that they can't even produce the answer.

You want to do it via nested loop, single loop or even just pop off the array and console.log it at each iteration. I'm ok, as long as you can produce the result and explain the thought process.

The frontend candidates so far seem to think that by asking them questions like these, means we're expecting their workload to be algorithmically heavy and say things like "we don't do calculatiosn in the frontend".
*
I'm expect something simple like this to be handled quite often on the frontend
TSsilverhawk
post Aug 27 2021, 04:17 PM

I'm Positively Lustrous
Group Icon
Elite
4,534 posts

Joined: Jan 2003


QUOTE(malleus @ Aug 27 2021, 02:56 PM)
I'm expect something simple like this to be handled quite often on the frontend
*
Yeap, so I asked questions like "don't you do things like receive a result set of rows/columns and have to display them in a table or some sort". And the typical response I get is "we just pass the data into the component and the component renders it". doh.gif

To me, not passing question 1 pretty much disqualifies you as a candidate. However seeing the amount of people failing it, I'm entertaining the idea that my expectations might need adjustment, that's why I'm asking here.

Is it possible for a frontend dev to be any good if they can't solve that question? My thinking is no, but I'm open to be proven wrong.
SaberCortez
post Aug 27 2021, 04:19 PM

Enthusiast
*****
Senior Member
710 posts

Joined: Nov 2012



nested loop enuf no?
tekplyrX
post Aug 27 2021, 04:23 PM

Getting Started
**
Junior Member
140 posts

Joined: Feb 2009
lol, I have met "senior" developers that don't know that using callbacks causes the code to run asynchronously
SaberCortez
post Aug 27 2021, 04:23 PM

Enthusiast
*****
Senior Member
710 posts

Joined: Nov 2012



QUOTE(silverhawk @ Aug 27 2021, 05:17 PM)
Yeap, so I asked questions like "don't you do things like receive a result set of rows/columns and have to display them in a table or some sort". And the typical response I get is "we just pass the data into the component and the component renders it". doh.gif

To me, not passing question 1 pretty much disqualifies you as a candidate. However seeing the amount of people failing it, I'm entertaining the idea that my expectations might need adjustment, that's why I'm asking here.

Is it possible for a frontend dev to be any good if they can't solve that question? My thinking is no, but I'm open to be proven wrong.
*
Too much dependent on framework. that's why
shinichi88
post Aug 27 2021, 04:31 PM

Holy Crusader
*****
Senior Member
939 posts

Joined: Sep 2005
From: Selangor
QUOTE(FlierMate @ Aug 26 2021, 09:35 PM)
It took me (as an old-timer) awhile to solve it. Initially I thought single loop was enough, but double loops are necessary. (See https://dotnetfiddle.net/6D78Dv, TQ for the exercise :=)

Maybe this question is too mind-boggling for frontend developers?  rclxub.gif    By all means, I am not qualified for web frontend tech stack either.
*
Edit from this example.

CODE
Console.Write("Number? ");
 string numS=Console.ReadLine();
 int numI=Int16.Parse(numS);
 while(numI > 0)
 {
  for(int i=1; i<=numI; i++)
  {
   Console.Write(i.ToString() + ' ');
  }
  Console.WriteLine();
  numI--;
 }

Like this will do.

This post has been edited by shinichi88: Aug 27 2021, 04:32 PM
malleus
post Aug 27 2021, 05:10 PM

Look at all my stars!!
*******
Senior Member
2,096 posts

Joined: Dec 2011
QUOTE(silverhawk @ Aug 27 2021, 04:17 PM)
Yeap, so I asked questions like "don't you do things like receive a result set of rows/columns and have to display them in a table or some sort". And the typical response I get is "we just pass the data into the component and the component renders it". doh.gif

To me, not passing question 1 pretty much disqualifies you as a candidate. However seeing the amount of people failing it, I'm entertaining the idea that my expectations might need adjustment, that's why I'm asking here.

Is it possible for a frontend dev to be any good if they can't solve that question? My thinking is no, but I'm open to be proven wrong.
*
It's definitely a red flag. but I think I seen this primarily in ppl who worked a lot with wordpress only who calls into this category.

but there's another question that I have though. These candidates that you interviewed, what's their background? are they working as a web dev in a creative agency? as in, more of a design house or online marketing agency? the tech requirements for these places are rather different.

I've worked with one before where their web dev lead (he's actually more of a web designer than a web dev) does not know how to consume an API. and they had to fall back to making the API request, write the results to DB, then render the results to screen by querying it out of a DB.

sounds very similar to your example of 'we just pass the data into the component'
ragk
post Aug 27 2021, 05:37 PM

BooBoo~
*******
Senior Member
2,241 posts

Joined: Apr 2009


It's really depend on the individual I guess
That's ppl that only stay in their comfort zone, and that's ppl happy with new knowledge and challenge
Guess we have met both of the kind, we just need to spend time to look for the right fit
I have friend who working on the same office and same thing for 10 years using the same technology, can't say they are wrong, maybe just lack of option & oppournity in the future
TSsilverhawk
post Aug 27 2021, 07:16 PM

I'm Positively Lustrous
Group Icon
Elite
4,534 posts

Joined: Jan 2003


QUOTE(tekplyrX @ Aug 27 2021, 04:23 PM)
lol, I have met "senior" developers that don't know that using callbacks causes the code to run asynchronously
*
In JS? I know what you mean, but its not necessarily true.

CODE

let total = 0;
items.forEach((item) => {
 total += item.count;
 });
return total;


This would run synchronously.

QUOTE(malleus @ Aug 27 2021, 05:10 PM)
It's definitely a red flag. but I think I seen this primarily in ppl who worked a lot with wordpress only who calls into this category.

but there's another question that I have though. These candidates that you interviewed, what's their background? are they working as a web dev in a creative agency? as in, more of a design house or online marketing agency? the tech requirements for these places are rather different.

I've worked with one before where their web dev lead (he's actually more of a web designer than a web dev) does not know how to consume an API. and they had to fall back to making the API request, write the results to DB, then render the results to screen by querying it out of a DB.

sounds very similar to your example of 'we just pass the data into the component'
*
They're not in creative agencies, they're in dev companies. I won't name the companies, but they are companies that you expect to have a higher technical requirement/background. Their job isn't wordpress, but a lot of it revolves using angular / reactJS / vueJs for internal/customer facing products.
tekplyrX
post Aug 27 2021, 08:01 PM

Getting Started
**
Junior Member
140 posts

Joined: Feb 2009
QUOTE(silverhawk @ Aug 27 2021, 07:16 PM)
In JS? I know what you mean, but its not necessarily true.

CODE

let total = 0;
items.forEach((item) => {
 total += item.count;
 });
return total;


This would run synchronously. ]
That is true because by default forEach expects a synchronous callback function. If you use an asynchronous function as the callback the code won't work, e.g.

CODE

let ratings = [5, 4, 5];
let sum = 0;

let sumFunction = async function (a, b)
{
 return a + b
}

ratings.forEach(async function(rating) {
 sum = await sumFunction(sum, rating)
})

console.log(sum)
// Naively expected output: 14
// Actual output: 0

kingkingyyk
post Aug 27 2021, 08:24 PM

10k Club
Group Icon
Elite
15,391 posts

Joined: Mar 2008
Obscenely short Python :
CODE
def solution(n: int):
   ans = [' '.join([str(y) for y in range(1,n+2-x)]) for x in range(1,n+1)]
   print('\n'.join(ans))

solution(4)


or maybe nicer.

CODE
def solution(n: int):
   full = [str(x) for x in list(range(1,n+2))]
   for i in range(1,n+1):
       print(' '.join(full[:-i]))

solution(4)


sweat.gif The truth is there are too many incompetent developers here.

This post has been edited by kingkingyyk: Aug 27 2021, 08:30 PM
FlierMate
post Aug 27 2021, 08:31 PM

On my way
****
Validating
515 posts

Joined: Nov 2020
QUOTE(silverhawk @ Aug 27 2021, 12:59 AM)
Don't feel bad, even we don't expect people to get it immediately. We just want to see how you think and come to a solution. You came to a solution, so all is good smile.gif

Technically, double loops are not necessary, its just the most straight forward way. Its possible to do it in a single loop. Want to give that a go? biggrin.gif
*
This is it: (https://dotnetfiddle.net/17WiGT)

CODE

using System;
   
public class Program
{
public static void Main()
{
 Console.Write("Number? ");
  string numS=Console.ReadLine();
  int numI=Int16.Parse(numS);
 for(int i=1; i<=numI*numI; i++)
 {
  Console.Write((i % (numI+1)).ToString() + ' ');
  if ((i % numI)==0)
  {
   i+=i / numI;
   Console.WriteLine();
  }
 }
}
}


Single loop, but MOD and DIV are necessary. Thank you for giving me another chance. icon_rolleyes.gif
Lord Tiki Mick
post Aug 27 2021, 09:34 PM

Regular
******
Senior Member
1,012 posts

Joined: Jul 2012
This is my solution using Java 11. cool2.gif

CODE

public class Answer {
   public static void main(String[] args) {
       var n = Integer.parseInt(args[0]);
       while (n > 0) {
           var sj = new java.util.StringJoiner(" ");
           for (var i = 1; i <= n; i++) {
               sj.add(String.valueOf(i));
           }

           System.out.println(sj);
           n--;
       }
   }
}


Here I use the StringJoiner class, so that the output will not have a trailing space.
I tend use String.valueOf(i) instead of "" + i because I don't know whether the compiler will optimize the later. hmm.gif

Notice that, Java now have var keywordtype. biggrin.gif

9 Pages  1 2 3 > » Top
 

Change to:
| Lo-Fi Version
0.0217sec    0.18    5 queries    GZIP Disabled
Time is now: 31st January 2023 - 01:33 AM