Sunday, December 31, 2017

multi threaded quick sort using pthreads in C/C++

multi threaded quick sort using pthreads in C/C++

#include <iostream>
#include <cstdlib>
#include <pthread.h>
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>

using namespace std;

int i=0;
pthread_t threads[5];


int x[20];

struct thread_data{
    int  upper_bound;
    int lower_bound;
    int *arr;
};
int semid;



void set_sem()
{
    semid=semget(12345,1,IPC_CREAT|0666);
    perror("semget");
    semctl(semid,0,SETVAL,5);
}
int get_sem()
{
    return semctl(semid,0,GETVAL,0);
}

void create_thread(int x[20], int first, int last);


sembuf psembuf={0,-1,SEM_UNDO};
sembuf vsembuf={0,1,SEM_UNDO};


void *quicksort(void *threadarg)
{

    int getv;
    semop(semid,&psembuf,1);
    getv=get_sem();
    cout<<"semaphore value  decrease to  "<<getv;
    struct thread_data *my_data;
    my_data = (struct thread_data *) threadarg;
    int first,last;
    first=my_data->upper_bound;
    last=my_data->lower_bound;
     int pivot,j,temp,i;
    if(first<last){
        pivot=first;
        i=first;
        j=last;
        cout<<"\nbefore done firts loop i = "<<i<<"j="<<j<<endl;
        for(int w=first;w<=last;w++) {
         
            cout<<endl<<"x["<<w<<"] ="<< *((my_data->arr) +w)<<endl;
        }
        while(i<j){
            while(*((my_data->arr)+i) <= *((my_data->arr)+pivot) && i<last)
                i++;
            while(*((my_data->arr)+j) > *((my_data->arr)+pivot) && j>first)
                j--;
            if(i<j){
                temp=*((my_data->arr)+i);
                *((my_data->arr)+i)=*((my_data->arr)+j);
                *((my_data->arr)+j)=temp;
            }
         
        }
        cout<<"\ndone firts loop\n"<<endl<<first<<endl<<last<<endl;

        temp=*((my_data->arr)+pivot);
        *((my_data->arr)+pivot)=*((my_data->arr)+j);
        *((my_data->arr)+j)=temp;
        for(int t = first;t<=last;t++)
            cout<<*((my_data->arr)+t)<<endl;
        for(int w=first;w<=last;w++) {
         
            cout<<endl<<"x["<<w<<"] ="<< my_data->arr[w]<<endl;
        }
        if (first < j-1) {
            cout<<"create thread first = "<<first<<"last = "<<j-1<<endl;
            create_thread(x,first,j-1);
        }
        else if (first == j-1 && my_data->arr[first]>my_data->arr[j]) {
            temp = my_data->arr[first];
            my_data->arr[first] = my_data->arr[j];
            my_data->arr[j] = temp;
        }

        if (j+1<last)
        {
            cout<<"create thread first = "<<j+1<<"last = "<<last<<endl;
            create_thread(x,j+1,last);
        }
        else if (j+1 == last && my_data->arr[last]< my_data->arr[j])
        {
            temp = my_data->arr[last];
            my_data->arr[last] = my_data->arr[j];
            my_data->arr[j] = temp;
        }
     
    }

 
 
 
    semop(semid,&vsembuf,1);

    // pthread_exit(NULL);
}


void create_thread(int x[20],int first, int last)
{
    int rc=0;
    i++;

    pthread_attr_t attr;
    void *status;
    int  getv;

    pthread_attr_init(&attr);
    pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
    cout<<" entered create thread" << i <<endl<<"first"<<first<<"last"<<last;
    struct thread_data td;
    td.upper_bound=first;
    td.lower_bound=last;
    td.arr=x;
    getv=get_sem();
    cout<<"semaphore value is  "<<getv<<endl;
    if(getv <  1 )
    {
        sleep(5);
    } 
    rc = pthread_create(&threads[i], NULL,
            quicksort, (void *)&td);
    if (rc){
        cout << "Error:unable to create thread," << rc << endl;
        exit(-1);
    }


    pthread_attr_destroy(&attr);
    rc = pthread_join(threads[i], &status);
    if (rc){
        cout << "Error:unable to join," << rc << endl;
        exit(-1);
    }

    cout<<"existing";

 
}


int main()
{

    int size,i;

    cout<<"Enter size of the array: ";
    cin>>size;

    cout<<"Enter  elements: ";
    for(i=0;i<size;i++)
        cin>>x[i];
    cout<<" hello "<<endl;


    set_sem();

    cout<<"semaphore set to "<<get_sem();
    create_thread(x,0,size-1);

    cout<<"Sorted elements: "<<endl;
    for(i=0;i<size;i++)
        cout<<x[i]<<" "<<endl;

    return 0;
}

Friday, December 29, 2017

IAS interview experience - 8

