Job interview questions. Really???? Are these real?
-
@dkf said in Job interview questions. Really???? Are these real?:
@Groaner said in Job interview questions. Really???? Are these real?:
Based on his activity level, Google practically pays him to sit on SO and rack up those sweet, sweet forumpointzzz. That, in my view, is a poor use of time given that he could instead be here anonymously making dick jokes.
Multitasking.
-
@Ascendant said in Job interview questions. Really???? Are these real?:
- "Imagine you have a 100K string filled with just the letters A-Z. >
What is a 100K string? A string that a developer charged 100K USD to write?
-
@Helix probably meant a 100K-long string.
-
@Helix said in Job interview questions. Really???? Are these real?:
What is a 100K string? A string that a developer charged 100K USD to write?
-
@Ascendant Did you get the job?
-
@Groaner said in Job interview questions. Really???? Are these real?:
@Nagesh said in Job interview questions. Really???? Are these real?:
@Groaner Not nice to make fun of Jon Skeet!
Why not? Based on his activity level, Google practically pays him to sit on SO and rack up those sweet, sweet forumpointzzz. That, in my view, is a poor use of time given that he could instead be here anonymously making dick jokes.
I am his follower and he is going through great personal turmoil, I am feeling! Also!
-
@Gąska said in Job interview questions. Really???? Are these real?:
@Helix probably meant a 100K-long string.
Bytes? Characters? Sure it's just an 'A'. But is it a
char
orwchar_t
. Is that wchar_t 16 or 32 bits? We're programmers dammit - we gotta know!
-
@dcon said in Job interview questions. Really???? Are these real?:
@Gąska said in Job interview questions. Really???? Are these real?:
@Helix probably meant a 100K-long string.
Bytes? Characters?
Whatever the string stores in the language in question. IIRC that post was about Java, so it's obvious that 100K refers to number of widechars (not to be confused with number of bytes or number of characters).
-
@stillwater said in Job interview questions. Really???? Are these real?:
@Ascendant Did you get the job?
That's not how it works. You need to wait between two months and two decades for response.
-
@Gąska said in Job interview questions. Really???? Are these real?:
@stillwater said in Job interview questions. Really???? Are these real?:
@Ascendant Did you get the job?
That's not how it works. You need to wait between two months and two decades for response.
Yeah. I hate job searching... But I'm not willing to lower myself to working on Javascript - so I search.
-
@Gąska said in Job interview questions. Really???? Are these real?:
That's not how it works. You need to wait between two months and
two decadesforever ("*crumple-crumple* we loft tfe papefwohk") for response.
-
@dcon said in Job interview questions. Really???? Are these real?:
@Gąska said in Job interview questions. Really???? Are these real?:
@stillwater said in Job interview questions. Really???? Are these real?:
@Ascendant Did you get the job?
That's not how it works. You need to wait between two months and two decades for response.
Yeah. I hate job searching...
It's worth noting that it's very American thing - here in Poland, for example, you never have to wait more than a week. Though that's probably there's as many open positions here as there are working developers, and all economists say it'll only get worse (ie. better for us, developers).
-
@Gąska said in Job interview questions. Really???? Are these real?:
@dcon said in Job interview questions. Really???? Are these real?:
@Gąska said in Job interview questions. Really???? Are these real?:
@stillwater said in Job interview questions. Really???? Are these real?:
@Ascendant Did you get the job?
That's not how it works. You need to wait between two months and two decades for response.
Yeah. I hate job searching...
It's worth noting that it's very American thing - here in Poland, for example, you never have to wait more than a week. Though that's probably there's as many open positions here as there are working developers, and all economists say it'll only get worse (ie. better for us, developers).
The same in Hong Kong too. Newbies may have some trouble finding new job, but whenever you survive a programming job more than 2 years without changing, you prove that you can code and you shouldn't have much trouble finding a new job. (Unless you set the target wage too
highambitious, of course)
-
@cheong said in Job interview questions. Really???? Are these real?:
(Unless you set the target wage too
highambitious, of course)I've yet to see that here. International corporations are very generous.
-
@Gąska said in Job interview questions. Really???? Are these real?:
It's worth noting that it's very American thing - here in Poland, for example, you never have to wait more than a week.
Here, it depends on how many people are being interviewed for how many positions. If there's several equivalent positions open at once, at least some of the offers will be made very rapidly, but the final offer of the set can't be done until everyone has been interviewed (of the shortlisted people, of course). This makes hiring at senior level — where posts tend to be singular and people highly committed already — a fairly slow process. You'd think that they'd try to get the people they believe they're most likely to hire in first, but life doesn't work like that…
-
@Nagesh said in Job interview questions. Really???? Are these real?:
@Groaner said in Job interview questions. Really???? Are these real?:
@Nagesh said in Job interview questions. Really???? Are these real?:
@Groaner Not nice to make fun of Jon Skeet!
Why not? Based on his activity level, Google practically pays him to sit on SO and rack up those sweet, sweet forumpointzzz. That, in my view, is a poor use of time given that he could instead be here anonymously making dick jokes.
I am his follower and he is going through great personal turmoil, I am feeling! Also!
I could say quite a few things about those, but as this would be the wrong thread to do so, I'll just say that it looks like Google is a good fit.
-
@dcon said in Job interview questions. Really???? Are these real?:
@Gąska said in Job interview questions. Really???? Are these real?:
@Helix probably meant a 100K-long string.
Bytes? Characters? Sure it's just an 'A'. But is it a
char
orwchar_t
. Is that wchar_t 16 or 32 bits? We're programmers dammit - we gotta know!I wish Microsoft had waited for UTF-8 so we didn't have to deal with this widechar nonsense. It's annoying having to roundtrip between
std::string
andstd::wstring
every time I need to work with file paths when the rest of the application deals in UTF-8.
-
@cheong said in Job interview questions. Really???? Are these real?:
(Unless you set the target wage too
highambitious, of course)It's tiresome dealing with 23-year-olds who assume they're immediately entitled to a 90th+ percentile senior salary. A few friends wanted six figures or near that amount as they were starting out and they had to learn the hard way.
-
Since blakey is apparently absent to rant about this kind of questions, I'll have to be the one to do it: yes, IMO these questions are bad
In my opinion, programming skill is composed of separate skills:
- Algorithmics (knowing how to achieve complex operations from loops and conditionals).
- Understanding the environment you have to work with (in this case, the Java language, the Java web server, the HTTP protocol, HTML, and web browsers).
- Knowing how to produce readable and maintainable code (software engineering I guess?)
These questions only test 1 (except the ACID one). Whereas for the average web project, you just need a basic amount of that kind of knowledge. Whereas 2 and 3 are massively important and just as easy to test.
Compare someone who doesn't know how to work with a linked list or how to parse parentheses, vs someone who doesn't know how generics work, how to do authentication the right way, the basics of Unicode, or why it's important to divide unrelated bits of code into their own functions.
-
@Groaner said in Job interview questions. Really???? Are these real?:
A few friends wanted six figures or near that amount as they were starting out and they had to learn the hard way.
If they want a six figure salary as a noob, they can just count it in cents. If they're lucky they might even have a seven figure salary if they do that!
-
@Gąska said in Job interview questions. Really???? Are these real?:
The second is about bucket sort - instead of sorting in-place, you make an array of 256 integers - one for each possible char value - and count each character's occurences, then build the result string from that. I was actually asked this exact question on my own interview last Tuesday. I failed.
Except in the question here, the letters are supposed to be in the order that they appeared, so you'll also need a list to keep track of which character comes next.
-
@Groaner said in Job interview questions. Really???? Are these real?:
@Ascendant said in Job interview questions. Really???? Are these real?:
- How do you know if a linked list has a cycle in it? As in, one of the nodes in the linked list points to a previous node in the list.
This is pretty easy. Just keep a list of all known nodes as you traverse the list and check for the existence of a node against this list for each new node you encounter.
I was asked this in an interview. After I suggested this as a solution, they asked what if the memory is limited so that another list is unfeasible? When I admitted I didn't know, they explained that a mathematical solution would be to create two pointers (it was in C++) into the list, and have them step through at mutually prime rates (e.g. every other node and every third node, every 33rd and 47th nodes, etc.), and then if they ever become equal (besides the start or the null next node reference at the end), then the list cycles.
-
@Nagesh said in Job interview questions. Really???? Are these real?:
first day at school
the other children look into me
for sign of similar fearSyllable pattern... (4-9-7)...
Recalling definition.... (5-7-5)...
Thus: not a haiku.
-
@djls45 said in Job interview questions. Really???? Are these real?:
I was asked this in an interview. After I suggested this as a solution, they asked what if the memory is limited so that another list is unfeasible? When I admitted I didn't know, they explained that a mathematical solution would be to create two pointers (it was in C++) into the list, and have them step through at mutually prime rates (e.g. every other node and every third node, every 33th and 47th nodes, etc.), and then if they ever become equal (besides the start or a null next node reference at the end), then the list cycles.
I lost interest in working for the company halfway through that. Fuck that shit.
-
@stillwater It was my mention of C++, wasn't it?
-
@stillwater said in Job interview questions. Really???? Are these real?:
and have them step through at mutually prime rates
This. I've never written any c++ so I'm unaware of how bad it is.
-
@stillwater Bad.
-
@djls45 said in Job interview questions. Really???? Are these real?:
I was asked this in an interview. After I suggested this as a solution, they asked what if the memory is limited so that another list is unfeasible? When I admitted I didn't know, they explained that a mathematical solution would be to create two pointers (it was in C++) into the list, and have them step through at mutually prime rates (e.g. every other node and every third node, every 33rd and 47th nodes, etc.), and then if they ever become equal (besides the start or the null next node reference at the end), then the list cycles.
This reminds me of the eight weights balance scale problem. Three comparisons is simple and elegant and works for values other than eight, but you can actually do it in two comparisons in a clever manner that would likely get the implementer brutally murdered by his/her coworkers if s/he ever put something like it into production.
-
Everytime we saw fancy dancing SQL written to solve a simple problem it always turned out to be the cunt who spent too many hours on hackerrank. People who get algorithmic boners are the worst. Mannnnnnnnnnnnnnnn, the kind of shit that I had to unfuck. UNREAL!!!!!!
-
@pie_flavor said in Job interview questions. Really???? Are these real?:
@stillwater Bad.
You're the Rust guy. How do i know you're not biased?
-
@stillwater My go-to example: Templated return types that depend on templated parameter types were very difficult to get to compile for the longest time, because the return type gets parsed first since it comes first. Rather than having the compiler not be so obtusely linear that it could potentially parse an entire function header at once, they instead invented an entirely new function syntax with the return type taking place lexically after the parameter types (from
R foo(A a)
toauto foo(A a) -> R
) so that this thing could work.
-
@stillwater said in Job interview questions. Really???? Are these real?:
@stillwater said in Job interview questions. Really???? Are these real?:
and have them step through at mutually prime rates
This. I've never written any c++ so I'm unaware of how bad it is.
It's like C#, except:
- No garbage collection
- All instantiated variables are like
IDisposable
s that get automatically cleaned up when they go out of scope - Constructors and destructors are actually important (unlike finalizers, which may never actually run)
class
andstruct
can both either live on the stack or on the heap- You need to think carefully when you type
new Foo()
- Code is compiled straight to machine language
- No God object
- Multiple inheritance is not restricted to interfaces (and interfaces aren't a language construct).
- No reflection unless you count
template
tricks (but I hear that's changing). - No
finally
(this is only really a problem in certain corner cases if you're trying to mimic transactional semantics) - Every library you use might use its own special string class (even though
std::string
has been around forever), and you will need to convert between aQString
, aRakString
and perhaps several others frequently, probably by calling a method that looks likec_str()
- Compiling can take a much longer time if you're not using precompiled headers and/or you include ALL THE FILES in every
.cpp
file. - No LINQ (unless maybe you're doing C++/CLI, but you get your own special C++11 stuff instead)
-
@Groaner said in Job interview questions. Really???? Are these real?:
No God object
No God class. The class hierarchy is a forest. (God objects are still possible; they're a program design issue, not a language design issue.)
No reflection unless you count
template
tricks (but I hear that's changing).Well, there's RTTI which everyone turns off…
-
@stillwater said in Job interview questions. Really???? Are these real?:
@stillwater said in Job interview questions. Really???? Are these real?:
and have them step through at mutually prime rates
This. I've never written any c++ so I'm unaware of how bad it is.
To be fair, it was a business data analytics company, so they were looking for someone who was fairly heavy into mathematics to help write their library and database software.
Mutually prime simply means that the only shared factor in the numbers if you break them down into their prime factorizations is 1.
E.g. any two prime numbers are trivially mutually prime. 4 and 9 are also mutually prime, because 4=2×2 and 9=3×3, and there is no intersection between {2,2} and {3,3}. Or 12 and 175, because 12=2×2×3 and 175=5×5×7, and {2,2,3} does not overlap with {5,5,7}.
-
@djls45 said in Job interview questions. Really???? Are these real?:
@Gąska said in Job interview questions. Really???? Are these real?:
The second is about bucket sort - instead of sorting in-place, you make an array of 256 integers - one for each possible char value - and count each character's occurences, then build the result string from that. I was actually asked this exact question on my own interview last Tuesday. I failed.
Except in the question here, the letters are supposed to be in the order that they appeared, so you'll also need a list to keep track of which character comes next.
Except
char
is a primitive type, so all equal instances are interchangable.
-
@djls45 said in Job interview questions. Really???? Are these real?:
Mutually prime
The correct term is “coprime”.
-
@djls45 said in Job interview questions. Really???? Are these real?:
@stillwater said in Job interview questions. Really???? Are these real?:
@stillwater said in Job interview questions. Really???? Are these real?:
and have them step through at mutually prime rates
This. I've never written any c++ so I'm unaware of how bad it is.
To be fair, it was a business data analytics company, so they were looking for someone who was fairly heavy into mathematics to help write their library and database software.
Mutually prime simply means that the only shared factor in the numbers if you break them down into their prime factorizations is 1.
E.g. any two prime numbers are trivially mutually prime. 4 and 9 are also mutually prime, because 4=2×2 and 9=3×3, and there is no intersection between {2,2} and {3,3}. Or 12 and 175, because 12=2&×2×3 and 175=5×5×7, and {2,2,3} does not overlap with {5,5,7}.I don't see how that requirement makes sense. You can use 1,2 or 2,4 (which isn't coprime) just the same. The smaller one will only ever be able to catch up to the latter if there's a loop, no matter what's prime or not.
Of course, that's a stupidly useless and convoluted algorithm.
-
@pie_flavor said in Job interview questions. Really???? Are these real?:
@Groaner Gotta love that O(n)
list.len()
. Why wouldn't you store the length?The answer to that question, if I'm not mistaken, is to allow constant time splicing.
When are you ever going to need that, you ask? Well, almost never, which is just as often as you need a linked list in the first place.
-
@Groaner said in Job interview questions. Really???? Are these real?:
No
finally
(this is only really a problem in certain corner cases if you're trying to mimic transactional semantics)But easy enough to simulate using a class on the stack. Because destructors actually run when the object goes out of scope.
-
@topspin Catching up is not enough; the two pointers need to actually land on the same element, and there are combinations of step sizes, distance to loop start, and loop length, where the two loops end up moving in sync in some fashion without ever visiting the same elements.
However I can't think of any counter-examples offhand.
-
@Gąska said in Job interview questions. Really???? Are these real?:
@djls45 said in Job interview questions. Really???? Are these real?:
@Gąska said in Job interview questions. Really???? Are these real?:
The second is about bucket sort - instead of sorting in-place, you make an array of 256 integers - one for each possible char value - and count each character's occurences, then build the result string from that. I was actually asked this exact question on my own interview last Tuesday. I failed.
Except in the question here, the letters are supposed to be in the order that they appeared, so you'll also need a list to keep track of which character comes next.
Except
char
is a primitive type, so all equal instances are interchangeable.I think you misunderstand.
As an example, withABCJABJDFYSKEDD
as input, the simple bucket sort solution would produceAABBCDDDEFJJKSY
, but the problem is asking forAABBCJJDDDFYSKE
as the solution.
-
@djls45 said in Job interview questions. Really???? Are these real?:
As an example, with
ABCJABJDFYSKEDD
as input, the simple bucket sort solution would produceAABBCDDDEFJJKSY
, but the problem is asking forAABBCJJDDDFYSKE
as the solution.I'd find that surprising given the wording, but even so it's just a matter of keeping a note of what index you saw the first instance of a particular character at, then using that to determine what order you emit the bucket contents in. (For the record, if I was asking the question I'd expect ordinary sorting, but would accept the other way if the person taking the test could explain why they thought I meant that.)
-
@topspin said in Job interview questions. Really???? Are these real?:
@djls45 said in Job interview questions. Really???? Are these real?:
@stillwater said in Job interview questions. Really???? Are these real?:
@stillwater said in Job interview questions. Really???? Are these real?:
and have them step through at mutually prime rates
This. I've never written any c++ so I'm unaware of how bad it is.
To be fair, it was a business data analytics company, so they were looking for someone who was fairly heavy into mathematics to help write their library and database software.
Mutually prime simply means that the only shared factor in the numbers if you break them down into their prime factorizations is 1.
E.g. any two prime numbers are trivially mutually prime. 4 and 9 are also mutually prime, because 4=2×2 and 9=3×3, and there is no intersection between {2,2} and {3,3}. Or 12 and 175, because 12=2×2×3 and 175=5×5×7, and {2,2,3} does not overlap with {5,5,7}.I don't see how that requirement makes sense. You can use 1,2 or 2,4 (which isn't coprime) just the same. The smaller one will only ever be able to catch up to the latter if there's a loop, no matter what's prime or not.
Do you mean the sets of factors {2} and {2,4} ({2,2,2}) for steps of 2 and 8, or do you mean steps of 1 and 2 or steps of 2 and 4?
If they start at the same node (which they should — the head of the list) and if the cycle contains an even number of items, then the stepping iterators will never hit the odd-numbered nodes of the loop.
I think a step of 1 and anything else would work. 1 is not considered to be a prime number, though. I think it may have been specifically excluded from the problem.Of course, that's a stupidly useless and convoluted algorithm.
I guess it depends on the requirements.
-
@djls45 said in Job interview questions. Really???? Are these real?:
@Gąska said in Job interview questions. Really???? Are these real?:
@djls45 said in Job interview questions. Really???? Are these real?:
@Gąska said in Job interview questions. Really???? Are these real?:
The second is about bucket sort - instead of sorting in-place, you make an array of 256 integers - one for each possible char value - and count each character's occurences, then build the result string from that. I was actually asked this exact question on my own interview last Tuesday. I failed.
Except in the question here, the letters are supposed to be in the order that they appeared, so you'll also need a list to keep track of which character comes next.
Except
char
is a primitive type, so all equal instances are interchangeable.I think you misunderstand.
As an example, withABCJABJDFYSKEDD
as input, the simple bucket sort solution would produceAABBCDDDEFJJKSY
, but the problem is asking forAABBCJJDDDFYSKE
as the solution.It does say "sorted". And I'm pretty sure it didn't refer to sorting the groups of identical letters, since sorting doesn't make sense there.
-
@Gąska said in Job interview questions. Really???? Are these real?:
@djls45 said in Job interview questions. Really???? Are these real?:
@Gąska said in Job interview questions. Really???? Are these real?:
@djls45 said in Job interview questions. Really???? Are these real?:
@Gąska said in Job interview questions. Really???? Are these real?:
The second is about bucket sort - instead of sorting in-place, you make an array of 256 integers - one for each possible char value - and count each character's occurences, then build the result string from that. I was actually asked this exact question on my own interview last Tuesday. I failed.
Except in the question here, the letters are supposed to be in the order that they appeared, so you'll also need a list to keep track of which character comes next.
Except
char
is a primitive type, so all equal instances are interchangeable.I think you misunderstand.
As an example, withABCJABJDFYSKEDD
as input, the simple bucket sort solution would produceAABBCDDDEFJJKSY
, but the problem is asking forAABBCJJDDDFYSKE
as the solution.It does say "sorted". And I'm pretty sure it didn't refer to sorting the groups of identical letters, since sorting doesn't make sense there.
@Ascendant said in Job interview questions. Really???? Are these real?:
"Imagine you have a 100K string filled with just the letters A-Z. (for example "ABCBEZBAEBSHJIABHKJIH.....") Write a function that will sort the string so that all of the As are together, all the Bs are together, all the Cs, etc. -- and in order".
It says how to sort the string, and then specifies simply "in order." I suppose it could be up to the interviewee to ask for clarification whether "in order" means "in alphabetical order" or "in order of appearance."
-
@djls45
s/sort(ed|ing)/in order/g
on my post.
-
@djls45 The later, i.e. either one doing 1 step the other 2, or 2 and 4.
Well, anything with 1 should work, maybe the second set doesn’t work, I’m not sure anymore.
-
@dkf said in Job interview questions. Really???? Are these real?:
Well, there's RTTI which everyone turns off…
I don't. Don't you need it for stuff like
dynamic_cast
?
-
@topspin said in Job interview questions. Really???? Are these real?:
@djls45 The later, i.e. either one doing 1 step the other 2, or 2 and 4.
Well, anything with 1 should work, maybe the second set doesn’t work, I’m not sure anymore.This : See tortoise and hare it’s not rocket science.
-
@Groaner said in Job interview questions. Really???? Are these real?:
I like the Game Programmers' Container Selection Guidelines:
- If it has less than about sixteen elements, use an array or array-like container.
- Otherwise, use the data structure you would normally use.
Nothing to do with this article that popped up first when searching, then: https://techbeacon.com/essential-guide-software-containers-application-development
It talks about using something called a Docker instead....