Interview

>Interview
>"Show me how you traverse a linkedlist"
>mfw

Also: Coding interview tests.

Attached: linkedlist.jpg (900x900, 63K)

this negro serious?

>he wants to become an ambition-slave
ishiggydiggy

>start browsing linkedin, clicking on connections
>interviewer asks what i'm doing
>"i'm traversing linkedin?"
>made CEO on the spot, previous CEO performs sudoku
>get to fuck HR bitches

Boi.. This is low-tier knowledge if you're really interested in programming. Or is your only ambition to create electron apps?

Let me guess: You're one of those dumbfucks who thinks "programming" means tacking together algorithms that other people wrote in Node.js.

I just want to make vidya gaymes

>can traverse genders
>but cannot traverse a linked list

The Lord works in mysterious ways, sometimes.

Attached: hide discord tranny threads.png (635x483, 259K)

I would not be able to do it without google. But it really does not matter. My programming projects earn more in passive income than average salary in my country

Attached: 712345.gif (978x827, 1.29M)

So you even know what a linked list is? It's definition basically tells you how to traverse it.

Attached: 1555594217975.jpg (800x1200, 721K)

Perhaps the question was "How do you traverse a linked list in Rust". That is actually a hard question.

Remove rust with electrolysis, then traverse the list like normal.

Dude borrowing ain't that fucking hard jesus fuck

this is the Jow Forums equivalent of pic related

Attached: download.png (167x302, 13K)

Ew, is that some kind of hairy creepy spider parasite thing?

How do you do this in rust? Remind me because I haven't written anything in rust for a year now.
#include

typedef struct LinkedListNode {
struct LinkedListNode *next;
int value;
} LinkedListNode;

int main() {
LinkedListNode *root = NULL;
int values[5] = {1, 22, 333, 4444, 5555};
for (int i = 0; i < 5; i++) {
LinkedListNode *node = malloc(sizeof(LinkedListNode));
node->next = root;
node->value = values[i];
root = node;
}
int sum = 0;
LinkedListNode *it = root;
LinkedListNode *next;
while (it) {
sum += it->value;
next = it->next;
free(it);
it = next;
}
printf("Sum: %i\n", sum);
return 0;
}

This is the right answer.

It's a Nycteribiidae, part of the true fly family.
It's also known as a "bat fly"
It has no wings nor eyes, they attach to bats and feed off their blood.

I initially read this as transverse and got very confused for second

>>"Show me how you traverse a linkedlist"

"I'll give it a go, but I'm a Graphic Designer."

it's gay but if you want any half decent job out of school you have to study a bunch of common interview questions and just memorize answers to them
complain about it sure, but you have to do it if you want to succeed. if you don't people who did study common questions will always outperform you.

>not traversing through proper gender pronouns

>read data
>pointer in the Dat ais new data to read
>repeat
How is this hard

I always love when these filters work. Usables are not annoyed by such trivial tasks since it's immediately solved, and brainlets are immediately recognizable.

Imagine being a recruiter and watching "code artisans" and mentally deranged trannies struggle trying to do fucking fizzbuzz

Must be glorious.

Attached: 1555428373709.jpg (480x480, 27K)

underrated post

Are you serious lad

here's a test i got a while back
i was never able to figure out any of the answers so i never sent anything back

Attached: 14663267536742.png (1315x1789, 529K)

man am I glad I didn't get into IT

The premise behind that first question is extremely suspicious. Is there any good alternative to multiplying by 10?

Does question 4 code remove the node from the graph or linked list or whatever? Never programmed in anything but python loll

I think it reverse the list.

It reverses the list (assuming you feed it the head of the list).

Since linked lists are in std, you just use iterators.

from traverselinkedlist import traverse

traverse(linkedlist)

Perhaps they mean some sort of bit shifting adding mechanism. Bit shift twice will be the equivalent of multiplying by 8. Then you add it twice more manually and you're at x10. I can't imagine that being faster than a built-in multiplication mechanism but that's what I'm guessing they want.

Sorry, not bits shift twice, bit shift thrice.

no it fucking sucks, I don't want to work with a bunch of retards

What's irritating about a question like this to a brainlet like me is what the fuck does he want to hear?
I know a linked list consists of a pointer to the start, nodes having a value and a 'next' pointer, and traversing it should be done by updating your current pointer to the 'next' value until you reach one that has value null. Am I supposed to say that sentence? Shit up some pseudocode? Or ask for more information?