Interview transcript of CSE 2015 Interview Top Scorer (209/275) and Rank 58 (Nazuk Kumar)
My interview was scheduled in the afternoon of 28th April 2016. I was the third person to be interviewed in the afternoon slot. I was allotted Vinay Mittal Sir’s board. I have tried to recall as exactly as possible, but there may be minor variations.
I was a little nervous while entering the room, but thankfully that vanished when I went inside. The board consisted of five members, with the chairperson sitting in the middle.
Me: May I come in Sir? (With pleasant smile)
CM: Yes, please come in.
Me: Good afternoon Sir (to each member)
CM: Please take a seat
Me: Thank you Sir
CM: (Looking at my DAF) So, I see you have been very active. You have won many awards. What is this Bal Shree Award? (Luckily they started with areas of my strength)
Me: Sir this is a national award given by the President of India to children between ages 12-14, for creativity. There are four streams in which it is awarded – creative scientific innovations, creative performing arts, creative arts and creative writing. I was awarded in the scientific innovations category. The National Bal Bhawan conducts a three tier competition – local, regional and national level, to select the awardees.
CM: So what was your idea?
Me: Sir each level was a residential camp with multiple tasks. At the national level, one of our tasks was to present innovations with the theme of disaster management. I presented the concept of an accident safe car. It had features like a sleep detector, which would monitor the eye lid movement of the driver and prompt his/her seat to vibrate in case he/she feels sleepy. Another feature was an alcohol meter to analyze breath. This car would have sensors all around to optimize seat positions in case of a collision.
CM: Very interesting! This can have application beyond cars also. You should pursue it further. You went for the Physics Olympiad. Did you win anything?
Me: Yes Sir, I went for the Olympiad. I did not win a medal.
CM: Who won the maximum medals?
Me: The Chinese team.
CM: Why do you think they won the most medals? Why doesn’t India win?
Me: Sir, we don’t have the institutional set up to train for such events. We sent class 10 students for a class 12 level Olympiad. The Chinese team had very rigorous training.
CM: What else? Do you think planning has a role?
Me: Yes, we did not plan ahead for the event. The Chinese team trained for two years.
CM: You are an NTSE scholar? What is this?
Me: Sir, this is the National Talent Search Examination Scholarship conducted by the NCERT.
CM: You have worked with the Reserve Bank of India. What is this RBI Young Scholar?
Me: This is was a summer internship program, at RBI, for young people. It was based on a national exam conducted by RBI. We were each given a topic to study. My topic was financial inclusion. (I mentioned financial inclusion, even if not directly asked, to keep the conversation on a topic I was comfortable with)
CM: What work did you do? What were your findings?
Me: I studied the status of financial inclusion in three villages in Panchkula district of Haryana. I found that while most households had a bank account the usage of these accounts was very low. I also made some recommendations, some of which have now been incorporated in the PMJDY.
CM: What are the features of the PMJDY?
Me: The Pradhan Mantri Jan Dhan Yojna is a financial inclusion scheme to ensure that every household has a bank account. Banks have been mandated to open accounts and banking correspondents are also being used. XX number of bank accounts have been opened.
CM: Do you think it can happen? Will illiterate villager understand?
Me: Sir, currently the awareness level among villagers is not as much as it should be and there is a fear towards formal banking institutions. But, I think, the juncture at which the country is, it is apt time to make the transition. Slowly people will understand the importance banking institutions. (I remained positive)
CM: I see you have been active in college. You were a coordinator in rendezvous. What is this?
Me: Rendezvous is the annual youth festival at IIT Delhi. I was the publicity coordinator.
CM: And you have been active in debating also. What is this Model United Nations?
Me: Model United Nations is a format of debate where each participant represents a country and a global issue is discussed.
CM: What is this Sarva Shiksha Netra?
Me: In my summer vacation I worked for an NGO on a project called Sarva Shiksha Netra. This was a project with Sarva Shiksha Abhiyaan, Haryana. We screened all government school children, from class 1 to 8, for eye defects in seven districts.
CM: What is Sarva Shiksha Abhiyaan?
Me: Sir, it is a scheme started in 2001, aimed at universalization of primary education. It has now been supported by the Right to Education Act which makes education a fundamental right.
CM: What do you think are the problems in school education system in India?
Me: I think the most important link in any school is the teacher. In India, teaching needs to be perceived as a respectable profession so that we are able to recruit the best people. There recruitment should be more scientific. Teachers should have a defined career progression to keep them motivated. Teacher training can also help improve their capacity. Sir, other problems in our education system are infrastructure and funds. (Focused on one core issue, instead of giving a laundry list of issues)
Member 1: Ok Nazuk, can you compare India and Pakistan? Give marks to each based on performance
Me: Sir, I would like to divide this into economic, political and social aspects. Politically, India has done well. It is the world’s largest democracy. Elections are conducted in a smooth manner and each citizen has a voting right. On the other hand Pakistan is a very unstable state with multiple power centers, leading to inconsistent policies and even internal security issues. (The question was very open ended. It is better to structure such open ended questions into parts)
Member 1: How many marks would you give?
Me: Sir, I can analyze the issues in both the countries but I don’t think I have the expertise to give marks. (I was hesitant to give marks as that may have lead to a value judgement)
Member 1: No, go ahead, give marks
Me: Sir politically I would give India 7/10 and Pakistan (still hesitant)
Member 2: (laughing) Don’t worry you can give Pakistan less marks.
Me: Sir about 3/10. Next I would compare the countries on the economic front. India has shown impressive growth in the last decade and we have withstood the global financial crisis well. However growth in India has not been very inclusive. It did not lead to mass employment generation. Sir, I am not aware of the exact growth numbers of Pakistan, but as far as I remember they were not very impressive. I would give India 6/10 and Pakistan 3/10
Member 1: Ok that’s great, can we move on to the next question..?
Member 2: No, I want to hear the social aspect also.
Me: Sir, socially I think India has done well. The constitution of India recognizes right to equality and rule of law. In India, atleast on paper, women are given equal rights and many protections. There are many areas of potential improvement like the caste system that still exists. However the situation in Pakistan is much worse. I would give 7/10 to India and 3/10 to Pakistan.
Member 1: You were talking about education. Do you think you would take out time to teach children, if you are posted somewhere?
Me: Sir, I would definitely take out time to teach children as I think it’s a great way to unwind and to learn.
Member 2: Nazuk, you went to Carmel Convent School in Chandigarh. Why did you not go to the government model school?
Me: Sir, that decision was taken by my parents.
Member 2: Why do you think parents send their children to convent schools and not government schools?
Me: Sir, in Chandigarh even the government schools, like 16 model, are very good. However parents feel that their children will learn English better in a convent school. Further they feel that the quality of education would be better.
Member 2: If you were to improve 16 model school, what would you do?
Me: An important difference between a convent school and a government school is the awareness level of the parents. When parents form an effective pressure group, education quality improves in a school. Parents also help students perform better. Thus, I would empower the parent community. For example, in Delhi, they have started a simple initiative, where a question is sent to parents by SMS, related to what is taught in class that day. Using this the illiterate parents can also get involved in their child’s education. Other measures would be around teacher training. (Focus on one core issue rather than laundry list)
Member 2: Can you recall any famous saying by Gandhi and how is it relevant today?
Me: Gandhiji said that “an eye for an eye makes the whole world blind”. It is especially relevant today in the context of the nuclear arms race. If all the countries develop nuclear arms and in case these get used, it would lead to destruction of the whole world.
Member 2: Very good. What is Gandhiji’s trusteeship principle?
Me: Gandhiji said that the rich are the trustees of the wealth of the society and should use it for the betterment of the whole society.
Member 2: Ok. I will say a sentence, tell me what you understand by it – “If you want to go fast, go alone, if you want to go far take everyone along with you”
Me: Sir, I can relate this to sociology, which was my optional. If you want to go fast, go alone. Legal changes imposed top down create fast change, but this change may not be sustainable or widely accepted. If you want to go far take everyone along with you. To create durable change, it is important to create a bottom up consensus for that change. For example, in India we see that Dowry is prohibited by law but socially accepted custom. Similarly corruption is technically illegal but there exists a latent social acceptance for it. (Gave concept and supporting example)
Member 3: You are a sociology student, what are the major problems in India?
Me: Sir, some of the major problems are poverty, patriarchy…
Member 3: What else?
Me: Sir, caste is still a problem in India…
Member 3: What else? Do you think drugs is a problem?
Me: Yes Sir
Member 3: You come from an engineering college. Was it an issue in your college?
Me: Sir, it was not a pervasive issue, but the problem did exist among some students.
Member 3: What do you think can be done about this?
Me: To curb the drug menace the enforcement machinery needs to be strict. Police officers mostly know where and who is dealing with drugs.
Member 3: What about education?
Me: Educating the youth is equally important. It has to be a dual strategy of prevention and cure. Awareness generation is the more sustainable solution. As we have seen, in the case of smoking, now people’s awareness has increased and they are voluntarily not taking to smoking.
Member 3: When a bill is passed in the Parliament, it is sent to the President. The President can either assent to it, withhold it or return it. Can you give an example of each?
Me: The President can assent to the bill, for example the Right to Information Act. The President had withheld the Office of Profit Bill. Sir I am not very sure of the third one..(I was not sure of the answer to this, but luckily I remembered it)
CM: Take a guess…
Me: The Gujrat Bill against organized terror is one bill that the President has repeatedly returned.
Member 3: But that is a state bill
CM: I think we can give that to her. (I was very relieved!)
Member 4: You have done textile engineering. Can you describe the whole process of textile manufacturing?
Me: We start with ginning of the cotton followed by carding and combing. Next steps are roving and drawing to make yarn. This yarn is sized. Weaving or knitting then gives us fabric. This fabric is desized and finish treated. Finally the fabric is dyed and colored and then stitched.
Member 4: Between 10 and 20 tex yarn, which is finer?
Me: Sir… (I knew the concept but was double checking the answer in my mind)
Member 4: Do you know what is tex?
Me: Yes Sir, tex is defined as mass in grams per 1000 metres
Member 4: All right, I am satisfied. There are many textile dying units in Panipat, which create a lot of pollution. What do you think can be done about this?
Me: Sir, the pollution laws should be strictly enforced. The dying units should treat the waste, separate harmful heavy metals before discharging.
Member 4: Do you think consolidation can help in this?
Me: Yes Sir, a common treatment plant between units can effectively use economies of scale reducing cost of treatment.
Member 4: There are a lot of skilled artisans in the textile sector, who are not getting their due share as remuneration. What can be done about this?
Me: Artisans can form a cooperative to collectively bargain for better prices.
Member 4: What are the problems of textile industry in India? Why are we not able to compete in the international market?
Me: Sir, in India the average size of a textile unit is smaller than those in China and Bangladesh. Thus economies of scale are not that effective in Indian units, translating into a cost disadvantage. China has followed a cluster based approach which we are now starting with. Other problems hindering growth of textile sector are erratic power supply and labor union problems.
Member 4: Good. One last question. You spoke about education. There is a famous Indian origin economist who talks about the importance of education in growth. Do you know who am I talking about? (I was very happy to hear this question)
Me: Yes Sir, Amartya Sen. In fact I recently read his book, “An Uncertain Glory”.
Member 4: Which states does he talk about?
Me: Kerala and Tamil Nadu
Member 4: Thank you
CM: Thank you very much. You can leave
(I thanked everyone, put the chair back and left)
Out of the box' questions asked in IAS interviews:
Q 1. What if one morning you woke up and found that you were pregnant?
A. Girl: I will be very excited and take an off, to celebrate the good news with my husband.
Q 2. Twins(Adarsh and Anupam) were born in May but their birthday is in June. How's this possible?
A. May is the name of the town.
Q 3. If you had three apples and four oranges in one hand and four apples and three oranges in the other hand, what would you have?
A. Very large hands.
Q 4. Interviewer: He ordered a cup of coffee for the candidate. Coffee arrived; kept before the candidate, then he asked what is before you?
A. Candidate: Instantly replied "Tea"
He got selected.
Wondering why he said tea when he knows very well that coffee was kept before?
The question was "What is before you (U - alphabet) Reply was "TEA" ( T - alphabet)
Alphabet "T" was before Alphabet "U"
Q 5. How can a man go eight days without sleep?
A. He sleeps at night.
Q 6. How can you lift an elephant with one hand?
A. It is not a problem, since you will never find an elephant with one hand.
Q 7. If it took eight men ten hours to build a wall, how long would it take four men to build it?
A . No time at all as it is already built.
Q 8. A cat had three kittens: January, March and May. What was the mother's name.
A. What. It stated 'WHAT' was the mother's name.
Q 9. what is the opposite of Nag panchmi?
A. Nag did not punch me.
Q 10. James bond was pushed out of an airplane without any parachute. He survived. How?
A. The plane was on a runway.
PS: I know that y'all think questions (out of box) are extremely silly and meaning less, but earlier when CSAT wasn't just qualifying they used to ask some questions like these, I also can't believe they have asked these kind of dumb questions but sources say, they had!
If you want to check real transcript of GUARAV AGARWAL interview, check This: Praveen Kante's answer to What are the interview questions for ias?

