Thanks for cloning this project. This project is mean for conducting a technical interview for C# developers.
Good luck 🤞
There are a few ways you can submit your answers:
- Zip and send the code back to the contacting HR.
- Just post your forked project link to HR.
You are provided (you dont need to implement) a .net standard library that mock a pricing system.
The api simulated getting prices from external services.
See the diagram below:
The library has a class named “TradingApi” which implement interface:
public interface ITradingApi
{
/// <summary>
/// Get full list of symbol definitions, only two symbols are supported: “AUDUSD” and “CL-OIL”.
/// </summary>
/// <returns>Symbols</returns>
IEnumerable<Symbol> GetSymbols();
/// <summary>
/// If there is an in-coming price and the symbol of the price is subscribed by SubscribeSymbol <see cref="SubscribeSymbol"/> an event will fire, the pricing data is passed as event data.
/// </summary>
event EventHandler<Price> OnPricing;
/// <summary>
/// Subscribe a symbol to receive prices though OnPricing event handler
/// </summary>
/// <param name="symbolName">name of a symbol</param>
void SubscribeSymbol(string symbolName);
}
public struct Price
{
public string Symbol { get; }
public decimal Bid { get; }
public decimal Ask { get; }
public DateTime Time { get; }
}
public class Symbol
{
public string Name { get; set; }
public string BaseCurrency { get; set; }
public int Digits { get; set; }
}
public class PriceStats
{
public decimal Open { get; set; }
public decimal Close { get; set; }
public decimal High { get; set; }
public decimal Low { get; set; }
}
You tasks are to complete these controllers and services to full fill the following requirements. The controllers and services are already created created,
-
GET /api/symbols • Return a list of all symbols
-
GET /api/symbols/{name} • Return a single Symbol object with the {name}
-
GET /api/price/{symbol} • Return the latest Price of a {symbol}
-
Get /api/price/{symbol}/stats • Return the PriceStats that contains Open, Close, High and Low, for the current Minute, for a given symbol.
a. Open - The first Bid price in the minute
b. Close – the last Bid price in the minute
c. High – the highest Bid price in the minute
d. Low – the lowest Bid price in the minute