Wednesday, June 23, 2010

python challenge: room 3

python challenge: room 3

here's my solution:
import re

infile = open('c:\\python26\\MyProgs\\inputfile_room3.txt' , 'r')
instring = infile.read()
infile.close()


p = re.compile( r'[^A-Z][A-Z]{3}(?P<answer>[a-z])[A-Z]{3}[^A-Z]') 
print p.findall(instring)


#solution is "linkedlist"



solution url:
http://www.pythonchallenge.com/pc/def/linkedlist.php

Tuesday, June 22, 2010

python: list comprehensions - examples

There are excellent examples from Guido's site, perfect for a quick review of "list comprehensions":


>>> vec = [ 2, 4, 6 ]
>>> [ 3*x for x in vec ]
[6, 12, 18]
>>> [ 3*x for x in vec if x > 3 ]
[12, 18]
>>> [ [x , " squared is " , x**2] for x in vec if x > 1 ]
[[2, ' squared is ', 4], [4, ' squared is ', 16], [6, ' squared is ', 36]]

>>> #tuple generation
...
>>> [ (x, x**3) for x in vec ]
[(2, 8), (4, 64), (6, 216)]

>>> #generate a list whose elements are teh values of pi, from 1 to 6 decimal places
...
>>> [ str( round(22/7.0 , i) ) for i in range(1,7) ]
['3.1', '3.14', '3.143', '3.1429', '3.14286', '3.142857']

python challenge: room 2

challenge from room 2



my solution:
import re

infile = open('c:\\python26\\MyProgs\\inputfile.txt' , 'r')
instring = infile.read()
infile.close()

#find all non-word characters ...
p = re.compile('\W|_') 

# ... and remove them from instring, 
# so that only word characters are left in instring
print p.sub('', instring) 



official solution

python: to do

  • finish pythonchallenge
  • learn python 3.0
  • http://www.techinterviews.com/python-interview-questions-and-answers
  • http://www.geekinterview.com/Interview-Questions/Programming/Python
  • list comprehension
  • filter
  • lambda
  • map
  • list generators / generators

Wednesday, June 2, 2010

questions to ask the interviewer!

WORK METHODOLOGY AND WORK STYLE

  • What kind of software engineering methodology is
    practised here?
    Agile, Iterative, Waterfall?

  • Do you
    have something like a "Quick Response Team" that monitors and handles
    critical/production issues?

  • Is quality control here more
    proactive or reactive? Do you have PCVs? PreCheckinVerifications?
    Do
    testers have test cases ready before the dev drop? Do testers
    automate
    some of these major test cases prior to dev drop? Do
    testers automate at all?

  • What is the timeframe for a
    typical major release/milestone? (We used to have a significant
    milestone in 6-8 weeks in Pi - minor milestones would be done in 1-2
    weeks, depending on urgency of the bugfix/release).

  • Level
    of whitebox testing: Do testers here look at code? Do you
    encourage them to?

  • Can QAs attend dev design
    discussions
    ? If not, then can the QA get a design dump as soon as
    design is finalized?

  • Do Devs write their own unit
    tests
    for each feature that they develop? Does QA accept the dev
    drop only after all unit tests have passed?

  • What kind of
    source control do you use? CVS, SVN, Git, Mercurial, Bazaar?

  • How
    do you feel about documentation?
    What kind/level of
    documentation do you follow for:
    - business requirements
    - software requirements specifications (SRS)
    - software design spec
    - coding (code commenting standards, wiki pages, etc)
    - testing
    (overall test plan for a given team+milestone, feature test spec, test
    suites, test cases)
    - defects (defects db,

CULTURE AND ENVIRONMENT
  • TRICKY, HARD-HITTING QUESTION: Do you encourage
    employees to work on technical projects of their own? Do you support
    them by giving them, say, half a day per week to pursue their personal
    projects? Otherwise how do you expect employees to be innovative and
    passionate about technology? (i.e. citing examples of projects on
    DechoLabs - the URL Security Tester that would pass null and bogus
    parameters to the URLs in the hope of causing a crash e.g.)

    Another example is the TestLabAutomation initiative (Django project) that Biju and I had started.

  • How seriously does your company take CSR (Corporate Social Responsibility)? What initiatives and programs does your company currently have for this?


  • Do programmers have a quiet work environment? If I want to have a discussion with my cube-mate, do I have to schedule a meeting in a meeting room?

  • How is the work environment here? Rigid/formal or open/relaxed/casual?

  • What are the working hours like? How strictly are work hours enforced?

  • What are the recreational facilities? What do employees do here when they're not working? Is there a TT table? Is there a gym?



references:
http://stackoverflow.com/questions/329289/really-wow-them-in-the-interview