Is this not a softball coding question?? Are my candidates just weeeeaaaakkk?

I'm interviewing candidates for a Senior C# .Net developer position. I'm expecting these assholes to be able to like.. code.. and make things that are efficient so that they don't turn the application to buggy slow ass shit for paying customers.
None of them can write a function that takes a string of text like "the dog ate the steak" and give me a count of every word in the sentence, like {"the": 2, "dog": 1, "ate": 1, "steak": 1}. They don't even seem to know that associative collections exist like Dictionary, or sometimes even how to split a string on spaces.
Is this ninja ass shit for someone with 5+ years of experience, or is this like... easy? Am I going insane? On the west coast I wouldn't hire an intern that couldn't do this. East coast enterprise developers are... special.

Attached: wtfcat.gif (200x125, 675K)

Post that picture with the worst interviews.

out = {}
for word in "the dog age the steak".split(' '):
if word not in out:
out[word] = 1
else:
out[word] += 1

print(out)


eurofag student here, probably cleaner way to do it but meh. Also desu it's possible if I felt stressed in an interview my mind could blank.

Most people are fucking brainlets. I would be so lucky if I got asked easy questions like that., usually senior dev interviews have algos.

17 years experience listed on the resume, and the result was a kind of fever dream mashup of c# and javascript like
string function countWords(string words) {
var out
out = words.count(fn(words) {words.split(" ")})
return out[0]
}
I don't even know....

Attached: tmnt-derp.jpg (360x360, 9K)

python in a c# interview, total power move

A 'scrum master' is born.

That's close to my python reference implementation. The only thing I'd do to clean it up 'get' to eliminate the if, but I wouldn't count that against anyone.
out[word] = out.get(word, 0)

More stories like this. What's the worst canidate you had?

sentence.split(‘ ‘).reduce((word, map) => {
if (map[word]) {
map[word]++;
} else {
map[word] = 1;
}
return map;
}, {});

Tranny feminist started waving around her floppy cock calling me a racist

Lol

