NVIDIA Interview Question for Software Engineer Interns


Country: United States




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

bool isLittleEndian(){
int a = 0x12345678;

char *x = &a;

return x[0] == 0x78;

}

- yoyoyo January 23, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

How do you assign int to a char*??

- akshaycj47 November 02, 2015 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

use-> uname -a | grep -q "x86" in /bin/sh

- SENBOTDRON the Transformer from Autobots actually dinobots February 24, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

What if it is not on linux OS. The catch here is x86 is little endian and Sparc is big endian. You can write a simple C code to find it out.

- gjp February 26, 2014 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

pointer size

- shankar April 15, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

define a union UNION { char a[4]; unint32 n;}; union UNION u; n = 0x12345678; if(u.a[0] == 0x12) return XXXXX-ENDIAN; if (u.a[0] == 0x78) return YYYYYY-ENDIAN;

- Anonymous May 20, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

int check_x86()
{
int a = 0x01020304;
char* b = (char*)&a;
return *b == 0x04;
}

- Anonymous August 21, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

#include<stdio.h>
#include<conio.h>
int main(int args,char *argv[],char* envp)
{
int i;
for(i=0;envp[i]!=NULL;i++)
{
printf("%s\n",envp[i]);
}
getch();
return 0;
}

- pankajkaushal1992 December 01, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

There are compiler predefined macros that can do this check ,
#if defined(__sparc)
/* SPARC ---------------------------------------------------- */

#endif

#if defined(__x86_64__) || defined(_M_X64)
/* x86 64-bit ----------------------------------------------- */

#elif defined(__i386) || defined(_M_IX86)
/* x86 32-bit ----------------------------------------------- */

#endif

- Prasanna May 04, 2015 | Flag Reply


Add a Comment
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.

Learn More

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.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More