IAS interview experience - 7

Mr. Ansar Shaikh CSE-2015 AIR-361.
Name: shaikh Ansar Ahamad
Age: 21, first attempt
Optional: political science
Date: 7th april, 2016. Forenoon session, 2nd to go in.
Board: Mr. PK Joshi (new, fresh board) Time 25-28 mins
Medium: Hindi
Note:- interview medium is hindi but he answered in both hindi and english language mix. So i translated it to English only.
Score:199/275
(Views r personal)
(I reached at Dholpur house at 11:40. The security allow me to enter only at 1pm. I was very excited to see the place which I saw in my dreams. It was the most precious day my life. It was 3pm When came and told me “ sir please come ,you are next to go in” i lost my calmness, my heartbeats and body temperature suddenly increased. I was waiting for 20 minutes outside the interview hall, every single minute was intolerable. I started remembering my parents and well wishers, but I was very confident, happy and pleasant ) and the game started like this.
Candidate: may I come in sir?
CP: yes ,please come in young man.
Candidate: good afternoon sir, good afternoon madam, good afternoon to all you sirs.
CP: Shaikh, please take your seat.
Candidate: thank you sir(smiling positively).
CP: (appreciating): you are just 22 years old?
Candidate: (With a smile) no sir, I am just 21.
CP: that’s really great(other members nodding positively).
CP: ok, you had done BA, BA is very risky, usually people do engineering. Good tell why do you want to join civil service?Tell in short, time is less.
Candidate: (smiling, thinking in mind time is less?) yes sir. Two incidence in my life which inspired me lot )
  1. sir, in our society there are a lot of evils ,which i had seen in my home itself. I had seen domestic violence, child marriage, dowry in my home.Polygamy and child labour also. So from childhood i hate these thing and feels very frustrated about it. I always wishes to change it.
  2. when i was in 10th standard ,i got another breakthrough. Our family belonged to the BPL that's why government had sanctioned 30000 RS for house construction. But one officer from tehsil had taken 3000 Rs as a bribe from my father. I was thinking, for buying 2 rupees i have to think ten time and abbu has given 3000 rupees easily. Thats time i realised poor people are big victim of corruption , then I decided if i want to change this things student from our section need to be part of the system.
