Skip to content
This repository was archived by the owner on Nov 5, 2022. It is now read-only.

cw-engineering/interview-challenge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Craneware Interview Challenges

Set of engineering challenges with the focus on finding a good solution and applying well known engineering practices and code design principles.

Coding Challenge

1. String utilities

A. Write a method to reverse a string

In the StringUtilities project, there is a method called Reverse in StringExtensions class. Implement this method so that it returns the input string in reverse order.

Examples:

Input:  "FooBazQux"
Output: "xuQzaBooF"
Input:  "Hello Bar"
Output: "raB olleH"

B. Write a method to sanitise a string

In the StringUtilities project, there is a method called Sanitize in StringExtensions class. Implement this method so that it replaces invalid characters in the input string with underscores. Multiple consecutive invalid characters in the input string must be replaced by a single underscore.

Examples:

Input:  "Abc.d$ef", ['.', '$']
Output: "Abc_d_ef"
Input:  "Hello code", [' ', 'l', 'o']
Output: "He_c_de"

2. Implement a code to provide and shuffle a pack of cards

Add code to the CardGame project. The project already contains contracts (interfaces) that must be implemented. The implementation must contain the following:

  • Provide a standard pack of 52 cards,
  • A card can be removed from the top of the pack,
  • The pack can be shuffled which will:
    • Return all removed cards to the pack so that the pack is reset to all 52 cards,
    • Randomise the order of cards in the pack.

Example:

pack.TakeCardFromTopOfPack();
pack.Shuffle();
Debug.Assert(pack.Count==52);

Design Challenge

3. Design a RESTful API service

Design a RESTful API service that will output an average temperature of the last 5 days for a given geolocation. You can use openweather API to retrieve the data to use.

Use cases

Consider the following necessary use cases

  • Service accepts a geolocation (latitude and longitude)
  • Service has high availability
  • Service is resilient

Constraints and assumptions

  • Support only anonymous users
  • Service is efficient on resource allocation e.g. same location might be requested many times
  • Service should prevent being exploited by automated tools

The aim of the design challenge is to come up with an approach and a design that can be reviewed and elaborated during the interview. The design challenge is required only to contain a high level design diagram - any notes or details or specifications on the design challenge are not necessarily required to get submitted. However, they can greatly facilitate and drive discussions.

Notes:

  • All challenges can have multiple approaches. Can you think of these and explain their pros and cons?
  • The implementations should follow TDD
  • Publish your answers on a Git repo that can be reviewed & discussed during the interview
    • A commit history that shows the coding progress of coding challenge should be present

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages