I was just kidding about the young ones; I started as Fortrn IV programmer.
Apparently he does not want for loops in the code, everything must be algorithms and lambda functions for reasons of readability. And if he discovers you don't plan your code top-bottom, he is going to abruptly axe you as well.
This is worrying; one size fits all, no silver bullet. Real life is more subltle. It is obviously a junior developer/HR.
Lambda functions are useful, but not always. They are like Tabasco or Sudden Death... a few drops in the soup before eating ans no more.
Well a std::for_each + lambda function on a range is just a statement technically speaking, and can push aside for-looping on containers quite elegantly.
I flunked his test anyway, he asked for the implementation of an "interval map" (in map: 0->'A'; 1->'B'; 2->'B'; 3->'C' in interval map: 'A'; 1->'B'; 3->'C'; 4->'A').
There are a myriad of corner cases, I think my implementation worked, but I was told one iterator I used got deferenced past the end in one of the "if" branches for corner cases, so undefined behaviour -> fail.
On my compiler (gcc 5.1.0 from 2015 we are at 10.2 currently!) though, everything ran smoothly.
Point is, I needed to add the flag -D_GLIBCXX_DEBUG to my compilation line, in order to get the compiler to exit with a runtime error when stumbling on dereferenced iterators.
Or on any undefined behaviour, I don't know, because a google search on that flag did not produce any result.
In any case -D_GLIBCXX_DEBUG did its work and I caught the bug by myself afterwards.
This is some kind of 'trick of the trade'
C++ thing that separates the wheat from the chaff, there is no way to know it in case you are not an experienced developer.