CP: very good. (other members nodded positively) oh you listen to music. Which kind of music do you listen?
Candidate: sir, I like Bollywood music, I listen song which are in tune of my mood.
CP: ok. Which are your favorite movies? Just tell me 2-3 names.
Candidate: sir,swades is my favourite movie and
CP: What ?
M3:(lady member) sir he said swades, the shahrukh khan stared.
CP: ohh, and?
Candidate:and Neerja, Aligarh etc.
CP: you also like travelling. Tell me where you have travelled.
Candidate: sir, in Maharashtra I have travelled to Ajanta, ellora caves, some hill stations like Matheran.Outside Maharashtra I have travelled to puri, Odisha and now Delhi.
CP: what you have seen in puri?
Candidate: sir, i had seen puris beach and temple.
CP:when you are coming to delhi from pune,what do you observed?
Candidate: sir, i observed pollution has increased, when we crossed Uttar Pradesh(poor answer), in train I observed lack of sanitation. I also met some interesting people from north-east. (failed to talk about child labor at stations)
CP: ok. tell me the name of two NGO from Pune and their role.
Candidate: sir, there is an NGO named Friends of Children. Which belong to Forbes marshall,they provide eduction and stationary to poor children. there is another NGO called Muslim Satyashodhak Mandal, with whom I work, it works on 3 fronts. One, muslim religious reforms, two ,solving women issues like easier talaq, polygamy and try to bring uniform civil code . Third, to de-radicalize muslim youth and mainstreaming them.
CP: (passing to M1) (m1 was also good but he was expressionless, in the entire interview he didn’t smile. He asked me some factual and unexpected questions, this was the worst time of my interview)
M1: ok ansar, tell me what is poverty? Who gives data on poverty? How is it calculated?
Candidate: (in mind 3 questions at same time!!) sir, poverty is Lack opportunities like health,education and better standard of living. Sir, NSSO I.e gives data on it. It is calculated on the basis of different standards like consumption, health, education, house rent etc.(I was not confident while giving this answer, m1 was looking unhappy)
M1: ok. What is current number of poors?
Candidate: (I hate data. My god, why this is happening) sir aaa sir according to the kelkar commitee in india around 29% poverty .(it was C rangarajan, and not kelkar. I knew it but I lost my confidence.)
M1: ok ok.(he did not correct me, so sad.) tell me the changes made in LPG subsidy transfer recently.
Candidate: sir, government decided to rationalize subsidies, government initially launched a campaign GIVE IT UP which was voluntary, later they started PAHAL and recently government cut down subsidy of people whose income is beyond 10 lac .
M1:hmm. Recently there was a news related with repo, RBI etc. What was it?
Candidate: sir, several days ago RBI decreased Repo rate by 0.25% and Reverse repo rate by 6% .
M1: why?
Candidate: sir, government wanted to give boost to the economy, government also adhered to fiscal deficit target, and there is..(I wanted to say possibility of monsoon this year, but he interrupted me.)
M1: how it will give boost to economy?
Candidate: sir, decreased repo rate means there will be cheaper loans available in market. It will result in high investment, production and employment generation, and the growth cycle will increase.
M1: ok (I was unable to satisfy him. passing to M2, a lady member with a very positive look, she increased my confidence)
M2: ansar, you talk about that NGO which works on women issues. What exactly they do?
Candidate: sirr, oh I am so sorry Madam..(it was an effect of those Economy questions.)
M2: (with a very positive smile) no-no fine. Its fine. Its happens. Please go ahead.
Candidate:(thank god) madam, we basically prevent the talaq of female, we negotiate with their husband . We conduct the workshop and protests to stop easier talaq.
M2: ok, good. Are there any other women related issues on which you work?
Candidate: madam, our primary aim which i have told earlier that’s it no more.
M2: Ansar first you will become SDM then DM . Then what will be your priority? What is the mission ? Tell me like 1,2,3..
Candidate: madam, I have decided four mission . First, Rural development in which especially development of rural infrastructure, better health care and education. Second, women empowerment.Third, maintaining Hindu Muslim religious harmony(she nodded positively here) and fourth, poor centric, responsive, transparent governance.
M2: but how you will do it? It’s a big job.
Candidate: madam I will do it on two front . First, for all these thing whatever government policies, laws and schemes are available will carry out efficiently because lots of scheme never reach to grassroot level . Second, through the civil society, NGO, social media and school children I will try to change the attitude of people.
M2: but maintaining religious between Hindus and Muslim is not that much easy. How will you handle if there is a tension between two communities?
Candidate: madam, first of all I will find out the cause of conflict, then I will find who is legally right, then I will ask the leaders of both communities to come for negotiation and solve the issue. unfortunately if this not happen then I have to use force. However, negotiations is the key.
M2: you come from a very poor background, so you have availed any scholarship?
Candidate: madam, till 7th standard I had availed scholarship , after we managed ourselves.
M2: do you have not availed minority scholarship?
Candidate: no madam.
M2: why?
Candidate: madam,every time I am failed to give it on time ,and no wish to apply.
M2: yes, and amount are also so less.
Candidate: yes madam.
M2: now how to apply for that?online?
M4: yes it is available online.
Candidate: (nodded)
M2: ok. (passing to M3, a Punjabi gentleman, he too was cordial but expressionless, he was looking like an ex-army man with big eyes and pagadi)
M3: Ansar, there is one Gandhi and another Sarhadd(frontier) Gandhi. Who was Sarhadd Gandhi?
Candidate: sir, he was a freedom fighter. Who are against the partition and if partition happens he desires her region(forgot the name of the region) should be in India. They with their Red Shirts team struggled against British in peaceful Manner. They also conferred with bharat ratna.(when I said bharat ratna, CP smiled very positively.)
M3: you talked about de-radicalization, tell me the causes and remedies of radicalization of muslim youth. Oh but before tell me one thing, your marks in 10th was ordinary (76%) but in 12th you jumped to 91% ! How this happened?
Candidate: sir actually in 10th my subject was mathematics and science which I don’t like. Our teacher’s also not teach well. Maths teacher explains maths from guide. In 12th standard my subject was scoring like Sanskrit in which I have 100 out 100 marks and in vocal classical music also scored well.(here I forgot to tell about my restless hardwork hehehe)
M3: good your subject was scoring. Now answer the radicalization question.
Candidate: yes sir. There are a lot of reason for radicalization like spreading of thoughts trough social media, fringe elements hate speeches of main religion, spreading of wahabist ideology on large extent and lack of socio-economic development.
M3: and what are the remedies?
Candidate: sir, we need to work on causes like restriction on hate speeches of fringe element, taking special measure for development of muslim youths. and impose regulation on social Media and do counter-radicalization .(before I go ahead further he interrupted me )
M3: counter radicalization??
Candidate: I am sorry sir, I meant de-radicalization.
M3: no, no. I think you have used the right term, we must do counter radicalization, you are right. Ok you talked about Wahabism? What is it?
Candidate: sir, it is sunni militant ideology,which believe in convert the non-sunni people to sunni or end the non-sunni people, it is based on violence.(forgot Islamic state, Dar ul harv etc.)
M3: where does it originated?
Candidate: sir this ideology originated in Saudi Arabia.
M3: and now they are suffering from it.
Candidate: yes sir.
M3: there was a world sufi conference. What is the difference between Sufism and wahabism?
Candidate: sir, wahabism is based on violence whereas Sufism is based on love and peace. Wahabism is intolerant towards non sunnis, whereas Sufism is accommodative. They don’t believe in religion or cast, they only believe in humanity.
M3: ok. Are you a sunni or shia?
Candidate(very very instantly) I am a muslim sir, an Indian muslim, rest of it I don’t know.( this answer will be game-changer)
(everyone appreciated this answer, all of them smiled positively.lady member said something about me with a big laugh.)
M3: ohh, good. Just asked because as you talked about wahabism, but good, very good.
M3-passing to the M4
(M4 was probably the oldest member in the panel. I noticed him observing my body language in the entire interview, he was very cordial.)
M4: Ansar you studied in a Zilha parishad school, then you went to Badrinarayan barwale college and later on you went to fergusson college. Tell me what did you experienced in these institutions?
Candidate: sir, in our school there was no toilet and drinking water facility. Lectures also not happening well. Some teachers solving mathematics by using books. But in barwale college lectures also happening very well, infrastructure also very good. but when I have come to fergusson college, then I realised I am again in the school. There are also same problem like school, no cleanness of toilet and shortage of drinking water. some professor are taught from books and notes .However, fergusson college have very good history, I really like my college.
M4: yeah, may be it still relive on history. There is issue with principal of fergusson college what is it?
Candidate: sir, after the JNU incidence, in our college ABVP have planned an interactive session with our college student. but they don’t have a written permission, due to this some Ambedkarite student of fergusson college started protesting. That result into hooting between these two group. Student is shouted slogan like “Bharat mata ki jai”. Unfortunately under the pressure ,our principle has written letter to police,like subject to anti-national slogan in our campus. When police has come some tension was created (lady member: oh) next day principal has declared that letter was a typing mistake. I mean it is ridiculous! (when I said ridiculous, everyone started laughing.)
M4: and there was another incidence in FTII, what was the issue? Don’t you think it was a fruitless protest ?nothing gain from it .
Candidate: sir, our country is a democratic country, that’s why everyone have a right to protest and demand. FTII students wants the FTII chairman should be a person who is meritorious ,and NEWSPAPERS coverage it like endeavor of saffronization . so I feel government needs to think about it. However I feels any Protest should be peaceful, there should not be problem for other student.classes disruption should not be there because tax payers money are wasted this way.
M4: do you listen to sufi music ?
Candidate: sir not mostly but sometime I listen to atif aslam and nusrat fateh ali khans sufi songs. (lady member smiled positively on this answer.)
M4: ok. (Passing again to CP)
CP: ansar, when do you come to delhi?
Candidate: sir, on 28 february.
CP: oh, where do you stayed?
Candidate: sir, near Mukherji nagar there is organization named Zakat Foundation which provide accommodation to poor and minority student. I stayed there.(now the fun starts again)
CP: ok, I too studied Sanskrit. tell me how did you score 100 out of 100 in Sanskrit?
Candidate: sir, in our area there is culture, score good marks, teach scoring subjects, do mug up and conquer.Unfortunately I had also did same(ratta maro and jeeto).(I said this in such funny tone that every member started laughing.)
CP: what a thing ,we had also did same.(ratta maro and jeeto) (laughter everywhere, even I failed to control my laugh, I was supposed to smile in such interview, but what to do)
CP: so tell me do you remember anything from Sanskrit? Tell me the What is the word for “GO” in Sanskrit?
Candidate: sir, Gaccha?
CP: good, now tell me the Past, present and future tence of Gaccha.
Candidate: sirr... I am sorry sir, I don’t remember. but I know one word related to Gaccha, Gacchami. Which means I go.
(CP and M4 talked something about Gachhami)... sir I also remember a shlok in Sanskrit, can I say it?
CP: no. no.... ok ansar your interview is over, wish you all the best for your future.
Candidate: (instead of standing up, I was just looking happily towards CP)
M4: now Gacchami Gacchami.(u may go) (this resulted into a big laughter,,hahahahah)
Candidate: thank you. Have nice day. (all were looking my way of going out.)
When I came outside, I wanted to dance. I said to myself, well done.The entire interview was like a friendly discussion except that economy part.
No questions from optional, International relations, home state issues, no provocative issues, no difficult questions(may be because of my age.)

