## NVIDIA Interview Question for Software Engineer / Developers

• 0

Country: United States

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

The solution to me seems to be making a backtracking program that will go through and assign each number to a letter, generating each by using an iterator. This solution would probably take a while however, since it would need a way to know that it's developed all permutations for a number.

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

My approach would be to create three trees of height 7. Lets say the number is 800-123-4567 and 1=> a,b,c 2=>d,e,f ...
so tree one will be with root a and children def. tree two will be with root b and children d,e,f.. and each d, e, and f will have their own .. then it will be direct tree traversal from root to leaf will represent one phone number..

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

``````#include <stdio.h>
#include <string.h>

char *map[10] = {"!", ",", "abc", "def", "ghi", "jkl", "mno", "pqrs", "tuv", "wxyz"};

void generatePermute(char *num, int pos, int length)
{
static char permute[7];
int i;
if(pos==length)
{
permute[length] = '\0';
printf("%s\n", permute);
return;
}
for(i = 0 ; i < strlen(map[num[pos]-'0']) ; ++i)
{
permute[pos] = map[num[pos]-'0'][i];
generatePermute(num, pos+1, length);
}
}
int main()
{
generatePermute("6236537", 0, 7);
}``````

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.