Interview Question

liunx

Guest
Hi Friends,
I was asked in an interview..that the user logs-in and depending upon the gender of the user,which is stored in the database,the site displays different stylesheets .I said read the gender value from the database from your JSP and depending upon that use the stylesheets.But they said..."we need to select the css dynamically at runtime and not statically"..and this went over my head...i said "I don't know"..and guess that was the reason I lost the job.But I am still wondering what would be the correct answer to this question.If anyone understands that terminology in quotes..please lemme know the answer.
ThanksI am not 100% sure if this is the right answer, but here goes.

I would just set up a Jave script to read the input box, then set up along the lines of If M then This, Otherwise this.(I would give the code, but its early)

That would be dynamically, as it does it>mickscool
06-17-2005, 07:03 AM

Ok Thanks Friends,
As one of my friends said.."css cannot choose anything dynamically/runtime"...i too questioned the interview on this thing before saying "i dont know"...i said.."according to me everything is chosen at runtime so there's no issue of static or dynamic bonding".Anyways there were 5 ppl interviewing me...and having only less then 1 year exp. with css it was very hard not to say "i dont know".But from your constructive comments..i'm sure i'll handle a situation like this better for the next time.
ThanksAs you related the conversation, what I get from it is that you actually answered their question, but perhaps in too little detail. They didn't understand that what you said was you would dynamically establish which style sheet to use based on the value in the database. How would you do it? It all depends on the language options available, but one method would be to build that portion of the page (the CSS file include) via PHP. After all, some language has to run on the server side in order to query the database, and it certainly can be PHP.

Why did you lose out on the position? As previously mentioned, you said "I don't know", and you didn't educate the client (interviewers). What's my answer to this kind of question? The online environment is so versatile, obviously it can be done, it's how to do it most efficiently that we need to determine. What are my language options? :D
 
Back
Top