TCS Digital Agility Questions and Answers
- Number of Questions – 2
- Time – 20 mins
Note – Write Interview Experience for TCS Digital after giving your exam on 20th and get Rs250 Rupees on PayTM as contribution reward or Free Paid Materials from our end. To write visit this page here
Ques. 1
Computer vision is a branch of computer science aims to enable computers to recognise and process images in a way that human vision does. It is similar to imparting intelligence and instincts that humans possess into a computer. Computer vision is closely related to artificial intelligence, as the computer must interpret and discern what it sees, perform the required analysis and provide insights for decision making; e.g., computer vision for driverless cars perform functions such object detection (road, traffic lights, pedestrians etc.), motion & speed detection, path prediction. Obviously this needs to be done real time and across all the entities in the ecosystem, so there is a huge amount of data to process in a very short time.
Deep learning is a popular set of methods used to achieve this. Scientists collect sizeable sets of data and use it in part to train the computer vision algorithm and in part to test the algorithm. Subsequently they build the ‘decision-making’ capability based on the algorithm’s outputs, e.g., intelligence added to stop the car once a pedestrian is detected crossing the road in front.
As a computer vision expert, you have recently attended the World Ophthalmic Federation summit, where a proposal has been tabled to develop ‘Nethra’- computer vision-enabled goggles for visually impaired. The federation has collected a dataset of 1,000,000 images taken from various head-mounted cameras simulating the typical paths of visually impaired pedestrians in New York City. Some images have multiple objects in front, other images do not, some are. Which of the following options are valid based on the passage above
a. In computer vision , the algorithms are trained to overlook what they learn during the training process
b. Scale the object localization to support multiple objects
c. The number of images mentioned in the passage are not sufficient for training and validation purpose
d. Validate the accuracy of the model using the test data
e. Build an image classifier that detects different types of objects
f. Split the Data into a training and test set with ratio 70:30
g. Artificial Intelligence and computer Vision are fields that are not mashable
h. Build an object localization mechanism
Please put only the valid option ids separated by commas in the blank line. For example, if you think only a and h are valid, the answer line should be a,h
Please comment the answer at the very end of the page
Ques. 2
A regular polygon with n sides may be triangulated in many ways. Even if we require the different lines to not intersect inside the polygon, there are a number of ways this can be done. For example, for a hexagon (n=6), there are 14 ways.
Frank is conducting an online graphics course, where he will be giving a value of n, and expecting each of his k students to submit a different triangulation with no intersections. To help him, he asks his TCS friend to create a JAR (Java library) for him to compute the number of ways of triangulating a polygon, given n. This JAR implements the function PolygonTriangulateApi.noTriang, which accepts an integer parameter n, and returns an integer giving the number of ways of triangulating the n sided polygon.
Frank would like you to code a program in JAVA to get the value of k, and output the smallest value of n that would enable each of his students to submit a different triangulation. With k=12, the value of n is obviously 6.
Name of your class | PolygonTriangulate |
Input variable(s) in the Template | noOfStudents |
Output variable(s) in the Template | noOfSidesOfPolygon |
API Details | |
API Package | com.tcs.talent.api |
API Class | PolygonTriangulateApi |
API Method | noTriang |
Is static method? | Yes |
Input Argument(s) | int noSide − No. of sides of the polygon |
Returns | int − No. of triangulations possible for the given polygon |
Please comment the answer at the very end of the page
import com.tcs.talent.api.PolygonTriangulateApi;
import java.util.*;
public class PolygonTriangulate{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int noOfStudents = scan.nextInt();
int k=0;
int noOfSides = 0;
for(int n=3;;n++){
k = PolygonTriangulateApi.noTriang(n);
if(k>=noOfStudents){
noOfSides = k;
break;
}
}
System.out.println(noOfSides);
}
}
import com.tcs.talent.api.PolygonTriangulateApi;
import java.util.*;
public class PolygonTriangulate {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int noOfStudents = sc.nextInt();
int noOfSides = 0;
int k = 0;
for(int noSide = 3; ; noSide++ ){ //TimeComplexity = O(n)
k = PolygonTriangulateApi.noTriang(noSide);
if( k >= noOfStudents ){
noOfSides = knoSide;
break;
}
}
System.out.print(noOfSides);
}
}
//Correct Solution
import com.tcs.talent.api.PolygonTriangulateApi;
import java.util.*;
public class PolygonTriangulate {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int noOfStudents = sc.nextInt();
int noOfSides = 0;
int k = 0;
for(int noSide = 3; ; noSide++ ){ //TimeComplexity = O(n)
k = PolygonTriangulateApi.noTriang(noSide);
if( k >= noOfStudents ){
noOfSides = k;
break;
}
}
System.out.print(noOfStudents);
}
}
import com.tcs.talent.api.PolygonTriangulateApi;
import java.util.*;
public class PolygonTriangulate {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int noOfStudents = sc.nextInt();
int noOfSides = 0;
int k = 0;
for(int noSide = 3; ; noSide++ ){ //TimeComplexity = O(n)
k = PolygonTriangulateApi.noTriang(noSide);
if( k >= noOfStudents ){
noOfSides = noSide;
break;
}
}
System.out.print(noOfSides);
}
}
import com.tcs.talent.api.PolygonTriangulateApi;
import java.util.*;
public class PolygonTriangulate {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int noOfStudents = sc.nextInt();
int noOfSides = 0;
int k = 0;
for(int noSide = 3; ; noSide++ ){ //TimeComplexity = O(n)
k = PolygonTriangulateApi.noTriang(noSide);
if( k >= noOfStudents ){
noOfSides = k;
break;
}
}
System.out.print(noOfStudents);
}
}
//Correct Solution
import com.tcs.talent.api.PolygonTriangulateApi;
import java.util.*;
public class PolygonTriangulate {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int noOfStudents = sc.nextInt();
int noOfSides = 0;
int k = 0;
for(int noSide = 3; ; noSide++ ){ //TimeComplexity = O(n)
k = PolygonTriangulateApi.noTriang(noSide);
if( k >= noOfStudents ){
noOfSides = k;
break;
}
}
System.out.print(noOfStudents);
}
}
Correct Solution
import com.tcs.talent.api.PolygonTriangulateApi;
import java.util.*;
public class PolygonTriangulate {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int noOfStudents = sc.nextInt();
int noOfSides = 0;
int k = 0;
for(int noSide = 3; ; noSide++ ){ //TimeComplexity = O(n)
k = PolygonTriangulateApi.noTriang(noSide);
if( k >= noOfStudents ){
noOfSides = k;
break;
}
}
System.out.print(noOfStudents);
}
}
//Correct Solution
import com.tcs.talent.api.PolygonTriangulateApi;
import java.util.*;
public class PolygonTriangulate {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int noOfStudents = sc.nextInt();
int noOfSides = 0;
int k = 0;
for(int noSide = 3; ; noSide++ ){ //TimeComplexity = O(n)
k = PolygonTriangulateApi.noTriang(noSide);
if( k >= noOfStudents ){
noOfSides = k;
break;
}
}
System.out.print(noOfStudents);
}
}
//Correct Solution
import com.tcs.talent.api.PolygonTriangulateApi;
import java.util.*;
public class PolygonTriangulate {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int noOfStudents = sc.nextInt();
int noOfSides = 0;
int k = 0;
for(int noSide = 3; ; noSide++ ){ //TimeComplexity = O(n)
k = PolygonTriangulateApi.noTriang(noSide);
if( k >= noOfStudents ){
noOfSides = k;
break;
}
}
System.out.print(noOfStudents);
}
}
import com.tcs.talent.api.PolygonTriangulateApi;
import java.util.*;
public class PolygonTriangulate {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int noOfSidesOfPolygon = sc.nextInt();
int noOfStudents = 0;
int k = 0;
for(int noSide = 1; ; noSide++ ){
k = PolygonTriangulateApi.noTriang(noSide);
if( k >= noOfSidesOfPolygon ){
noOfStudents = k;
break;
}
}
System.out.print(noOfStudents);
}
}
Please provide more questions and answers for practice
Please provide answers of the given questions.