How to get 80 percent in TCS OPA easily

To know how to clear the TCS OPA easily, clearly follow all the steps mentioned and you should know basic Object oriented Programming. If you don't know OOPS don't worry. I will explain in this article.

Object Oriented Programming(OOPS):

Lets understand simply. OOPS is simply using the objects in our program. It's aims to implement Polymorpism, Inheritance, Abstraction, Encapsulation etc in our program.

Check this example, suppose there are 50 students in the class and that particular class has 6 subjects/courses. How can store all the marks of subjects in different subjects?

We can simply store the marks of all students by using OOPS concept. By using concept of CLASS we declare 6 variables of subjects of float datatype. Simply declare different objects for different students.

CLASS: Class represents the set of properties or methods that are common to all objects of similar type.

class Student{
float s1, s2, s3, s4, s5, s6;
.
.
.
}

Student c1=new Student();  //Student1 object
Student c2=new Student();  //Student2 object
.
.
.
Student c50=new Student();   //Student50 object

Then for Student1(c1) marks are c1.s1(subject1),c1.s2(subject2) ans so on.

I hope you clearly understand this. If you have any doubt Comment.


Here are few steps to clear any Question in Online test.

1) Most of the times in the OPA, the length of the question is so long that is given to confuse the students.

Whenever we such large problem statements, we start to panic and feel difficult to read.

Be Patient, read the question carefully. They ask to create one class and initialize all attributes using Constructor or getter and setter methods.

Next, they ask you to create another class and implement 2 methods in it. The functionality in these methods are most likely to compare all the objects, get the maximum value of attribute etc.

They ask to implement your own main function.

All the OPA's questions are most likely in this template. Be Patient and completely read the question.

2)  After reading the question, once check the given input testcase. Based on the testcase try to write the main function.

For example, the testcase is like

4
1
Yes
3
No
87
2
No
4.5
Yes
123
3
No
0.5
Yes
56
4
No
4
Yes
104
87

According to the variables value declared in test case write the main function

n=int(input())
pv=[]
d={}
for i in range(n):
    vehicleSeq=int(input())
    fourWheeler=input()
    parkedFor=float(input())
    valetParking=input()
    lnum=int(input())
    p=ParkedVehicle(vehicleSeq,fourWheeler,parkedFor,valetParking)
    d.update({lnum:p})
    pv.append(p)
rv=int(input())
pl=ParkingLot(d)
li=pl.uPS(rv)


3) Then again check the question and try to implement the methods. 

Most of the questions has two methods to implement and mostly they are like compare the objects or return the object of maximum value.

Once check 12th June Question, they asked to implement two methods updateParkedStatus and getParkingCharges.

In updateParkedStatus method, we need to check for the particular object and change the value of variable to "Parked"

In getParkingStatus method, we need to calculate the parking charges of vechile based on lotnumber.

For better understanding of variables, once check the question in the blog.

4) After implementing the methods, if you have complete knowledge of OOPS you can return the variables.

Mostly they ask to return int variables or reference of class.

If you confused in returning the variables, simply change return type to void and print the values.

Note: I recommend returning the values as that is the right way to learn the subject.

This is only a post to encourage students to complete their TCS OPA examination. Keep Working Hard.

If you have any doubt in solving the question or any TCS OPA related doubts. Feel free to comment, I can help you within 1 hour.

If you want to get notified about TCS OPA solutions and coding Subscribe to this Blog.

Have a nice day.





1 Comments

  1. hey hi.... the opa/ira is now changed to cpa(camera proctored assessment) for the incentives... i started to learn java a year back and left the idea... now can you tell me what are all the things that has to be practiced to clear that cpa... i need few sources through which i could have some as reference...
    then, i would like to know the frequency of repetition of programming questions and even mcq...
    thanks in advance...hope u will reply soon.

    ReplyDelete

Post a Comment

Previous Post Next Post