Technical Web Programming Interview Questions

Using browser default CSS, hyperlinks are displayed with a blue underline. Suppose you are writing a website and instead, you wish the default to be bold red font, with no underline. What would you put in your stylesheet?

Now suppose that when the user hovers their cursor above the hyperlink you want the text to turn green. What would you add to your stylesheet?

Suppose you have two CSS rule sets defined .bold {font-weight: bold; } and .bordered {border: 2px solid #CCC;} Write an additional rule-set that selects elements that are both .bold and .bordered and changes the font color to red?

Describe a schema (or classes) to power an online restaurant reservation system. Describe the tables and the relationships beween the tables.

This system should allow a user to reserve a table at a restaurant for a certain time period and a certain party size.

It should allow the restauranteur to configure the system to describe their restaurant and manage reservations.

Think http://opentable.com

Explore the basics of the display attribute:

  1. What are the possible values for the DISPLAY attribute?
  2. What's the default value?
  3. What the difference between display:none and visibility:hidden?

Explore the basics of the position attribute:

  1. What are the possible values for the POSITION attribute?
  2. What's the default value?
  3. How does the browser decide where to position absolute elements?

Complete the following Django model to illustrate how a manufacturer can make many different types of cars.

Give manufacturer a name, founding date and a country.

Give car a name, cost, engine capacity and color. Assume that the manufacturer makes cars in only {red, green, blue and pink}.

class Manufacturer(models.Model):
    # A car manufacturer

class Car(models.Model):
    # A type of car

What is a signal in Django? Where might you use one? What's the difference between send() and send_robust()? When might you use one over the other?

What does the following code do? What's another way of doing the same thing?

from django.core.signals import request_finished
from django.dispatch import receiver

@receiver(request_finished)
def my_callback(sender, **kwargs):
    print "Request finished!"

Complete the following Django form to include:

  • A subject with a maximum length of 100 characters
  • An optional, boolean, cc_myself field
  • A sender field that will be validated as a correctly formatted email address
from django import forms

class ContactForm(forms.Form):
    message = forms.CharField()

Given the following HTML:

<div class=”article”>
<h1>Buddy In-law</h1>
<p>A friend of a friend of yours. <a href=”https://www.google.com/?q=someone">Someone</a> you have yet to meet, but is friends with your friend. Someone you share a mutual friend with. Someone you share a mutual buddy with.</p>
</div>

How would you:
1. Change the paragraph font to Verdana?
2. Change the font size of the heading to a 20px
3. Change the font color of all anchors in article paragraphs to pink. Change the hover state color to red
4. Justify the paragraph text
5. Make the whole article 600px wide and center the heading