Algorithms_Challenge_1437119830017.pdf

Share Embed Donate


Short Description

Download Algorithms_Challenge_1437119830017.pdf...

Description

TCS Ignite Open Lab

TCS Ignite Open Lab Algorithms Challenge

Computers are good at following instructions, but not at reading your mind. -

 Donald Knuth Knuth

Computer Scientist and author of the seminal multi-volume work The Art of Computer Programming  1

TCS Ignite Open Lab

Cover Page:

Ruminating Calf   A ruminating calf drawn in oil pastels greets trainees as they exit our high-tech lecture hall, signaling a time and space for reflective learning. Ruminating Calf © by J.. !gnite, "C# The Artist  J rabha$ar, $nown as J.., is a Chennai based artist who speciali%es in pen-and-in$ line drawings. &ith no formal education in art, J.. is entirely self-schooled. Although his wor$ is focused exclusively on the sacred arts and his themes tend to be temples, monuments and sculptures, he innovates constantly in terms of techni'ue, technology, materials, form and content. (is pursuit of excellence is a constant source of inspiration.

2

TCS Ignite Open Lab

The TCS Ignite Open Lab – Algorithms

The Challenge

In this challenge, you will write algorithms to solve two problems.

The Interviewer Candidate Problem

"aiting Room

Interview Room

Refer to the diagram above. It is a wal!in!interview setup having an interview room with one chair and a waiting room with a number of chairs. The interviewer interviews candidates in the interview room. "hen the interviewer finishes interviewing a candidate, he dismisses the candidate and goes to the waiting room to see if there are other candidates waiting. If there are, he brings one of them to his room and interviews him. If there are no candidates waiting, he returns to his chair in the interview room and continues reading his last unfinished maga#ine. If there are no unfinished maga#ines, he starts reading a new maga#ine. $fter he finishes reading one full maga#ine, he goes to sleep.

%ach candidate, when he arrives, loos to see what the interviewer is doing. If the interviewer is reading a maga#ine, the candidate waits for the interviewer to finish reading the current page of the maga#ine. Then the candidate enters the interview room and ass the interviewer to interview him. If the interviewer is sleeping, the candidate waes him up and then ass the interviewer to interview him. If the interviewer is interviewing another candidate, the candidate goes to the waiting room. If there is a free

3

TCS Ignite Open Lab chair in the waiting room, the candidate sits in it and waits his turn. If there is no free chair, then the candidate leaves.

&ased on a naive analysis, the above description should ensure that the wal!in! interview functions correctly, with the interviewer interviewing any candidate who arrives until there are no more candidates, and then reading maga#ines and'or sleeping until the ne(t candidate arrives. In practice, there are a number of problems that can occur that are illustrative of general scheduling problems. )lease discuss those problems and provide an algorithm to solve those problems.

*ote+ There are two doors between the interview room and the waiting room. Tip+ Read literature on the ining )hilosophers problem

Satyaaki and Yudhistras problem

Imagine that two divisions of the )andava army are camped outside an enemy camp of -auravas commanded by &hishma. %ach division is commanded by its own general Saatyai and /udhishtra. The two generals can communicate with one another only by messengers, who might get caught by the -auravas. $fter observing the -aurava camp, Saatyai and /udhistra must each decide independently whether to attac the -auravas or not. Then they must each communicate their plan to the other through messengers. 0pon receiving a message from the other, both Saatyai and /udhistra must decide a common plan of action. The )andavas can succeed only when both Saatyai and /udhishtra attac the -aurava camp at the same time.

iscuss the above problem in detail and provide a solution to the same. /our submission must not e(ceed 1 pages and should either be in .t(t, .doc or .pdf format.

Scope and %ffort

The total e(pected effort is about 2 person day.

4

TCS Ignite Open Lab

)rere3uisites

 $ny science graduate registered in Open Ignite can attempt this challenge. This challenge re3uires candidates to have some bacground in computer science.

Submission )rocess

/our submission to each of these problems should not e(ceed 1 pages. The submissions can be in t(t, .doc or .pdf format

%valuation

/ou will be evaluated based on the following parameters.

S!"o! #!

Parameter  Originality of your solution

$!

 $bility to learn

%!

Clarity in e(planation of solution

&!

 $bility to wor in a team

5

View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF