Interview with Veveo.Tv
It's a startup company that deals in the area of networks. Veveo.Tv tries to stream video using newer techniques and methodologies. They have a development center at Bangalore and the work is supposed to be REALLY good. Added to that, they pay good bucks too. I've had one interview round with them till now, as some other students at IIIT, and the names of short-listed people are expected to be out soon. Before I get rejected and do not wish to write my experience then, I'll post the various questions that I was asked in the telephonic conversation.1) If a struct contains a char and an int, what would be the size of the struct?
Ans: If char comes before int in that struct, size would be 8 bytes because of an extra padding of 3 bytes after 1 byte of char. If on the other hand, int lies before char, size shall be 5 bytes, as expected.
2) Read a file to count the unqiue words in there and tell the complexity of the algorithm.
Ans: It looked simple untill the interviewer asked me of the way to read that file. I said that I shall read words by tracking the white spaces. He asked me the buffer size that I shall use and I answered 80 considering that there are 80 chars in a line. He asked me to re-think and it finally struck to use re-alloc with some intial fixed buffer-size. After that, words are to be stored in a hashtable. There obiously is a need to maintain a linklist in there.
The worst-case complexity would be O(n^2) when all the words are stored in one linklist itself. That shal be the case when hash function is inappropriate.
3) Order for the function strcmp
Ans: O(n) where n is the no. of characters in smaller string.
4) What are the exact number of arithmetic operations required for multiplying 2 n*n matrices?
Ans: Order is n^3. Calculation of arithmetic operations is simple. I guess, it comes out to be (n^2)(2n-1)
5) There's a byte array of size 100 bytes. A char pointer p points at the beginning of that array. If you're given an integer i (between 0 and 799), write a one line code in C to set the ith bit to 1.
Ans: I'm not sure of the answer. Probably it is: p[i/8] = p[i/8] | 2^(7-i%8).. Kindly verify
6) What is a DFA? Give it's practical implementation. Draw a DFA for checking palindromes.
Ans: Palindromes cannot be represented using a DFA since it's got a constant memory and assuming that palindromes are of the form (w)(w^r), [where 'w' is a word and 'w^r' its reverse] we need to store 'w' somewhere to check it with its reverse.
7) What is big-endian and little-endian? How would you check if your system uses a little endian or a big endian representation?
Ans:
int num = 1;
if(*(char *)&num == 1)
{
printf("\nLittle-Endian\n");
}
else
{
printf("Big-Endian\n");
}
8) Write a program to check if the system stack grows upwards or downwards
Ans:
#include
#include
void stack(int *local1);
int main()
{
int local1;
stack(&local1);
exit(0);
}
void stack(int *local1)
{
int local2;
printf("\nAddress of first local : [%u]", local1);
printf("\nAddress of second local : [%u]", &local2);
if(local1 < &local2)
{
printf("\nStack is growing downwards.\n");
}
else
{
printf("\nStack is growing upwards.\n");
}
printf("\n\n");
}
They basically wanted strong C-programmers and hence didn't ask any networks related questions even after being a networks company. I couldn't answer 60% of the questions in the first go. Second thoughts worked better I guess. Thanks to Lohia for all the help.
Time taken to write this post: 28 minutes
4 Comments:
i suppose you're pretty smart, but not sure you're smart choices, why did you want to work for veveo? if you are good and could get your act together, i tell you a few better options,
1) google (maybe not, getting crowded and boring)
2) DC shaw in the US
3) Renaissance Technologies Corp (you need to be mathematican though)
....even after being a networks company...
who told you that?
Last month cleared all the 7 rounds of Veveo :)
Will be joining them as MTS on 30th May.
whats the package being offered ?
Post a Comment
<< Home