Skip to content

Instantly share code, notes, and snippets.

@nkrumm
Forked from nhoffman/codesample.rst
Last active January 13, 2026 22:53
Show Gist options
  • Select an option

  • Save nkrumm/cbbfb331e9f8ff8f1244bf716b2d35c0 to your computer and use it in GitHub Desktop.

Select an option

Save nkrumm/cbbfb331e9f8ff8f1244bf716b2d35c0 to your computer and use it in GitHub Desktop.
Python code sample

Web app code sample

We're looking for a full-stack web/applications developer who can build solutions for our laboratories and bioinformatics teams. One useful way for us to get a sense for your skill in these areas is in the form of a working code sample. Here's what should be a fairly straightforward exercise:

  • Build a simple web page that performs a web BLAST query against nt using a DNA sequence read in via a form field (or from a file in FASTA format if you like).
  • It should validate the input to be of valid FASTA format.
  • Once the results are available, they should be displayed in a simple table. Include the fields that you think are most informative.

Requirements

Please make sure the application can be run locally!

Here are some example input sequences to try out:

>NC_009085_A1S_r15 NC_009085.1 Acinetobacter baumannii ATCC 17978 chromosome, complete genome.
ATTGAACGCTGGCGGCAGGCTTAACACATGCAAGTCGAGCGGGGGAAGGTAGCTTGCTAC
TGGACCTAGCGGCGGACGGGTGAGTAATGCTTAGGAATCTGCCTATTAGTGGGGGACAAC
ATCTCGAAAGGGATGCTAATACCGCATACGTCCTACGGGAGAAAGCAGGGGATCTTCGGA
CCTTGCGCTAATAGATGAGCCTAAGTCGGATTAGCTAGTTGGTGGGGTAAAGGCCTACCA
AGGCGACGATCTGTAGCGGGTCTGAGAGGATGATCCGCCACACTGGGACTGAGACACGGC
CCAGA
>NC_003909_BCE_5738 NC_003909.8 Bacillus cereus ATCC 10987, complete genome.
GATGAACGCTGGCGGCGTGCCTAATACATGCAAGTCGAGCGAATGGATTAAGAGCTTGCT
CTTATGAAGTTAGCGGCGGACGGGTGAGTAACACGTGGGTAACCTGCCCATAAGACTGGG
ATAACTCCGGGAAACCGGGGCTAATACCGGATAACATTTTGAACCGCATGGTTCGAAATT
GAAAGGCGGCTTCGGCTGTCACTTATGGATGGACCCGCGTCGCATTAGCTAGTTGGTGAG
GTAACGGCTCACCAAGGCAACGATGCGTAGCCGACCTGAGAGGGTGATCGGCCACACTGG
GACTGAGACACGGCCCAGA

This isn't meant to consume a lot of your time - a minimal solution is fine.

@dhoogest
Copy link
Copy Markdown

@yeemey
Copy link
Copy Markdown

yeemey commented Apr 19, 2022

@crosenth
Copy link
Copy Markdown

@nkrumm - Can you add having README with basic usage and setup as a requirement?

@crosenth
Copy link
Copy Markdown

crosenth commented Aug 10, 2022

Does Please make sure the application can be run locally! mean setting up Blast+ and running blastn on a local computer? We had a candidate who interpreted it that way.

@dhoogest
Copy link
Copy Markdown

Proposed update:

Web App Code Sample

We’re looking for a full‑stack web/applications developer who can build practical tools for our laboratories and bioinformatics teams. To help us understand your approach to building small, real‑world solutions, please complete the following short exercise.

This is meant to be a modest task — a clean, minimal implementation is perfectly fine.

What to build

Create a small web application that:

  • Accepts a DNA sequence via a text field or an uploaded FASTA file.
  • Validates that the input is in valid FASTA format.
  • Submits the sequence to NCBI BLAST (using blastn against the core_nt database) via the Biopython BLAST API:
    https://biopython.org/docs/latest/api/Bio.Blast.NCBIWWW.html
    Note: You do not need to set up a local BLAST database — the Biopython API calls the NCBI web service.
  • Displays the BLAST results in a simple, readable table.
    Please include at least: hit title, accession, percent identity, alignment length, and e‑value.
    (You’re welcome to add more if you think they’re helpful.)

Requirements

  • Use Flask or FastAPI.
  • Use Bootstrap for basic layout and styling.
  • Either server‑side templates or a small API + client page is fine.
  • The app should run locally in an isolated environment — a Python virtualenv or Docker are both totally fine.
    Just include the appropriate files (e.g., requirements.txt or a Dockerfile) and clear instructions on how to start it.

Deliverables

Please provide:

  • The working application code.
  • A short README that describes:
    • How to run the app locally.
    • Any design decisions or assumptions you made.
  • (Optional but appreciated) A tiny test that checks your FASTA validation logic.

Example Input

Here are some sample sequences you can use:

>NC_009085_A1S_r15 NC_009085.1 Acinetobacter baumannii ATCC 17978 chromosome, complete genome.  
ATTGAACGCTGGCGGCAGGCTTAACACATGCAAGTCGAGCGGGGGAAGGTAGCTTGCTAC  
TGGACCTAGCGGCGGACGGGTGAGTAATGCTTAGGAATCTGCCTATTAGTGGGGGACAAC  
ATCTCGAAAGGGATGCTAATACCGCATACGTCCTACGGGAGAAAGCAGGGGATCTTCGGA  
CCTTGCGCTAATAGATGAGCCTAAGTCGGATTAGCTAGTTGGTGGGGTAAAGGCCTACCA  
AGGCGACGATCTGTAGCGGGTCTGAGAGGATGATCCGCCACACTGGGACTGAGACACGGC  
CCAGA  

>NC_003909_BCE_5738 NC_003909.8 Bacillus cereus ATCC 10987, complete genome.  
GATGAACGCTGGCGGCGTGCCTAATACATGCAAGTCGAGCGAATGGATTAAGAGCTTGCT  
CTTATGAAGTTAGCGGCGGACGGGTGAGTAACACGTGGGTAACCTGCCCATAAGACTGGG  
ATAACTCCGGGAAACCGGGGCTAATACCGGATAACATTTTGAACCGCATGGTTCGAAATT  
GAAAGGCGGCTTCGGCTGTCACTTATGGATGGACCCGCGTCGCATTAGCTAGTTGGTGAG  
GTAACGGCTCACCAAGGCAACGATGCGTAGCCGACCTGAGAGGGTGATCGGCCACACTGG  
GACTGAGACACGGCCCAGA  

Notes

This exercise helps us get a sense of your coding style, clarity, and how you approach a small but realistic task. It’s intentionally lightweight — focus on a simple, well‑structured solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment