Pre COBOL Test
Pre COBOL Test
Pre COBOL Test
For the following questions use pseudocode, or descriptive prose, to detail your
solution.
1)You have an unknown number of strings of a fixed max length. Describe how you
would sort this group, using the least complex method possible. You are free to
use whatever methods you can think of to accomplish this task.
2)Describe how you would search the group of strings from question #1 using the
quickest method possible. You are free to use whatever methods you can think of
to accomplish this task.
I would use a binary search algorithm to search from the sorted set of data.
The binary search algorithm is usually the most efficient when compared to
other algorithms. An algorithm such as this can accomplish this task more
easily.
a. The total charged by each nursing station for each patient type
b. The total charged on each floor for each of its nursing stations
c. The total charged for each floor in the hospital
Using the above levels of subdivision that require tracking, in which manner
would you group the charges in order to minimize the data stored by the program?
(Make sure to show which attributes you would need to track alongside those charges in order to
properly group them by the different levels of subdivision.)
I would have a linked list for the list of patients and the list of nursing
stations and the list of floors. For each item in the list, it will have a list of
items that are being charged. I would use a tracking collection to keep tabs
on them.
Describe how you would traverse a dataset, following the above design criteria in
the quickest way possible, in order to generate each of the three levels of
reporting requested.
For each item in the nursing station list, a list of items will exist (either
patient or floor). After traversing, I would simply count the total charged by
each station for each patient type, and the charge total for each floor in each
station, and a (total) sum of the charge total for each floor in each and every
station.
4)Write a function that processes user input for a system that provides a menu to add
to, search, and view patient data. Use a looping construct for this. Utilize integer
switches where applicable.
See Number 4.txt.
5)Write a function that accepts and validates user input for a system that accepts
patient demographics (name, birth date, address, gender, etc). Future-proof your
design so that it may more easily be modified to change the characteristics that
determine whether or not the input is valid. Use Boolean switches where
applicable.
See Test.java
6)Detail the design for a simple program that outputs data and handles user
interaction in a stateless system (in other words it does not keep track of
configuration settings, transaction information, or any other data for the next
session).
A set of http web scripts (i.e. perl, javascript, asp.net) allow a user to
login/view/click certain pages and links, which are gathered from a database.
However, the user is not given the privilege to modify any components. No
cookies are used. Query strings and sessions are used only for the current
session and cannot be changed. When the browser is closed or the user clicks
the logoff link the session is destroyed.
7)Detail the design for a simple program that outputs data and handles user
interaction using an event handler.
To design an interface in Java, simply create the GUI by writing code for it
in a class. When this GUI performs actions, the resulting data can be easily
controlled and manipulated to receive/translate information, as well as in
other sub procedures that will exist in potentially other classes. The final
output can be stored in a listbox or other component, or perhaps a database
or file.
When the flow events are documented and defined, and the program
executes smoothly, it can be known that the module or program is working;
after needed examination and testing the program will be ready for release.
When the whole project is compiled and packaged, a jar file for an applet
can be created. It will be running as a component on a system that has been
using the JRE, with the source code intact.
8)You have a system that neither gives you access to a pointer data type, nor does it
allow you to directly manage memory. You do, however, have access to a file
system of theoretically infinite size. Implement a self-referencing dynamic data
structure.
See /linkedlist
9)You need to write a function that performs substring manipulation. You have a
deadline of two weeks for the project of which it is a part. You cannot be 100%
certain that this project will not be interrupted by another task. The program does
have the ability to exec system calls. There are no dynamic data structures,
memory management functions, pointer data types, or thread functions. It will
take you 1 week to write a stable, easy to maintain, and fast function from scratch
to perform this task.
10)While fixing a bug in a pre-existing piece of software, you notice another function
that performs a slightly different task. How does this effect what you are doing?
I would not make any immediate changes as of yet. I would try to determine
the immediate cause of the bug, but I would try to ignore the function
performing the slightly different task. I would most likely get clarification
and take a few moments to recall what is happening.
11)The following items are all important to a successful software project. However,
there are times when a tight schedule will force you to make sacrifices. With that
in mind, rank these items in the order in which you would sacrifice them in order
to meet a deadline, where 1 would be the first thing sacrificed:
a. Detailed Design
b. Code Complexity
c. Clear Requirements
d. Unit Testing
e. Detailed Specifications
f.Integration Testing
g.Code Re-Use
h.Detailed Black Box Testing
i.Concise Code Documentation
i, g, e, h, b, a, c d, f
12 3 4 5 6 7 8 9
12)Unix Knowledge:
a. How would you rename a file named foo to bar?
mv foo bar
b. How would you move a file /usr1/foo to /usr2/f/foo?
mv /usr1/foo /usr2/f/foo
c. How would you copy a file /bin/bar to your home directory?
cp /bin/bar $HOME
d. When would you use sed? sed is a stream editor. A stream editor is
used to perform basic text transformations on an input stream (a
file or input from a pipeline).
e. When would you use awk? To do pattern matching and data (text
and numeric) manipulation.
f. How would you search the current directory to find those files with the
string "foo" in their contents? find . -name "my*" -type f
g. How do you combine files foo and bar into a file named widget?
cat foo bar > widget
h. How do you find your current directory? cd
i. How does unix handle ownership and permission levels?
Every user on a Unix system has a unique username, and is a member of at
least one group. This group information is held in the password file (/etc/passwd). A
user can also be a member of one or more other groups. The auxiliary group
information is held in the file /etc/group. Only the administrator can create new
groups or add/delete group members (one of the shortcomings of the system).
Every directory and file on the system has an owner, and also an associated
group. It also has a set of permission flags which specify separate read, write and
execute permissions for the 'user' (owner), 'group', and 'other' (everyone else with
an account on the computer). Chmod tells the permissions for a file or directory.
13)Experience Self-Evaluation:
a. What previous experience do you have in programming or software
design? I was a software engineer for Linx, a programmer for the
Supreme Court - LA, I have written numerous software design
projects as a student, and did an internship at inFront Devices and
Systems.
b. What is your strongest language? Java SDK
c. Do you have experience in web development? I have done projects
using web development scripts/tools. (ie .net, php, javascript,
xhtml, etc.)
d. Have you worked with a stateless system before? Yes.
e. Have you worked with an event driven system before? Yes.
f. Do you normally write subroutines from scratch or do you utilize
library functions? Both. If there exists a simple function to
accomplish a task, I would use a subroutine. If none exists, I
would write one.
g. How do you go about documenting your code? I write a very detailed
description and comments after finishing most of the coding. I
write instructions in a file to review or update, as needed.
h. Have you used a versioning system or protocol before? Yes. TCP/IP,
UDP, HTTP (sockets), SOAP, WSDL, XML (programming
assignment)
i. Have you programmed in COBOL before? No.
j. Are you comfortable in vi? Somewhat, I have used it before.
k. Are you comfortable with UNIX? Yes, I have used it before and
recently.
l. Do you know how to program in a scripting language like sh? Yes, I
have used perl scripting and some shells.