Have you just never been to an interview before? They would make that incredibly clear. You'd be talking to a person, not just responding to a one-sentence prompt online.

I haven't. That's reassuring.

Everything online about how tech interviews are too hard is part of a big circlejerk of misery by the incompetent who want to bring everyone down to their level.

So its kinda like a bat for bats

4. Reverses the list
5. Passwords stored in plaintext, exceptions not handled

hahahaha
It's one of those again

Bizarre that I've had some of these specific sounding problems in my work.

>1
They're looking for "bit shifts and addition" for the answer. Incidentally I had to write an implementation of int.parse for performance reasons, but not because of some weird platform issue. The default int.parse does several checks and such that slow it down the tiniest amount if you're doing it a hundred billion times it adds up. I wrote an implementation that beat it by a factor of 4-7 using loop unrolling and not checking a goddamn thing, which was perfectly appropriate for the application.
>2
This describes the structure of the data, but then says the computation is taking all the time, not the data structure manipulation. I think they want you to realize that the data structures isn't the issue? I'd ask if we know if lookups are the problem, and maybe index/cache the data if so.
>3
I actually did something similar to this, but with 900MB XML files. My data wasn't a graph though, so after heavy preprocessing I did indeed toss it into a SQL Server database. In fact, that process has happened every day for four years now. But my data fit the relational model well and needed to be stored. Graph data would be better stored in a graph database. SQL Server 2017 does indeed support graph storage and querying, so it could be a serious option. Still, my first instinct would be to buy more RAM or run the process on a server VM. My time is worth way more than some RAM or VM time and rewriting takes lots of time. Why the hell don't I have 16GB in my dev machine anyway?
>4
Reverses a singly linked list.
>5
So much shit wrong. Password isn't salted. Hash function isn't a password hashing function (one round of SHA is way too fast). The empty exception handlers could possibly allow someone to pass a null password in and be authenticated against an account that doesn't exist. The formatting is weird. The commented out line should be removed. digest isn't disposed. And more!

>5
Bonus: The fucking hashing isn't even being used since both sides are being hashed, so the password must be plaintext in the database. Jesus Christ, I hope this wasn't pulled from actual production code.

my first thought

t. brainlet

ez

start at the head, then keep iterating with the next pointer to go forward, if its double-linked then use the previous pointer to go to previous node.

What do you mean by "digest isn't disposed"?

