## Interview Question

• 0

Country: United States
Interview Type: Written Test

Comment hidden because of low score. Click to expand.
0
of 0 vote

Given the declaration int x = 0, y; evaluate the following expression;

y = (--x) + (x++) – (x) + (++x) + (x--) - (++x);

Comment hidden because of low score. Click to expand.
0

``````y=(-1) + (-1) – (0) + (1) + (1) - (1);
y=1``````

Comment hidden because of low score. Click to expand.
0
of 0 vote

``````y = (-1) + (-1) – (0) + (1) + (1) - (1);
y=1;``````

Comment hidden because of low score. Click to expand.
0
of 0 vote

y = (-1) + (-1) – (0) + (1) + (1) - (1);
y=-1;

Comment hidden because of low score. Click to expand.
0
of 0 vote

Here is the SQL using that you can achieve the same:

``````Result = SELECT movie_id, actor_id, gender FROM Movie_Actor, Actor INNERJOIN ON Movie_Actor.actor_id==Actor.actor_id;

JoinResult = SELECT A.movie_id AS movie_id1, A.actor_id AS actor_id1, A.gender AS gender1, B.movie_id AS movie_id2, B.actor_id AS actor_id2, B.gender AS gender2 WHERE Movie_Actor AS A, Movie_Actor AS B WHERE A.movie_id==B.movie_id;

JoinResult = SELECT * WHERE (gender1=='Male' AND gender2=='Female') OR (gender1=='Female' AND gender2=='Male') FROM JoinResult;

JoinResult = SELECT actor_id1,actor_di2,COUNT(movie_id) AS TotalMovies FROM JoinResult GROUP BY actor_id1,actorid2;

Answer = SELECT actor_id1, actor_id2 FROM JoinResult WHERE TotalMovies == MAX(TotalMovies );``````

Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

### Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

### Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.