This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Pipeline as Code and have Mohamed Labouardy on-line!
See this thread for details.
Win a copy of Pipeline as Code this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

Interview Functional Questions

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello All
Durig one of the latest Interviews for the Position for Senior Software Developer I was asked following Questions:
1) You have a 3 Tier Typical Architecture Search Application with millions on entries in Databse and suppose a you are searching for a Keyword and you are getting thousnads of records, with 100 on One page and 20 pages like this. This System is Multu- user which means number of Users are accessing the System at any point of time. What Design Approach do you propose?
I suggested 2 Design approaches:
One was to cache the results in the applications which I didn't see feasible. The second was the hit the Database again when the user client on to "Next" page to get Records from 101 to 200. He wasn't happy about both of it. Regarding the second approach he asked how do the SQL String know that user is looking for Records from 101 to 200 and not Records from 1 to 100.
He was interested in knowing if there is any way where I can directly get the results from Dataabse.
2) This is the Collcetion problem. He said I want to implment a Collection for Employee objects. Each Object will have few attributes such as Salary, Join Date, Age, blah blah. In the first Option I want to access the records in Sequence ( For Ex: get all the Employees with Increasing Salary) and in Second one I want to access the records with Key Value Pair (For Ex : Get all the Employees with their Ages). Remember He wanted me to do it with only one Collection. This was confusing to me too.
3) He wanted to know how SAX parser work functionally. He gave an Example:

He was interested in how the SAX parser will find the Employee with Pay = 12000 and Age 35.
4) How do i write a Query to get the Seond highest paid Employee from a company from Employee table.
5) Whats Outer join?
He wasnt happy about the Answer I gave him. He wanted some example
[ June 30, 2003: Message edited by: Ajit Wadekar ]
 
Ranch Hand
Posts: 1327
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
is this a DBA or database architect/developer job or software developement
whats the salary like
 
Ajit Wadekar
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This was for the Position of Senior Java Developer. Also I am trying to add some xml code into the Post. Not able to do it
Ajit
[ June 30, 2003: Message edited by: Ajit Wadekar ]
 
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


1) You have a 3 Tier Typical Architecture Search Application with millions on entries in Databse and suppose a you are searching for a Keyword and you are getting thousnads of records, with 100 on One page and 20 pages like this. This System is Multu- user which means number of Users are accessing the System at any point of time. What Design Approach do you propose?


Do you think the following pattern would be a "decent" answer to this question?
http://java.sun.com/blueprints/corej2eepatterns/Patterns/ValueListHandler.html


2) This is the Collcetion problem. He said I want to implment a Collection for Employee objects. Each Object will have few attributes such as Salary, Join Date, Age, blah blah. In the first Option I want to access the records in Sequence ( For Ex: get all the Employees with Increasing Salary) and in Second one I want to access the records with Key Value Pair (For Ex : Get all the Employees with their Ages). Remember He wanted me to do it with only one Collection. This was confusing to me too.


What do you mean by using one Collection?
Since I see this as a sequence, I can leverage some of the Collection, or Util
methods so I would implement Comparable and override compareTo() method. What do you think?


3) He wanted to know how SAX parser work functionally. He gave an Example:
code:

12000
35

He was interested in how the SAX parser will find the Employee with Pay = 12000 and Age 35.


Can you further elaborate on this question? What is your answer and did he find anything wrong with it?

Did you try escaping your less-than, and greater-than sign symbols?


4) How do i write a Query to get the Seond highest paid Employee from a company from Employee table.


I am assuming that this "query" is a SQL query.
Hmm, not too sure. I don't know too much about SQL. First I would look if SQL support
this kind of function. If not, I'll sort the results in descending order and pick out the second item in the sequence (i dont think this is the answer they are looking for, but who knows)
[ June 30, 2003: Message edited by: Hung Tang ]
 
Saloon Keeper
Posts: 23414
159
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

How do i write a Query to get the Seond highest paid Employee from a company from Employee table.


This question is fundamentally flawed. Firstly, because it carries an implicit assumption that there is exactly one employee who makes the greatest amount of money in the company and that additionally, there is only one making the the next lowest amount. Statistically reasonable, but not guaranteed. And I don't like writing software or queries that assume.
Further, in a pure business sense, this isn't cut and dried. Look at an annual report and you'll see that the president often has a base salary less than some of the other officers. However, at that level you get bonuses, stock options, perks, etc. So from a practical sense, just asking for salary rankings doesn't accurately reflect how much an upper-level employee costs the company.
So there.
However, in the theoretical universe, you could do something like "select max(salary), employee_id from salary_table where salary < max(salary)".
SQL isn't very standard, however, so the results might not be correct on all DBMSs. A subquery would help (for DBMS's that support subqueries!).
In any event, I wouldn'ty be surprised to learn that often there's less overhead in simply grabbing the first employee off a straight descending ranking whose salary is less than the salary in the first retrieved record.
I suspect in an actual job interview, that if you picked nits like this, they'd probably not hire you anyway. Even though it indicates that you're more likely to do real-world jobs right, it makes them look foolish.
... And, speaking of nits, the SAX parser doesn't "search" or "find" anything. All it does is parse. Finding things in what it parses is someone else's job.
You shold be able to display XML better if you turn off the HTML option for your post. Also the CODE UBB feature will keep the BBS software from messing up the text layout.
[ June 30, 2003: Message edited by: Tim Holloway ]
[ June 30, 2003: Message edited by: Tim Holloway ]
 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For the first question the idea of a sql cursor comes to mind (e.g. FORWARD ONLY SCROLL_INSENSITIVE). I thought I remembered the cursor caches the info for you.
 
There is no beard big enough to make me comfortable enough with my masculinity to wear pink. Tiny ad:
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic