Posts

Showing posts with the label 2016

Important TCS CodeVita Questions Solved – Sheldon Cooper and his beverage paradigm

Image
Important TCS CodeVita Questions Solved – 2015 Problem : Sheldon Cooper and his beverage paradigm Sheldon Cooper, Leonard Hofstadter and Penny decide to go for drinks at Cheese cake factory. Sheldon proposes to make a game out of this. Sheldon proposes as follows, To decide the amount of beverage they plan to consume, say X. Then order for a random number of different drinks, say {A, B, C, D, E, F} of quantities {a, b, c, d, e, f} respectively. If quantity of any three drinks add up to X then we’ll have it else we’ll return the order. E.g. If a + d + f = X then True else False You are given Number of bottles N corresponding to different beverages and hence their sizes Next N lines, contain a positive integer corresponding to the size of the beverage Last line consists of an integer value, denoted by X above Your task is to help find out if there can be any combination of three beverage sizes that can sum up to the quantity they intend to consume. If such a combination...

TCS CodeVita 2016 Round1 Question: Consecutive Prime Sum

Image
Problem : Consecutive Prime Sum Some prime numbers can be expressed as Sum of other consecutive prime numbers. For example 5 = 2 + 3 17 = 2 + 3 + 5 + 7 41 = 2 + 3 + 5 + 7 + 11 + 13 Your task is to find out how many prime numbers which satisfy this property are present in the range 3 to N subject to a constraint that summation should always start with number 2. Write code to find out number of prime numbers that satisfy the above mentioned property in a given range. Input Format: First line contains a number N Output Format: Print the total number of all such prime numbers which are less than or equal to N. Constraints: 1. 2 Sample Input and Output SNo. Input Output Comment 1 20 2 (Below 20, there are 2 such numbers: 5 and 17). 5=2+3 17=2+3+5+7 2 15 1 Pseudo Code: 1. Find all the prime numbers till N     i.  A  is an array length N + 1 initialized with numbers from 0 to N                 ...

TCS CodeVita 2016 Round1 Question: Logic Pyramid

Image
Problem : Logic Pyramid Identify the logic behind the series 6 28 66 120 190 276.... The numbers in the series should be used to create a Pyramid. The base of the Pyramid will be the widest and will start converging towards the top where there will only be one element. Each successive layer will have one number less than that on the layer below it. The width of the Pyramid is specified by an input parameter N. In other words there will be N numbers on the bottom layer of the pyramid. The Pyramid construction rules are as follows 1.      First number in the series should be at the top of the Pyramid 2.      Last N number of the series should be on the bottom-most layer of the Pyramid, with N th  number being the right-most number of this layer. 3.      Numbers less than 5-digits must be padded with zeroes to maintain the sanctity of a Pyramid when printed. Have a look at the examples below to get a pict...

TCS CodeVita 2016 Round1 Question: Min Product Array

Image
The task is to find the minimum sum of Products of two arrays of the same size, given that k modifications are allowed on the first array. In each modification, one array element of the first array can either be increased or decreased by 2. Note - the product sum is Summation (A[i]*B[i]) for all i from 1 to n where n is the size of both arrays Input Format:   First line of the input contains n and k delimited by whitespace Second line contains the Array A (modifiable array) with its values delimited by spaces Third line contains the Array B (non-modifiable array) with its values delimited by spaces Output Format: Output the minimum sum of products of the two arrays Constraints: 1 ≤ N ≤ 10^5 0 ≤ |A[i]|, |B[i]| ≤ 10^5 0 ≤ K ≤ 10^9 Sample Input and Output SNo. Input Output 1 3 5 1 2 -3 -2 3 -5 -31 2 5 3 2 3 4 5 4 3 4 2 3 2 25 Explanation for sample 1: Here total numbers are 3 and total modifications allowed are 5. So we modified A[2], which is ...

Best 2016- 2017 Clothing Trends for Men

Image
Hello All,                 Happy New Year in Advance for my Blog Readers . Today we have no trick .We are Here with New Trends of Clothing . Hope You might like my Choice .I have find the best from several sites like 30-40 sites and trends . So Keep Calm and Enjoy The Show .....😅😆 ___________________________________________________________________________

IT newbie? Double pay with new skills

Image
--Source TOI Most Used 2015 and 2016 Programming Languages .It's Latest news which language is going Hot and Which one are going cool..  Mar 2016 Mar 2015 Change Programming Language Ratings Change 1 2 Java 20.528% +4.95% 2 1 C 14.600% -2.04% 3 4 C++ 6.721% +0.09% 4 5 C# 4.271% -0.65% 5 8 Python 4.257% +1.64% 6 6 PHP 2.768% -1.23% 7 9 Visual Basic .NET 2.561% +0.24% 8 7 JavaScript 2.333% -1.30% 9 12 Perl 2.251% +0.92% 10 18 Ruby 2.238% +1.21% 11 13 Delphi/Object Pascal 2.005% +0.85% 12 28 Assembly language 1.847% +1.23% 13 10 Visual Basic 1.674% -0.28% 14 23 Swift 1.587% +0.77% 15 3 Objective-C 1.461% -5.23% 16 20 R 1.285% +0.33% 17 36 Groovy 1.193% +0.78% 18 19 MATLAB 1.193% +0.19% 19 17 PL/SQL 1.193% +0.16% 20 31 D 1.139% +0.64% Cos Look For Diversity In Tech Talent If you have so me of the new-age tech skills, not only are you likely to be hired much faster, you could also earn much better salaries.Terms like R, Julia, Hadoop, Scrum ...