Since I'm a lispfag by night, its instahire if they can trot out some clojure
(defn countWords [words] (reduce #(update %1 %2 (fnil inc 0)) {} (string/split words #" ")))
(countWords "a dog ate a poo")
{"a" 2, "dog" 1, "ate" 1, "poo" 1}

Attached: lisp_cycles.png (640x211, 37K)

he won't becasuse its a creative "do my homework" thread/

Honestly, if your method signature isn't:
>protected IDictionary fn(string s, IDictionary d = new Dictionary()){}
then you are not worth hiring.

>.Net
That's why.

Ask them how to fill in a TPR report, draw a Enterprise Architecture Diagram or implement an IAbstractCustomerReportGeneratorFactory and they'll be right at home.

I am doing things like this in my introduction to programming class

Is my intro to programming class literally preparing me for senior programming positions?

>>> Counter('the dog ate the steak'.split(' '))
Counter({'the': 2, 'dog': 1, 'ate': 1, 'steak': 1})

I dont get it - .Net doesn't have to be so terrible. Even had anonymous functions/lambdas before Java, but somehow the people who use it are almost always retards who build shitty bloated enterprise turdware.

>>> Counter('the dog ate the steak'.split(' '))
Traceback (most recent call last):
File "", line 1, in
NameError: name 'Counter' is not defined


Oh you didn't import collections? We'll be in touch.

The most depressing one was a phone screen, so I don't have actual code, but it might have actually worked if pushed further- it was just O(N^2) for no good reason.
He wanted to split the sentence, and then iterate over each word, and do a regex search on the whole sentence for each word and then iterate over an output array, again for each word found, to find the word and increment a counter. I guess the array would have some class with a string and an int. He wasn't clear on that part. 15 years experience.

Attached: udderwalk.gif (840x514, 169K)

Also desu it's possible if I felt stressed in an interview my mind could blank.
That is fatal for any interviewee. The ability to remain composed when faced with a problem you don't already know the answer to is a super valuable trait, as is being able to ask questions about things you don't understand.

Attached: 1524637208136.png (2752x4342, 742K)

It's a better start than a lot of candidates...

How is the perf on this one for anyone that has experience on C#? Does it do string views in the background? I'd imagine this to be really slow for huge strings because the regex evaluates strictly instead of lazily.

Attached: unknown.png (436x367, 13K)

>O̶n̶ ̶t̶h̶e̶ ̶w̶e̶s̶t̶ ̶c̶o̶a̶s̶t̶ ̶ In an area that is mostly white and east asian, I wouldn't hire an intern that couldn't do this. ̶E̶a̶s̶t̶ ̶c̶o̶a̶s̶t̶ "Diversity" enterprise developers are ... special.
Fixed that for you.

Nah, they all old white farts.

I agree.

On the flipside, I've failed this intro course twice and I'm on my third (and last possible) try now. If I fail again I can't continue my degree anymore. I'll either have to transfer credits to another university and/or hope I can find work with what I've learned so far with no degree/diploma.

>East coast enterprise developers
your HR is only letting through "people persons" that will make good managers but terrible developers. I've been applying for enterprise dev jobs and have still yet to get to an in-person interview because they always ask me leadership bullshit and I haven't figured out what the "correct" answers are to their questions.

Let me guess ... working for Amazon?

If so ... Welcome to DC, where most employees can't effectively wipe their ass

from collections import Counter
import sys
print(Counter(sys.argv[1].split()))

Are you able to remember enough of the keywords, syntax, and standard library for C# to do the stuff in the OP without looking at any documentation?
It's not just that you can do it, it's that you can do it from memory without help from an IDE, Google or a book.
I imagine a lot of candidates in OP's interview are trying to switch technologies, and it's quite a pain in the ass to memorize syntax, semantics and standard library functions for a new language that you aren't even sure you're gonna be able to get a job in.
And honestly, even for someone with experience in the language, how often do you have to split sentences into words? Not often I think. That kind of shit can be googled in 10 seconds, on the other hand knowledge about high level architecture or math is much harder to search and understand on the fly.

>tfw so hardcore programmer, you write an entire article in C comments.

Burger diploma mills at work.

No, this should not be hard. But now you see why tech companies in the USA import a lot of people.

This is how I'd do it. Map/reduce whenever you can, kids.

>see sharp
>ASPIE.NET
maybe ask them what their favorite Bollywood movie is

No, they import them because foreigners are more willing to be contractors, and contractors are more disposable than regular employees.

The only scenario where foreigners are better than domestic coders is when they went to an American school to get their CS degree because Indian colleges are notoriously bad at teaching modern CS concepts (they still use TurboC to teach programming in a lot of cases). However, most of the ones that get degrees in the US cheat off of each other, so even then they're not that much better than burgers when it comes to programming.

Source: I went to an American college whose CS program was full of Indians here on education visas; so many of them used a cheating network that most white students had at least one Indian friend handy to get by.

Can't into C#, but yea, easy:
"the dog ate the steak".split(" ").groupBy(identity).view.mapValues(_.length) foreach print

>why is the answer a double?
>because it needs to store the value taken from _two_ variables
really makes you think

Software development is one of the career paths that doesn't require a hard degree and practicing license like being a doctor, dentist, or lawyer - mostly due to the fact that the demand is currently so high. The end result is that you get wannabes.

Also, no. A first semester computer science student should be able to do that. They're trying to fake their way through. This is why you're getting retards.

> Source: I went to an American college
Yea, that's exactly part of the burger diploma mills I'm talking about? A lot of these poorly educated people [and some equally poorly educated native burgers] *graduate* from your crappy diploma mills. The odd person is good on their own efforts, but you can't rely on that for shit.

The foreigners I was referring to are foreign-educated, generally by not diploma mill institutions. Also they aren't just Indians, but EU Europeans, Japanese, Russians, Chinese, ...

A lot of your software tech companies would completely sink / have to leave without them. The few good US universities that aren't diploma mills can't nearly match demand for anything more qualified than maybe basic IT staffers.

Sirs and Ma'ams: Please prepone the needful and refactor for enterprise
#include
#include
#include

struct word {char *text; int count;};

struct
word *add_word(struct word *w, int *elements, char *s, int n)
{
w = realloc(w, ((*elements) + 1) * sizeof *w);
w[*elements].text = malloc(strlen(s) + 1);
strcpy(w[*elements].text, s);
w[*elements].count = n;
(*elements)++;
return w;
}

void
free_word(struct word *w, int elements)
{
for (int i = 0; i < elements; i++)
free(w[i].text);
free(w);
}

you are hired alpha C

histplot(string.remove(' '))

How the fuck am I unemployed if this is all they are asking for?

there are multiple candidates there that might be good programmers but just don't know the modulo operator
and without that you are pretty much fucked
>inb4 autist come in and suggest bitwise shifting and shit

Fuck you OP I could do this shut in my sleep since I was 17 and I'm out of work for a year now. Hire me you fucking xigger I'm in jew york

You're not malaysian.

fuck yeah that's a softball question. they're all shit if they can't even imagine a solution to this problem

>inb4 autist come in and suggest bitwise shifting and shit

for (int i = 0; i < 100; i++)
{
if (i & 1)
{
cout

This is my problem with coding question during interviews in general.
They don't test how well you actually know how to code, just how much you studied "interview questions" before the interview.

I've noticed that the companies that do coding questions during interviews tend to not really need someone to fill the position in question.
Either they have so many people applying that they can throw out applications over nothing or they hire often in cycles to keep employee salaries low.
All of the best interviews/jobs I've had have been with companies that just asked me about my experiences and the qualifications on my resume to verify I wasn't lying.

train them you entitled HR kike

You know you can just go from 1 to 100 with the increment of 2.

>bitwise shifts
>it's operator was overloaded

if a programmer doesnt know modulo, he cant be a good programmer. Its one of the first things we learned in my intro to programming class.

>None of them can write a function that takes a string of text like "the dog ate the steak" and give me a count of every word in the sentence, like {"the": 2, "dog": 1, "ate": 1, "steak": 1}. They don't even seem to know that associative collections exist like Dictionary, or sometimes even how to split a string on spaces.
I can do that but would need language reference, only know a little python. Could split at spaces but what if there is two or other whitespace. Have to take punctuation, hyphens, quotes, character case, odd éürö çrâp, character-type-format-thing like is it Unicode or ascii into account. What if there's numbers
If I'm writing a regular expression I'll need the reference. Get me a coffee.

I'm 28 and have been building pc's / dicking around with OS optimization and even light web dev(hosting shit on digital ocean).

If I get into a Jr. Level job for dev before I'm 30, how fucked am, I really? It seems like most of the mid level meme coders I meet are 30-35 anyway.

Attached: 1548466009103.jpg (1159x896, 431K)

companies like google were formed by academics so their hiring practices are very much based around interviews like it is a graduate course. other companies won't even give you the time of day if you don't have experience with their software stack and frameworks.

doing what ?

if you get a real dev position you never have to get another job as your compensation is based on yearly review.

I cannot comprehend needing to study "interview questions" of the sort posted by OP if you are a seasoned programmer. They should be your bread and butter. You should be able to solve them almost without thinking. They check that you can function as a programmer. OP's question is barely above fizzbuzz difficulty.

I mean if you are a soulless normie and your idea of programming is boring / textbook stuff. If you do real program development you will be jumping between languages and application domains constantly and you will 100% have to study. One of the big projects I am working on now has no string manipulation at all if I work on that for a while can't expect to pass a random interview on the spot about it.

Kek'd

low-effort haskell
nameCount xs = HashMap.fromListWith (+) $ zip (words xs) (repeat 1)

Came here to post this. Any more like these?

I'm not a professional programmer, but I can program just fine in any of the common OOP languages if I'm allowed to google everything, albeit obviously slower than anyone who has tons of experience with that particular language obviously.
For example:
What function was it again? StringUtils.split(mystr, " ")? mystr.split(" ")? Does it split the string in-place or give me a splitted copy as a return value? What was the name for the dictionary type again? Can I insert new keys just by doing words["current_word"] = word, or do I need to do something like words.newKey("current_word") and then assign it? Am I allowed do words["current_word"]++?
Sure, I obviously wouldn't apply for a C# senior dev position because I'm not even a programmer in the first place, but I imagine somebody coming from, say, Java, would have almost the same difficulties as me, and I've been told by some programmers that generally programmers of one language can apply to programming jobs in other languages just fine. Have I been mislead in that respect? Maybe not a senior position, but somebody fresh out of undergrad should be able to apply to any junior programming language job (to the extent that these exist) without knowing the details of the language, right? What about an experienced programmer who can't find work in his language? Is downgrading to a junior position the only option? This isn't like law or medicine where the fields just not fall in dis-use out of the blue, unlike languages and technologies in general.

>I mean if you are a soulless normie and your idea of programming is boring / textbook stuff
Like who? I can't think of anyone who considers programming memorizing the basic features of random programming languages. Some kinda mislead people who want to learn programming, maybe?

Actual CS people. It's common just to do toy algorithms using the standard library and calling it a day. Lots of smart people would not be able to ship an application.

Well, maybe, but I imagine CS has more to do with learning the algorithms than learning the features of the languages, unless the person was actually researching or learning the difference between the features of different languages, but even then the focus tends to be on actually interesting shit such as the differences in the object model between, say, Python and Smalltalk, and not the standard library and things such as how to split a string, and again languages themselves are just a small portion of CS that not many people give a shit about, I think the focus is more on the things that can be done with the languages (operating systems, networking, sorting algos, statistical or compression algos, etc)

Yeah except that's not a generalized solution to the problem. That breaks down in the follow up question where OP asks you to move your work into a function that can take an arbitrary range (to test your refactoring ability.) You are then thoroughly ass-raped when OP calls that function w/ a range that starts with an even integer.

It's an interview, with a human being. You can say things like "This might be syntactically incorrect C#, since I wrote more Java in my last position, but the gist of it is you do to the string, and then iterate over the results and update the count in a hash table. I believe it'd look something like this . . ."

Interviewers don't give a fuck if you forget if the lambda syntax uses a fat arrow or skinny arrow, or if you accidentally imported "HashMap" instead of "Dictionary". They care that you know basic datastructures (arrays, sets, tables), and can demonstrate a cursor grasp of discrete mathematics (modulo arithmetic or bit masking, etc.), and most importantly that you have enough fucking social skills to admit when you don't have all the pieces.

During a programming interview you are conversing with a peer that uses StackOverflow just as much as you do. They're not expecting you to be a walking reference for the standard library, they just want you to have enough social & problem solving skills to be able to reach the answer. These people failed not because they had a brainfart on a modulo operator or bitwise arithmetic; they failed because they *gave up* instead of employing some critical thinking and trying to work through the problem with OP.

document.write('The dog ate a steak')

I'll settle for $75k

Attached: Baitom Hearts.jpg (586x540, 91K)

C#/.NET desktop application development at first, but I'm interested in blockchain/smart contracts/machine learning stuff too but these topics especially ML/AI are a bit further down the road, also really interested in data science. But yeah just trying to get a job so I can stop being a poorfag, starting with c#/.net

Be as cocky as possible, slightly demeaning of others (except your bosses/interviewers/etc), spout some bullshit about teamwork and how technology improves stuff and all. Do take excessive pride in stuff you did that's a notch above trivial.

On interviews you must be an actor above everything else.

How? Do you lie, or just brag so much that normies actually believe it?

The thing I can't stand is that this basic manipulation works all the time!!

Attached: 1528981263174.jpg (800x764, 123K)

Threads like this are why I do not want to be a .NET developer

He's looking for senior developers. They've supposed to already know intern level shit, you double nigger.

tl;dr

ending in odd and then +2 actually seems like a good candidate
it's a good expression of logic

>float f = 1.2f;
*blocks ur path*
psh, nothin' personnel kid

#!/usr/bin/env python3

def main():
text = "la calculadora la mesa"
tolist = text.split(' ')
palabras = {}

for x in tolist:
if x not in palabras.keys():
palabras[x] = 1
else:
palabras[x] += 1

print(palabras)

if __name__ == '__main__':
main()


Is that niggerlicious?

How bruh?

>coding in spanish
get out

GET OUT

>Programming in Spannish
Build the Firewall

Attached: 1528811175881.jpg (720x833, 27K)

In J this is just
((],.[:

wtf this is literally an example you learn in data structures

LA PAELLA LA CHANCLA

Oh shit I think I know this one hang on
public class Dog extends Animal {

str = "the dog ate the steak"

str
|> String.split(" ")
|> Enum.group_by(& &1)
|> (fn map -> for {k, v} 1, "dog" => 1, "steak" => 1, "the" => 2}


This took me longer than expected because I had no idea how to pipe into an anonymous function

Holy christ on a cracker. That's even more unreadable than Perl. If you ever do land a job at least you'll have the ultimate job security. Even if they manage to find J devs to replace you: the company will forever be plagued w/ serial IT suicides.

Took me more than 30 minutes to solve this in Swift
> pic related

rate my code, also am I too slow?

Attached: wew.png (2084x1824, 477K)

This is my question. I can't figure out the market to save my fucking life.

On one hand all I hear is:
>we need programmers
>most candidates can't code
>why aren't there more programmers?
>if you can program you have a golden ticket six figures easy street

On the other hand:
>i can't land interviews and get by doing contract work

I know C, C++, C#, Objective C, VB.NET, PHP, JavaScript, and SQL (with projects that have used MS SQL, MySQL, SQLite, and Postgres). And when I say know I mean that I have contract jobs I can point to where I've used each, and I'm happy to show off my code. I fuck around on code competition sites for fun so 'split a string and count the words' is toddler shit to me. I've got a growing library of 80-100pt Expert challenge solutions on HackerRank where my code is generally cleaner/faster than the site's editorial solution.

And I can't even get *** fucking interviews *** for FT. I'm honestly at the point of editing and sending out multiple copies of my resume as:
* Me.
* A U.S. based Pajeet.
* A foreign Pajeet looking for Visa.
* A woman.
* A black woman.
* A tranny.

Just to see if some categories get responses while others do not. Trouble is I would want the resumes to be roughly equal in education/experience yet not be identifiable as the same person.

>interview at Amazon

>We do not require that you know any specific programming language before interviewing for a tech position. However, familiarity with a prominent language is generally a prerequisite for success. You should be familiar with the syntax of languages such as Java, Python, C#, C/C++, or Ruby. You should also know some of the languages’ nuances, such as how memory management works, or the most commonly used collections, libraries, etc.

>Expect to be asked to write syntactically correct code—no pseudo code. If you feel a bit rusty coding without an IDE or coding in a specific language, it’s a good idea to dust off the cobwebs and get comfortable coding with a pen and paper. The most important thing a Software Development Engineer does at Amazon is write scalable, robust, and well-tested code. These are the main evaluation criteria for your code. Make sure that you check for edge cases and validate that no bad input can slip through. This is your chance to show off your coding ability.

so yeah, you need to be able to write syntactically correct code on a white board or paper from memory. Making excuses to why you can't do it is a great way to not get the job.

user, I can't tell if you're retarded, or if your language is retarded.

use std::collections::HashMap;

fn main() {
let sentence = "the dog ate the steak";
let mut word_counts = HashMap::new();

for word in sentence.split(' ') {
*word_counts.entry(word.to_string()).or_insert(0) += 1;
}

println!("{:?}", word_counts);
}

=> {"the": 2, "dog": 1, "ate": 1, "steak": 1}

Good thing I don't want to work for Bezos.

those types of interviews at not exclusive to Amazon.

damn, didn't know about the split method.
> pic related

Attached: lad.png (1030x284, 51K)

9 years experience here.

that sounds fairly easy to do just split on string and create keys for each word, if word exists, add +1 to the key's value.

maybe you should select better candidates, clearly your hiring process is broken, maybe hire a guy to hire programmers for you, since you're apparently not too good

try paying more

> let mut
why not just use "var"? That's a retarded language

Why do you think I care? I have never, in 15 years, written a program on a whiteboard and dumped it into production without running it through a compiler and test suite. Why would I give a single flying fuck about an interview process that optimizes for that?

I need people that can solve problems without having a mental breakdown when faced w/ something they don't know. (See .) I need people that can think critically about how code, and the constraints placed on it, evolves over time. I need people that have developed clear strategies for furthering their own knowledge. I don't need people who have read "Cracking the Coding Interview" or memorized the "nuances" of their favorite language when the reality is that the language is a moving target, the compiler is a moving target, and the ISA is a moving target.