TCS
SKILLRACK
0 0 88
3 weeks ago

TCS Coding Program - Binary To Decimal Solution

#include<stdio.h>
#include<stdlib.h>

int power(int val, int pow){
    int answer=1;
    while(pow > 0){
        answer*=val;
        pow--;
    }
    return answer;
}

unsigned long long int binaryToDecimal(int binary){
    int num=0, pow=0;
    while(binary > 0){
        num = num + (binary%10)*power(2,pow);
        binary /= 10;
        pow++;
    }
    return num;
}
int main(int argc, char* argsv[])
{
    long binary = atol(argsv[1]);
    printf("%d", binaryToDecimal(binary));
}

TCS
A. MOHAMED RASVI
8 5 193
3 weeks ago

TCS Interview Experience

Hi everyone, I am Mohamed Rasvi from Kamaraj College of Engineering and Technology, Virudhunagar.I attended the TCS Code Vita competition, there were six problems. All of them were very tough. Everyone could manage to pass only 2 problems. After a week I was invited for direct technical discussion at TCS Siruseri, Chennai. The Interview was mostly based on the problems done at Code Vita to check if we have done it on our own. We were divided into groups based on the programming languages used. One thing I found very uncomfortable with was the room temperature, It was very very cold. The questions are: 1. Introduce yourself.(Basics as usual) 2. Explain the problem solved in code Vita line by line. They were very keen on it. they didn't leave any buit-in functions we used. 3. What are the libraries used to solve the problem and why? 4. Why did you choose Python to solve the problem? 5. What's the disadvantage of java over python? 6. Why and how Python allows us to write code in shorter time(continued from previous question). 7. Explain any two commonly used algorithms(area of interest). - discussed quicksort and binary search. 8.what programming languages you are comfortable with? I said Java, python ad c++. But also said language doesn't matter, Problem solving in more important. 9. Choose java or python and explain why. I said both. For AI - python and other projects Java. 10.what are the other useful packages and libraries in python. 11. Why did you choose Java for solving spiral prime problem? This is because Java's BigInteger class has many prime number related methods. 12. Is there any built-in method to find primes within a range in Java?(continued from previous question) 13. Why are you interested in machine learning and data science? 14. Do you think machine learning will be useful after 5 years? 15. What is set data structure in python?(used in codevita) Took 30 minutes for this session and four weeks for confirmation and offer letter. All the Best Guys!

TCS
SKILLRACK
0 0 88
3 weeks ago

TCS Placement Drive

6-Oct-2017 00:00

2 weeks ago

SAIRAM GROUP OF INSTITUTIONS - CHENNAI

TCS
Subramanian
8 5 292
3 weeks agoSolved

What will be the output of the following snippet and why?
int main()
{
    float x = 0.5;
    double y = 0.5;
    if(x == y)
    {
        printf("YES");
    }
    else
    {
        printf("NO");
    }
    return 0;
}