So I had an interview for an job yesterday. In fact, it was my first job interview. It went okay.
One of the technical questions the interviewer asked was to create a data structure that would insert in O(log n) and return an iterator that would iterate the data back in sorted order in O(n) time. I knew it was a binary tree and the iterator would use an inorder traversal of the tree so I started typing it out.
But when I got to the iterator part, I just couldn’t figure it out. I knew for sure it was an inorder traversal but I couldn’t figure out how to turn the recursive algorithm that I knew into an iterative one. So I sat there and drew some trees to try and visualize the algorithm for it. I thought using a stack for the traversal would also probably work but I couldn’t figure that out either. And then time was up.
So we continued the interview. I asked some questions about the position. Then the interview ended.
I hung around for a little bit with a friend that worked there and referred me for the job then we biked back to our dorms. As soon as I got back I opened up Visual Studio and worked on the problem again because I knew that if I didn’t I’d probably end up staying up all night thinking about it.
I implemented the A* pathfinding algorithm in python/pygame today. Yep. I was bored of doing Source SDK stuff for my CSE381 class and so I decided to learn a new language, framework, and algorithm. The program itself is pretty basic and isn’t really that optimized but it works. Maybe I’ll post the executable once I figure out how to build python code into exes.
I’m actually really liking python/pygame. Maybe I’ll make my next game with it.
If anyone is interested, I put up a project page for the game programming course I’m taking (CSE380). For my individual project, I’m making a game called “I WOKE UP LATE AND NOW I HAVE TO ROCKET JUMP PASS ZOMBIES TO GET TO CLASS” or IWULANIHTRJPZTGTC for short or ZOMBIES for shorter. There hasn’t been much progress but I’m working on it.
There were three questions with two parts each. We had to write some methods for some data structures. I breezed by the first two and thought I finished the third but for some stupid reason, it wouldn’t work.
I sat there debugging this one stupid thing for at least an hour. I couldn’t figure out why the stupid chained hash table was inserting null entries when I tried to add something into it. Eventually, I had enough and deleted everything and started over. Took me two minutes to rewrite the method and it finally worked! I tested it with the grade calculator that the teacher gave us and I got 15 out of 15.
I wanted to get out of there so I quickly handed in the files and the paper, left the computer lab, walked downstairs and out the building. Then I remembered something super important that I forgot to do: update the hash table’s size.
FUCK.
I couldn’t go back and add it, I had already left the exam area and handed it in. I felt so dumb. I just couldn’t shake the fact that I had forgotten something totally stupid and now I won’t get perfect scores on all the tests I’ve taken for that class. Yeah, it sounds lame that I am worried about something like that. But I already forgot to hand in the last hw on time (luckily I was allowed to hand it in late). And this comp sci stuff is probably the one of the only things I’m good at so I’m feeling kind of mad at myself ‘cause I forgot to do it.
Now I have to ace the final. Too bad it’s multiple choice. I hate multiple choice comp sci exams.
Yeah. I think I’m just gonna do C# and XNA game programming. Seems a whole lot easier and I won’t have to manage memory.
Sure, C#/XNA is slower but I don’t think it matters when the games I want to make are gonna be 2D. When I move on to 3D I think I’ll try C++/DirectX again. I can’t really find any decent online resources for DirectX right now and I don’t feel like buying a book.
I’ll probably take the game programming course here at Stony in a later semester. The teacher is cool and having someone guide you through it is a whole lot easier. Wish they had it when I was at Tech. Screw you weird name people, Ariel and Aljohn. Oh and Lukasz.
This kid Allen(?) is starting up a game programming club so I’m gonna be joining that. He seems pretty awesome at programming, much more knowledgeable than I who only knows Java and a bit of C++ (and php/html/css/js). It’ll be fun. I hope.
So anyway, I’ve starting learning C# and it’s a lot like Java. That’s kind of a good thing since Java’s pretty easy. Still deciding on game to start off with.
Snake? Space Invaders? Tetris? PONG?!
For the sake of randomness. Here’s a video of one of the best games ever.