Interview Questions for gaming companies.

Source: Internet
Author: User

//////////////////////////////////////// /////////////////////////////////////////
Mathematics: vector dot product and cross product in space ry
There is a question like this: 20 points. We know the three-point coordinate of a triangle, and determine whether p (x, y, z) is in this triangle. Is to write a bool type return value function.

Graphics: Conversion of RGB values, 24-bit conversion to 16-bit.
C ++: Evaluate the polymorphism. For the dynamic_cast operator, check the program about this operator in C ++ primer. (10 points are available)
Write this first! Brother is still in Shanghai. It is estimated that there is no hope. Go back and study hard. Let's start the hero!
It is best to make something decent, otherwise it will be unconvincing!
Sharing!

//////////////////////////////////////// /////////////////////////////////////////
If the target job is a client programmer: DirectX related knowledge, Bitmap Processing related knowledge, Interface related knowledge, plug-in related knowledge, data structure, path finding algorithm principle, and so on.
If the target job is a server programmer: socket, completion port, asynchronous I/O, thread and synchronization, database, and so on.
If the target job is a primary programmer: system architecture, software engineering, design mode, code management, version control, script related knowledge, etc.

//////////////////////////////////////// /////////////////////////////////////////
Interview Questions from a gaming company (I)

The original question is as follows --

Question: Develop a small program
Requirements:
1. Reflect your own real level
2. There are design documents and comments, as well as development cycles and overlapping cycles.
3. No illegal operation will occur in any operation
4. No resource leakage
5. Regular encoding format: such as four-cell row shrinking
6. Use C ++ (preferably Microsoft development tools)
7. Use object-oriented or updated Model Development
8. If you use the architecture, design, and usage modes, mark them in the code or document.
9. The code is intuitive, easy to understand, and easy to modify and expand.

(Do not use existing frameworks such as MFC, ATL, and wtl. Use Win32 APIs, but use STL,
C ++ libraries such as boost increase the score, but the premise is that they are used correctly)
Procedure:
1. Create a basic window Program
2. Create a window named "written test" and ws_overlappedwindow,
The size of the customer zone is 800*600, and a message loop is established.
3. The idle time (CPU idle time) can be used to modify the message loop. Do not use timer.
4. Display an image "bg.bmp" in the customer area (0, 0) of the window (you can use GDI or
Use other libraries, such as fengsoul)
5. Press the number key 1 and an image will be randomly loaded in "spritex.bmp ".
A random position starts horizontal translation, but it does not fly out of the customer zone, that is, it will be
The border of the port is displayed.
6. Press the number key 2 and an image will be randomly loaded in "spritex.bmp ".
A random position starts to move up and down, but it does not fly out of the customer zone, that is, it will be
The border of the port is displayed.
7. Press the number key 3 and an image will be randomly loaded in "spritex.bmp ".
A random position starts to translate in a random direction, but it does not fly out of the customer zone.
Yes, it will be returned by the window border.
8. Click with the left mouse button. If you click the picture of the flight, a dialog box is displayed.
Name of the image to be clicked (note that the image with the displayed name must be an image flying on the top)
9. Right-click, and all flight pictures move to the point where the mouse is clicked.
But it still cannot move the border. Right-click all images
Continue to exercise according to their original rules. For example, if you used to press the number key 1 to create an image, continue
For horizontal translation, if you used to press the number key 2 to create an image, continue the up/down translation.

Note: the efficiency of program operation is secondary. The main inspection points are the program structure and development habits.

We provide:
The sample image for running the program, and the image resources required by the program

 

-- Currently, only the effect of a single sheet is made.
Http://blog.csdn.net/Lsaint/archive/2006/06/24/830510.aspx

//////////////////////////////////////// ///////////////////
1,
3D points
Class fvector3
{
Public:
Float getx ();
Float Gety ();
Float Getz ();

Void normalize (const fvector3 indium, fvector3 outp );
Void dot (const fvector3 indium, float outresult );
Void sub (const fvector3 indium, fvector3 outp );
Void add (const fvector3 indium, fvector3 outp );
}
Line Segments
Class segment
{
Public:
Fvector3 getp1 ();
Fvector3 getp2 ();

Void getclosestpoint (const fvector3 indium, fvector3 outp );
}
Requirement: implement the void getclosestpoint function (const fvector3 indium, fvector3 outp );
Enter a three-dimensional vertex Q, and return the vertex P of the closest line segment to the vertex.
Ideas:
1: The plane equation with the Q point and the normal line in the same direction as the line segment is obtained.
2: Find the intersection of a line segment on the plane.

2. Mathematical and graphics Problems
In a two-dimensional plane, how can we determine whether a point is in a triangle?
//: Note that this problem has been solved in my 3D Game Development Section.

//////////////////////////////////////// /////////////////////////
Drop Xbox.
Http://dzh.mop.com/mainFrame.jsp? Url = http://dzh.mop.com/topic/readSub_5779391_0_0.html
You work in an office building on the fifth floor. Now you have two Xbox servers, which requires you to use as few test flags as possible to determine the maximum number of floors on which the Xbox is not broken, of course, we must consider the worst case.
For example, it is okay to lose from layer 30, but it is not guaranteed to lose from layer 31. (During the exploration process, both Xbox versions can be smashed .)

(18): from the second floor, we use the reverse binary method. If it breaks down, it will start to fall down from the first floor that has not been broken. Well, I'm right.

2, 4, 8, and 8 floors are broken down, starting from the 4 th floor

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.