# Questions d'entretiens - Summer engineering intern

# 733

Questions d'entretien pour Summer Engineering Intern partagées par les candidats## Principales questions d'entretien

### 25 racehorses, no stopwatch. 5 tracks. Figure out the top three fastest horses in the fewest number of races.

9 réponses↳

We can do it in seven races, we'll call them races A-F. For notation, we'll say that the Nth horse in race X is called X.N. Races A-E: Divide the horses into 5 groups of 5 each such that each horse races only once. We can eliminate the slowest 2 horses in each of the five races because there are definitely 3 horses faster in each case. As a result, we eliminate 5x2 = 10 horses: {A.4,A.5,B.4,B.5,C.4,C.5,D.4,D.5,E.4,E.5} Race F: Race the fastest horses in each race A-E: {A.1, B.1, C.1, D.1, E.1}. To simplify notation, we'll label F.1 as horse A.1, F.2 as horse B.1, and so forth. That means the winner of this race is A.1, and it is the fastest horse of all. We don't have to race A.1 anymore. We can eliminate D.1 and E.1 = 2 horses. Because they are not in the top 3. As a result, we know that all remaining horses from D and E are eliminated. This is D.2,D.3,E.2,E.3 = 4 horses. We know that A.1,B.1, and B.2 are all faster than B.3 (and similar for C.3) so they are not in the top 3.We can eliminate B.3 and C.3 = 2 horses. Finally, we know that A.1 is faster than B.1, which is faster than C.1, and thus C.2, so we can remove C.2 = 1 horse. Race G: We have removed 19 horses from competition and are sure that A.1 is the fastest horse of them all. This leaves just 5 horses: {A.2,A.3,B.1,B.2,C.1}. We race them and select the top 2 to join A.1 as the top 3 fastest horses. Moins

↳

Race#1 Race#2 Race#3 Race#4 Race#5 A1 B1 C1 D1 E1 A2 B2 C2 D2 E2 A3 B3 C3 D3 E3 A4 B4 C4 D4 E4 A5 B5 C5 D5 E5 Race#6 A1 B1 C1 D1 E1 Let's Say ranking 1st 2nd 3rd 4th 5th Eliminate D1 E1 D2 E2 D3 E3 A4 B4 C4 D4 E4 A5 B5 C5 D5 E5 Left with B1 C1 A2 B2 C2 A3 B3 C3 Eliminate C3 as there are more than three faster horses C2, C1, B1, A1 Eliminate C2 as there are three faster horses C1, B1, A1 Eliminate B3 as there are three faster horses B2, B1, A1 Left with 5 horses for Race#7 B1 C1 A2 B2 A3 So 7 races Moins

↳

8 5 top horses from each race of 5 races (25 / 5) 5 top contenders race; 1 wins--that's one top horse (5-1) 4 remaining top horses race, one wins; that's 2 top horses (4-1) 3 remaining top horses contend; winner is #3 That's 3 top horses from 8 races Moins

### Given a list of points in the 2D xy plane, determine how many of those points can maximally exist on a line (not necessarily through the origin). So find the line that contains the most points, and return how many points are on that line.

3 réponses↳

Mathematically one can't do better than O(N^2) on this, but my interviewer kept trying to get me to do better. Moins

↳

If the lines are parallel to X-axis or Y-axis, then: 1 - Sort the points by X-axis (NlogN) 2 - MaxSortedX => Take the max Number of consecutive point with the same X -coordenade. 3 - Sort the points by Y-axis (NlogN) 4 - MaxSortedY => Take the max Number of consecutive point with the same Y -coordenade. 5 - The solution will be max(MaxSortedX, MaxSortedY) => O(NlogN) Note: I have few questions: 1 - Are the lines parallel to X-Y axis? 2 - What is the max values of the coordenates? Moins

↳

No, there was no requirement that the lines be parallel to X or Y axis--they could have any slope. Also no guarantee that the line passes through the origin, so you can't rely on polar coordinates. Max value of coordinates is just DBL_MAX. Moins

### What is the difference between a Class in C and an Object in C++?

2 réponses↳

C has no class- C is a functional programming language!!!!!

↳

I think you mean difference between class and object in C++, C is a low level language with no Class functionality (it does have struct however). A class is a collection of variables and functions for the purposes of OO programming. An object is an in stance of the class that can call its member functions and variables Moins

### What would you do if you learned that the president of the school body posted the exam questions online prior to the exam?

2 réponses↳

I would report it to the most appropriate authority in the situation.

↳

What were the technical questions?

### What are some of our clients?

2 réponses↳

Airbus, Boeing, Ministry of Defense, but they seemed to expect way more.

↳

United States of America

### What is the difference between a signed and unsigned integer variable type?

2 réponses↳

Signed can hold positive and negative numbers, unsigned numbers can only hold positive numbers (or 0) Moins

↳

signed value ranges from (-Max_Val, Max_Val), while signed goes from (0, 2*Max_Val). Max_Val is the predefined maximum value for the specific data type. They both have the same range of 2*Max_Val Moins

### Two dices are rolled, what's the expectation of number of rolls with the sum (of all) to be an multiple of 6?

2 réponses### Green book and resume questions

2 réponses↳

what kind of algorithm questions did they ask?

↳

What is green book?

### Why are you interested in Samsung?

2 réponses↳

Cause it’s a very growing company.

↳

It is a very employee oriented company with great safety values

### Name, specifically, our clients

2 réponses↳

I named defense clients but they were unhappy with this and pressed for civil aerospace clients of which I could only name one. Moins

↳

Sorry to hear that it didn't go they way you wanted, I have got mine coming up in a week time and was hoping if you could help me about the group presentation and what sort of questions they ask? Moins