IAS interview experience - 6

17/05/15 UPSC Dholpur House
Lasted-35 mins
Optional-Eng Literature
I was allotted Prof. David R Syiemlieh ( Currently UPSC Chairman )board.After documents verification I headed to waiting hall.Little bit fear was bit obvious,water was not crossing the throat..I normalised myself and took magazine
After two hours of wait I was called in at 1340hours
Got into the room...wished chairman and board members..I was calm comfortable little shivering
C- So you all ready had been interviewed earlier by UPSC?
Me-yes Sir
C-what are your choice for services
Me- IPS IAS IFS IRS
C-why IPS as it is getting tougher day by day?
Me- my dad is serving state police officer ...and basic reason is that I have always charm for Uniform.There is a respect attached to your rank uniform and position. People treat you with a huge amount of trust they expect that justice will definitely be received here. They are positive that there is someone who is going to solve their problems. That is the kind of trust they have in you and that trust is big thing
Mere in 29-30 age you are leading more than 5000 men and you are leader whose responsibility is to keep their safety on the top priority and security of district with population of more than lakhs
C- which is most important quality a police man must have?
Me-Discipline and problem solving skill.
C- Please elaborate
Me-Gave few examples
C- . What are the qualities your father as a police man gives you?
Me: Sir, discipline, punctuality ....he interrupted in between...and extended me to lmember 2 and gave smile
C- what r the best ways to develop self discipline according to u?
Me- Start by picking small easy things and try doing them for a set period of time. As you accomplish them, build up to things that are harder for you to do. When you get to the point where you are not able to achieve the thing you are working toward doing sit back take a deep breath and look long hard and honestly at why you are not getting there. mental strength keeps getting stronger as you train it. It takes time. Thats why to build a habit it takes over 30-40 days But once you can build or change a habit it gets easier to change another.
Chairman laughed and said that still he is trying to be disciplined.Good points u gave.
I nodded with Smile.
C- 1st Sanik School then NDA
Then private pilot then u acquired helicopter pilot license then again CDS n CAPF then instructor at ur flying school now Civil services
What is all mess up with u?
Why so fickle?
Do you like mix-veg or trying to be genius ?
Me - (most challenging question )
I replied this question astutely
But still he was not satiated \U0001f60f\U0001f611
M1- which newspaper do u read?
Me- The Hindu
M1- what was Arab Spring..why Mohammad Morsy got death sentence with his 105 supports despite of Egypt's freely elected president ?
Me-Gave brief history n current situation
M1- what were the bills passed by the Parliament in this session?
Me-LAAR,black money,GST
M1- do you think black money can be bring back by govt?
Me-I explained in my words...
M1-what is Scotland peaceful revolution ?
Me- I told him as it was related to recent UK elections.Scottish National Party SNP won 56 of Scotland’s 59 constituencies reducing the dominant Labour Party north of the border from 41 seats at the previous election to a single seat.
M1-Do u think its mixture of public anger and disappointment exists towards Labour in Scotland that has built up over decades?
Me- Gave
M1- what are the conditions for recognition of national and state party?
A- For national party
If it secures 6% of valid votes polled in any 4 or more states in GE of LS or inLA
If it wins 2 % of of seats in LS
If it recognised as state party in four states
Told for state party too
M1- how many national parties are there
Me- approx 6 or 7
M1- Tell me right number
Me- sir 7
M1- which party is majority in Bihar ?
Me- no party is in majority as Bihar govt is alliance of JDU and RJD
M1- who is Father of all- India services in constituent assembly
Me- VB Patel
M1- are u sure
Me- 100% sure
M2-are u working Siddharth ?
Me- yes Sir part time
I m instructor at MP flying club
Take few flying classes along with navigation and Radio aids.
M2- it seems you complete your PPL and HPL
Why didn't u continued ur carrier as a pilot with good money and position?
Why IPS?
( Most frequent question of my all interviews )
Me- Gave answer and convinced him
M2- from where u did ur licences ?
Me- PPL- mp flying Indore
HPL- Pawan hans Mumbai
M2-Why do we sometimes see water being sprayed over aircrafts?
Me- Sir it's called water salute.
For a new airline company operating out of the airport for the first time.
A new airplane operating commercially for the first time
If the Captain of the airplane or an ATC member is retiring.
If the airline is closing down the route and its the last flight of that airline from that particular airport.
M2-What is Flight Service Station and an Air Traffic Controller
Me- I know ATC so I told
But have few info about FSS as it z US based
M2-Why India is lagging in jet engine technology
why can't we make powerful jet engines
What is wrong with Cauvery engine of LCA?
Me- I elaborated him the points like superior tech infra
Less budget for RnD
Patent issues
Not quality techies n education
N more
M2- what is CRGO
Me- after thinking
Sorry sir,I don't know.
M2-it's cold rolled gain oriented steel used to make turbine engine blades.
M2-Why do we not receive mobile signal when flying in a plane?
Me-told
M2-what is thrust to weight ratio?
Me-if an engine produces thrust more than the vehicle weighs it can overcome gravity and accelerate when pointed straight up.this capacity is called T2W ratio.
M2- do any transport aircraft have this capacity ?
Me-it's impossible sir
It is only in fighter aircrafts like
F-15 strike eagle
MiG-29 fulcrum
Mig35 OVT
M2- your favourite jet n why?
Me- F-22 raptor n told all about that
M2-do u heard about Sukhoi berkut?
Me-yes sir it was prototype FJ of Sukhoi corp
M2-why it was in news?
Me- no idea sir.
M3 gave me 2 cases studies one by one to solve
He asked me about United Nations origin
UNSC
Peace keeping forces
International court of justice
And Amnesty International
M3- why MP is underdeveloped,
What are the main problem of your state and VYAPAM scam?
Me- I told him all as I practiced this question in my mock interview sessions
M3- what are gilt edged securities ?
Me- I don't know sir
( I knew that answer but during course of time not clicked in mind )
M3-(random question)
Tell me name of some Girish Karnad plays ?
Me- no idea sir.
M3- (random question)
Tell me about Shivaji administration and Astapradhanas ?
Me- Shivaji was an autocrat like any one other ruler of his time he however ensure that he did not misuse the great power vested in him. He had a council of 8 ministers, the Ashta Pradhan who assisted and was a kind of advisory council.
Peshwa- Prime Minister
Amatya- Finance Minister
Mantri - Chronicler who kept a daily account of court
amant- Foreign Secretary who advised the king on all matters of war
Senapati- army commander
Nyayadish- Chief Justice
Pandit Rao - religious chief
Sachiv- Home Secretary
M3- what was chauth n sardeshmukhi
Me- chautha which was 1/4th of the territory's income and Sardeshmukhi which was an additional 10% levy on the chauth as a tribute to the ruler.
M3- which technique make Shivaji invincible ?
Me- guerrilla warfare
M4- how El- Nino system works
Me- In the Pacific Ocean the water closest to the equator is warmed by the sun
That warm surface water helps to create more clouds which in turn dump rain over wherever they happen to be.Most of the time the wind over the ocean blows from east to west due to the spinning of the Earth
M4- El Niño system happens every year
Me- sir it usually happens in 4-6 years
M4-which was hottest year on record due to El Niño?
Me-2014
M4-no its2010
M4- which is fastest supercomputer of the world
Me- blue jean
M4- no
It's Tianhe-2 of China
Me-sorry Sir
M4-what is difference between
Cruise missile and ballistic missile
Me-A ballistic missile is launched directly into the high layers of the earth's atmosphere. It travels well outside the atmosphere and then the warhead detaches and falls back to earth. It follows the path of a ball thrown upwards which falls down. Since it depends on gravity to reach its target, it's called a ballistic missile.
A cruise missile does exactly what its name says. It cruises over land or over water. Its working is similar to a jet engine powered airplane.
M4-What is
Subsonic
Supersonic
Hypersonic
Infrasonic
Me- subsonic - less than speed of sound
Supersonic - speed greater than sound
Hypersonic - above 5 Mach
Infrasonic - frequency Less than audible sound
M4- had hypersonic speed ever achieved yet?
Me- no idea sir
M4- yes it is achieved by x-15 rocket plane space Shuttle orbiter
M4- you practicing Kriya yoga?
Tell me about it?
Me-Kriya means action and Yoga means integration. Kriya Yoga emphasises integration of separative consciousness with an awakenedness
that is a non-elective holistic attention free from mental fragmentations through actions of perception and not through the activities of conceptualisation.Itwas 1st propounded by Lahri Mahashay of Varanasi.
Member 4 asked me about the problem of naxal areas n lower Muslim areas...gave case study
Chairman- Thank u Siddharth
You may go now
Me- thank you sir
Have a nice day.
My Review - surprisingly no questions from my optional.
My interview was more than average
Based on my DAF
Very technical interview
I hesitated n fumbled in some questions But I sailed astutely in storm...
All members were smiling face except M3 Poker face .I enjoyed my interview,It was one of the most challenging PI of my life.