The variable "digest" is declared new then Initialize is called. I made the assumption (based on the name) that it implements IDisposable, and looking it up, it turns out it does. Garbage collection will eventually get it... Eventually. Best practice is to (ideally) wrap it in a using statement, or dispose of the resource by calling digest.Dispose() in a finally block (if a using statement isn't appropriate, this is rare). Doing either of these has the same effect: It causes the resource to be cleared and the managed memory marked free immediately.
This is a dotnet pattern. Things which implement IDisposable should be disposed of with very few exceptions. Code analysis/linting will catch cases where you haven't done this.

Don't you just follow the next/prev pointers??

I could be retarded but wouldn't the instructions already do proper multiplication, unless you specifically wrote your code to add n many times, which is just fucking retarded

Linked lists are virtually impossible in rust brainlet. Have to use deque to half replicate them.

Attached: 1542710691891.jpg (556x559, 33K)

Not virtually impossible, but virtually impossible while retaining safety.

>Nobody should use linked lists, it's a bad practice and should be eradicated. A good programmer should use vectors.

Show some cleavage, always worked for me (;
Oh.. lol, you inferior being.

Serious question from a brainlet here. Are all coding interviews in a specified coding language? If they just ask for, say, the typical FizzBuzz question without specifying which programming language, what do you do?

Is there a standard you can use that will communicate what you're trying to do regardless of any specific language?

depends on the company. the approach for most languages is similar enough that it wont matter, unless you pick weird shit like haskell. any interview should know C or JS type syntax.

>Are all coding interviews in a specified coding language?
Depends. Sometimes there is a list of acceptable languages.
>If they just ask for, say, the typical FizzBuzz question without specifying which programming language, what do you do?
Pick the language based on the type of job you're applying for. If you're applying for an embedded job, doing your solution in Javascript isn't going to look good.
Otherwise, any "common" language would be fine, including most C-likes or shit like meme-snek.

So you essentially pick a language, like say C++, and just write the answer in that language and assume whoever's reading it will understand what you mean?

I see. thanks for clarifying.

For the fucking around segment of the interview, even pseudocode would be acceptable. But the company is obviously going to be mostly using one or two languages, and you'll need to show proficiency in one of them to prove you're worth shit to them before they'll hire you. Job ads almost always specify what they want.

How long have you been working in the industry?
What do you mean one round of SHA is too fast?
Also, SQL idiot here, wouldn't utilizing SQL slow the process incredibly from having to access the disk?

Isn't IT considered more tech support and admining?

Yeah, I hate it when people group computer science and programming in with that sort of shit. The skill set is entirely different.

>How long (too long)
8 years.
>SHA is too fast?
If you were an attacker and you stole a password database full of salted SHA256 hashes, you could still crack them at an alarming rate with some GPUs. SHA256 is designed to be very fast, but you want an attacker to have to put lots of effort into reversing your hashes. Hashing algorithms like bcrypt, scrypt and even just PBKDF2 are designed to be slow on purpose, and critically they're designed to be impossible to really speed up. So the attacker can only generate a few thousand hashes per second instead of millions (just an example).
>SQL is slow
Depends on how much memory you have. Databases tend to cache everything in memory if possible. If your dataset and indexes are bigger than your system memory, then yes the database will be thrashing against the disk a bit. This might be okay if you're doing analytical queries on a development server and letting the process run for as long as it takes is fine. But ram is really cheap compared to dev time. Most serious companies that do one-off analytical work on large datasets will throw hundreds of GB of memory at a problem rather than spend a day optimizing.
For the given question, yes putting the data in a database would be labor intensive and would only allow the process to run without having to implement your own disk paging mechanism. I think the answer they were looking for is "you should ignore your coworker and request better hardware".

Thanks, I learned about hashing for passwords and such but it wasn't incredibly in depth. Didn't realize SHA256 was meant as a fast hashing function while most password hashing functions are meant to be slow.
For instance I'm looking at a web browser tab having this encryption:
(TLS_AES_128_GCM_SHA256, 128 bit keys, TLS 1.3) which led me to assume SHA256 meant more secure since it was in this and other cryptography.

How did you start and work your way up to where you are? I'm looking for a job for the summer and hopefully a real job a year later. What are some pitfall job roles to watch out for and which role should I look for to get into the industry?

SHA256 has many excellent properties that make it one of the best general purpose cryptographic hash functions, and speed is one of them in most applications. Just not password hashing.
I started with an associates degree in EE, then in CE, then I went for my bachelor's but I balked at the cost and bailed immediately. I had been doing help desk work and internships through college, so I already had a little experience on my resume. I just made a LinkedIn and recuiters were after me within a week. Got a job at a reasonably local company and have been there ever since. The pay is only okay, but I've been hesitant to leave because my supervisor and coworkers are just so excellent.

My sage advise:
Avoid working in retail. It barely counts on your resume and it's awful work.
Help desk work is a fine entry into the software field even though it has basically nothing to do with writing software. HR people don't know that, so it looks good.
A summer job is worth a lot less than a job you keep for a whole year or two.
Do not skip formal education, but an associates is good enough to get your foot in the door actually writing software.
Titles are important! You want "software developer" or "software engineer" somewhere in your title as soon as you can get it. When applying for a new job, they really care about that title.
When you're starting out you can't be terribly picky, but after you have a couple of years as a developer you can be selective. When interviewing, be very attentive about the company. Avoid open office memes, ask questions about their development practices. Try to get a peek at their dev staff and check for signs of life in their eyes.

Good luck user.

>I just made a LinkedIn and recuiters were after me within a week.
Oh god no. I'm so late in my years, it would be an embarrassment to put myself up on LinkedIn and show how much of a failure in life I've been.

Thanks user

Do IT people still get to do SOME programming? I know they don't write software and stuff, but do they at least get to write scripts and stuff? I'm learning Java in my meme cyber sec degree, and hoping I'll get to program a little in my career.

Although I know that I would hate programming if that was all I did lol.

No. You'll be unlocking accounts and showing people how to use Excel.