AMCAT Automata Important questions 2015

Useful important AMCAT automata questions which will definately come in your AMCAT paper. Please go through them before giving AMCAT. Lets see them.

Hello Today I am sharing some useful important AMCAT automata questions which will definitely come in your AMCAT paper. Please go through them before giving AMCAT. Lets see them.

Question 1: There is a colony of 8 cells arranged in a straight line where each day every cell competes with its adjacent cells(neighbour).
Each day, for each cell, if its neighbours are both active or both inactive, the cell becomes inactive the next day, otherwise it becomes active the next day.

Assumptions:
The two cells on the ends have single adjacent cell, so the other adjacent cell can be assumsed to be always inactive.
Even after updating the cell state. consider its pervious state for updating the state of other cells. Update the cell information of all cells simultaneously.
Write a fuction cellCompete which takes takes one 8 element array of integers cells representing the current state of 8 cells and one integer days representing te number of days to simulate.
An integer value of 1 represents an active cell and value of 0 represents an inactive cell.

Program:

int* cellCompete(int* cells,int days)
{/
}
//function signature ends

TEST CASES 1:

INPUT:
[1,0,0,0,0,1,0,0],1

EXPECTED RETURN VALUE:
[0,1,0,0,1,0,1,0]

TESTCASE 2:

INPUT:
[1,1,1,0,1,1,1,1,],2

EXPECTED RETURN VALUE:
[0,0,0,0,0,1,1,0]

Question 2: Write a function to insert an integer into a circular linked _list whose elements are sorted in ascending order 9smallest to largest). The input to the function insertSortedList is a pointer start to some node in the circular list and an integer n between 0 and 100. Return a pointer to the newly inserted node.

The structure to follow for a node of the circular linked list is_
Struct CNode ;
Typedef struct CNode cnode;
Struct CNode
{I
nt value;
Cnode* next;
};C
node* insertSortedList (cnode* start,int n
{/
}/
/FUNCTION SIGNATURE ENDS
TestCase 1:
Input:
[3>4>6>1>2>^],5
Expected Return Value:
[5>6>1>2>3>4>^]

TestCase 2:

Input:
[1>2>3>4>5>^],0
Expected Return Value:
[0>1>2>3>4>5>^]

Given the maximum size of the cache and a list of integers(to request from the cache), calculate the number of cache misses using the LRU cache algorithm. A cache miss occur when the requested integer does not exist in the cache.

Question 3:  The LeastRecentlyUsed(LRU) cache algorithm exists the element from the cache(when it's full) that was leastrecentlyused. After an element is requested from the cache, it should be added to the cache(if not already there) and considered the most recently used element in the cache.

Initially, the cache is empty.  The input to the function LruCountMiss shall consist of an integer max_cache_size, an array pages and its length len.

The function should return an integer for the number of cache misses using the LRU cache algorithm.
Assume that the array pages always has pages numbered from 1 to 50.

TEST CASES:

TEST CASE1:

INPUT:
3,[7,0,1,2,0,3,0,4,2,3,0,3,2,1,2,0],16

EXPECTED RETURN VALUE:
11

TESTCASE 2:

INPUT:
2,[2,3,1,3,2,1,4,3,2],9

EXPECTED RETURN VALUE:
8

EXPLANATION:
The following page numbers are missed one after the other 2,3,1,2,1,4,3,2.This results in 8 page misses.

CODE:
int lruCountMiss(int max_cache_size, int *pages,int len)
{/
/write tour code
}

Question 4:  A system that can run multiple concurrent jobs on a single CPU have a process of choosing which task hast to run when, and how to break them up, called “scheduling”. The RoundRobin policy for scheduling runs each job for a fixed amount of time before switching to the next job. The waiting time fora job is the total time that it spends waiting to be run. Each job arrives at particular time for scheduling and certain time to run, when a new job arrives, It is
scheduled after existing jobs already waiting for CPU time Given list of job submission, calculate the average waiting time for all jobs using RoundRobin policy.

The input to the function waitingTimeRobin consists of two integer arrays containing job arrival and run times, an integer n representing number of jobs and am integer q representing the fixed amount of time used by RoundRobin policy. The list of job arrival time and run time sorted in ascending order by arrival time. For jobs arriving at same time, process them in the order they are found in the arrival array. You can assume that jobs arrive in such a way that CPU is never idle.

Also read: AMCAT Automata Important questions 2015

The function should return floating point value for the average waiting time which is calculated using round robin policy.
Assume 0<=jobs arrival time < 100 and 0<job run time <100.

Question 5: Mooshak the mouse has been placed in a maze.There is a huge chunk of cheese somewhere in the maze.The maze is represented as a twodimensional array of integers, where 0 represents walls.1 represents paths where mooshak can move and 9 represents the huge chunk of cheese........... See this Full Question with answer here.

BLOGGER: 2
1. pls post ans for ques.2

2. Ok, I will try to answer the 2nd question , very soon.

## Related Articles

Name

ltr
item
MindxMaster: AMCAT Automata Important questions 2015
AMCAT Automata Important questions 2015
Useful important AMCAT automata questions which will definately come in your AMCAT paper. Please go through them before giving AMCAT. Lets see them.