The interview
- introductions - 5 minutes
- discussion - 45 minutes
- q&a - 10 mintues
The goal
- to build a team of go developers that will work closely with the biostrand development team to develop their product
The product
- a web app that sits on top of apis written in go
- the app is a the tool data scientists use to run predictions of various ai models as well as perform complex search to retrieve information from various data sources such as medical publications etc.
- the core business is related to the biomedical sector
- the product is in its infancy and will allows to get creative
Open ended discussion.
We want url shortener (tinyurl clone) web app that exposes a rest api. There is no need for UI.
The requirements are:
- A customer sends a request with a url to minify
POST /api/v1/url
- The app responds with the short url
- A user sends a request to
GET /:id
- The app responds with the 301/302 and the location header set to the original url.
(optinal)
- A user sends a request
GET /api/v1/url
- The app responds with the long url to redirect
The above urls are restful, but could also be RPCs (ie. POST /api/url/shorten
, no strongs commitments.
We expect the candidate to ask questions about the app:
- the design
- the requirements,
- the traffic volume,
- the request and responses etc.
We expect the candidate to talk about the:
- domain logic, modeling (ask for pseudocode)
- layered architecture (api, domain, repository etc)
- data(base) modeling (sql knowledge as well)
- the hashing function (hashing the id vs the long url, size of the id, collissions, encoding methods, md5/crc/sha1, base62)
- response codes
- error handling and recovery
We expect the candidate to talk about the business logic and write a method in pseudocode that expresses that.
An example of a method that uses the long url as input to create the short url:
def createShortUrl(longUrl)
record = db.find(longUrl)
if record
spawn cache.set(record.shortUrl, longUrl)
return record.shortUrl
shortUrl = hash(longUrl)
if db.exists?(shortUrL)
// already exists, means collision
// retry with predefined string
else
db.save(longUrl, shortUrl)
spawn cache.set(shortUrl, longUrl)
return shortUrl
An example of a method that uses a unique id generator to create the short url (better for collisions):
def createShortUrl(longUrl)
record = db.find(longUrl)
if record
spawn cache.set(record.shortUrl, longUrl)
return record.shortUrl
id = createID()
shortUrl = createFromID(id)
db.save(id, longUrl, shortUrl)
spawn cache.set(shortUrl, longUrl)
return shortUrl
An example of retrieve method:
def findLongUrl(shortUrl)
longUrl = cache.get(shortUrl)
if longUrl
return longUrl
record = db.find(shortUrl)
if record
spawn cache.set(shortUrl, record.longUrl)
return record.longUrl
return null
- database (rdbms, redis, nosql or other (memory?))
- reliability
- caching
- binary
- rsync
- containers
- gitops
- vm
- k8s
- cloud
- scaling (load balancing, proxying, routing, microservices, vertical, horizontal)
- rate limiting
- caching
- reliability
We expect the candidate to create
- a visual representation of the setup/architecture
- ideally a flowchart for the decision making
- (and a sequence diagram for the reqest flow?)
https://excalidraw.com/#room=6f142069f272b9b7f00d,Smxh0NAt1q8JZb4D0dsBvw
Targeted to more junior devs.
Optionally start with some points from their CV. They should be able to explain:
- what they did
- why they did it in that way
- how they did it
- why thet did it in general from a business perspective
What happens when you type in your browser "google.com"
Expect the candidate to talk about:
- DNS
- browser being the client
- OSI
- Networking (ip4/ip6, routing)
- Server/app responding to a get request to the home path
- Any form of possible app routing
- Http request/response
- The browser parsing the response body and rendering the page using html/css
- Non-happy path endings (timeouts, 4**, 5** etc)
What is rest? Can you give an example of using rest to manage a for example a user?
What is a relation database? What are the key characteristics? ...
How would you handle the following scenario:
You have an app and there is a requirement for a new feature. The new feature, except for the code change, just so happens it also requires a change in the database, for example a new column needs to be added in a table or a column needs to be removed.
What would your actions be for each of those cases, in order to deploy your new feature without downtime.
What is a container? What is kubernetes?