{"id":347,"date":"2023-06-01T10:37:19","date_gmt":"2023-06-01T03:37:19","guid":{"rendered":"https:\/\/thoaicoder.com\/?p=347"},"modified":"2024-01-10T15:03:42","modified_gmt":"2024-01-10T08:03:42","slug":"a-use-case-of-treemap-in-a-fintech-platform","status":"publish","type":"post","link":"https:\/\/thoaicoder.com\/index.php\/2023\/06\/01\/a-use-case-of-treemap-in-a-fintech-platform\/","title":{"rendered":"A use case of TreeMap in a fintech platform"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\">1. What is TreeMap<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">TreeMap is a data structure that provides an ordered collection of key-value pairs. It is essentially a <strong><a href=\"https:\/\/en.wikipedia.org\/wiki\/Binary_tree\">binary search tree<\/a><\/strong> sorted by its keys, allowing for efficient searching, insertion, and deletion operations. A TreeMap is implemented using a <strong>Red-Black<\/strong> <strong>tree<\/strong>, which is a type of self-balancing binary search tree.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">TreeMap is commonly used when there is a need for a map implementation that <strong>maintains its keys in sorted order<\/strong>. Below is an example of a binary tree.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"456\" src=\"https:\/\/thoaicoder.com\/wp-content\/uploads\/2023\/06\/image-2-1024x456.png\" alt=\"\" class=\"wp-image-361\" srcset=\"https:\/\/thoaicoder.com\/wp-content\/uploads\/2023\/06\/image-2-1024x456.png 1024w, https:\/\/thoaicoder.com\/wp-content\/uploads\/2023\/06\/image-2-300x134.png 300w, https:\/\/thoaicoder.com\/wp-content\/uploads\/2023\/06\/image-2-768x342.png 768w, https:\/\/thoaicoder.com\/wp-content\/uploads\/2023\/06\/image-2-1536x684.png 1536w, https:\/\/thoaicoder.com\/wp-content\/uploads\/2023\/06\/image-2.png 1600w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">In the best and average cases binary search tree guarantees <strong>O(log n)<\/strong> time to insert, search and delete elements, and in the worst case Binary search tree takes <strong>O(n)<\/strong> time for insertion, search, and deletion operations.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">2. TreeMap in Java<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">The TreeMap in Java is a member of the\u00a0<strong><a href=\"https:\/\/docs.oracle.com\/javase\/8\/docs\/technotes\/guides\/collections\/overview.html\">Java Collections\u00a0Framework<\/a><\/strong> which implements\u00a0<strong>Map interface<\/strong>\u00a0and\u00a0<strong>NavigableMap\u00a0<\/strong>along with the <strong>AbstractMap <\/strong>Class. The map is sorted according to the natural ordering of its keys, or by a\u00a0<strong>Comparator\u00a0<\/strong>provided at map creation time, depending on which constructor is used. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">TreeMap in Java does not allow null keys (like Map) and thus a&nbsp;<strong>NullPointerException&nbsp;<\/strong>is thrown. However, multiple null values can be associated with different keys.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">3. A use case of TreeMap<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">In 2022, I worked on a fintech platform using TreeMap to store the daily price of stocks (or securities) returned by the Australian Securities Exchange\u00a0System via a SOAP method, this price data will be used to calculate the value of security transactions. We also use Redis to cache this TreeMap since it is used very frequently, additionally, the cost to build this TreeMap is quite high because a stock may contain a thousand daily pricing records (I will not demo Redis in this article cause we focus on only TreeMap : ) ).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A stock may have no price data on some days, in this case, we will use the price data of the nearest day. Let&#8217;s dig into an example with the daily pricing of stock <strong>&#8220;NT2&#8221;<\/strong> from<strong> 01-Jan-2023<\/strong> to <strong>15-Jan-2023<\/strong> as below.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><strong>Date<\/strong><\/td><td><strong>Price<\/strong><\/td><\/tr><tr><td>01\/01\/2023<\/td><td>100.5<\/td><\/tr><tr><td>02\/01\/2023<\/td><td>100.6<\/td><\/tr><tr><td>03\/01\/2023<\/td><td>100.7<\/td><\/tr><tr><td>07\/01\/2023<\/td><td>99<\/td><\/tr><tr><td>09\/01\/2023<\/td><td>102<\/td><\/tr><tr><td>15\/01\/2023<\/td><td>87.4<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Within this example, if we bought 50 units of this stock on 07\/01\/2023, the value of this transaction is 99*50=4,950$. However, if we bought 30 units on 11\/01\/2023, there is no price data on 11\/01\/2023 so the price data on 09\/01\/2023 is selected (the nearest day of 11\/01\/2023). Hence, the value of this transaction is 102*30=3,060$.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The below <strong>DailyPricingService <\/strong>simulates how we utilize TreeMap to handle this use case with Java 11.<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-tangaroa-background-color has-text-color has-background\" style=\"padding-top:var(--wp--preset--spacing--30);padding-right:var(--wp--preset--spacing--30);padding-bottom:var(--wp--preset--spacing--30);padding-left:var(--wp--preset--spacing--30)\"><code>import java.math.BigDecimal;\r\nimport java.util.Date;\r\nimport java.util.HashMap;\r\nimport java.util.Map;\r\nimport java.util.Map.Entry;\r\nimport java.util.TreeMap;\r\n\r\npublic class DailyPricingService {\r\n  private static final Map&lt;String, TreeMap&lt;Date, BigDecimal>> MAP_SECURITY_DAILY_PRICING = new HashMap&lt;>();\r\n\r\n  public void add(String securityCode, Date date, BigDecimal price) {\r\n    TreeMap&lt;Date, BigDecimal> treeMapDailyPricing = MAP_SECURITY_DAILY_PRICING.get(securityCode);\r\n    if (treeMapDailyPricing == null) {\r\n      treeMapDailyPricing = new TreeMap&lt;>();\r\n      MAP_SECURITY_DAILY_PRICING.put(securityCode, treeMapDailyPricing);\r\n    }\r\n    treeMapDailyPricing.put(date, price);\r\n  }\r\n\r\n  public BigDecimal getPrice(String securityCode, Date date) {\r\n    TreeMap&lt;Date, BigDecimal> treeMapDailyPricing = MAP_SECURITY_DAILY_PRICING.get(securityCode);\r\n    if (treeMapDailyPricing == null) {\r\n      throw new IllegalArgumentException(String.format(\"No pricing data for security code %s\", securityCode));\r\n    }\r\n\r\n    Entry&lt;Date, BigDecimal> entry = treeMapDailyPricing.floorEntry(date);\r\n    if (entry == null) {\r\n      throw new IllegalArgumentException(String.format(\"No pricing data found for security code %s and date %s\", securityCode, date));\r\n    }\r\n    return entry.getValue();\r\n  }\r\n}\r\n<a href=\"https:\/\/www.geeksforgeeks.org\/treemap-in-java\/\" target=\"_blank\" rel=\"noreferrer noopener\"><\/a><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Cause we need to maintain the daily pricing of multiple stocks so we use a <strong>Map&lt;String, TreeMap&lt;Date, BigDecimal>><\/strong> with the <strong>key <\/strong>is stock code (or security code) and the <strong>value <\/strong>is its daily pricing data.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The <strong>add <\/strong>method is used to store price data on a day of a specific stock and the <strong>getPrice <\/strong>method is used to retrieve price data of a stock on a specific day.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We can easily write a unit test to test this service based on the original example.<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-tangaroa-background-color has-text-color has-background\" style=\"padding-top:var(--wp--preset--spacing--30);padding-right:var(--wp--preset--spacing--30);padding-bottom:var(--wp--preset--spacing--30);padding-left:var(--wp--preset--spacing--30)\"><code>import java.math.BigDecimal;\r\nimport java.text.DateFormat;\r\nimport java.text.ParseException;\r\nimport java.text.SimpleDateFormat;\r\nimport org.junit.jupiter.api.Assertions;\r\nimport org.junit.jupiter.api.Test;\r\n\r\npublic class DailyPricingServiceTest {\r\n  @Test\r\n  public void get_price_success() throws ParseException {\r\n    DailyPricingService dailyPricingService = new DailyPricingService();\r\n    DateFormat dateFormat = new SimpleDateFormat(\"dd\/MM\/yyyy\");\r\n    dailyPricingService.add(\"NT2\", dateFormat.parse(\"01\/01\/2023\"), BigDecimal.valueOf(100.5));\r\n    dailyPricingService.add(\"NT2\", dateFormat.parse(\"02\/01\/2023\"), BigDecimal.valueOf(100.6));\r\n    dailyPricingService.add(\"NT2\", dateFormat.parse(\"03\/01\/2023\"), BigDecimal.valueOf(100.7));\r\n    dailyPricingService.add(\"NT2\", dateFormat.parse(\"07\/01\/2023\"), BigDecimal.valueOf(99));\r\n    dailyPricingService.add(\"NT2\", dateFormat.parse(\"09\/01\/2023\"), BigDecimal.valueOf(102));\r\n    dailyPricingService.add(\"NT2\", dateFormat.parse(\"15\/01\/2023\"), BigDecimal.valueOf(87.4));\r\n\r\n    Assertions.assertEquals(dailyPricingService.getPrice(\"NT2\", dateFormat.parse(\"11\/01\/2023\")), BigDecimal.valueOf(102),\r\n      \"No price data on 11\/01\/2023, so the date on 09\/01\/2023 must be selected\");\r\n    Assertions.assertEquals(dailyPricingService.getPrice(\"NT2\", dateFormat.parse(\"07\/01\/2023\")), BigDecimal.valueOf(99),\r\n      \"The price data on 07\/01\/2023 must be 99\");\r\n  }\r\n}\r\n<a href=\"https:\/\/www.geeksforgeeks.org\/treemap-in-java\/\" target=\"_blank\" rel=\"noreferrer noopener\"><\/a><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The example code can be found on\u00a0<a href=\"https:\/\/github.com\/ThoaiNguyenHuu842\/a-use-case-of-treemap\">GitHub<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. What is TreeMap TreeMap is a data structure that provides an ordered collection of [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":352,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,15],"tags":[51,28,35],"class_list":["post-347","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java","category-software-development-practices","tag-fintech","tag-java","tag-treemap"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v19.14 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>A use case of TreeMap in a fintech platform - I \u2764 Code<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/thoaicoder.com\/index.php\/2023\/06\/01\/a-use-case-of-treemap-in-a-fintech-platform\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"A use case of TreeMap in a fintech platform - I \u2764 Code\" \/>\n<meta property=\"og:description\" content=\"1. What is TreeMap TreeMap is a data structure that provides an ordered collection of [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/thoaicoder.com\/index.php\/2023\/06\/01\/a-use-case-of-treemap-in-a-fintech-platform\/\" \/>\n<meta property=\"og:site_name\" content=\"I \u2764 Code\" \/>\n<meta property=\"article:published_time\" content=\"2023-06-01T03:37:19+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-10T08:03:42+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/thoaicoder.com\/wp-content\/uploads\/2023\/06\/800.jpeg\" \/>\n\t<meta property=\"og:image:width\" content=\"800\" \/>\n\t<meta property=\"og:image:height\" content=\"487\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Thoai\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Thoai\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/thoaicoder.com\/index.php\/2023\/06\/01\/a-use-case-of-treemap-in-a-fintech-platform\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/thoaicoder.com\/index.php\/2023\/06\/01\/a-use-case-of-treemap-in-a-fintech-platform\/\"},\"author\":{\"name\":\"Thoai\",\"@id\":\"https:\/\/thoaicoder.com\/#\/schema\/person\/a3304c209434f63c501b05622d7d2720\"},\"headline\":\"A use case of TreeMap in a fintech platform\",\"datePublished\":\"2023-06-01T03:37:19+00:00\",\"dateModified\":\"2024-01-10T08:03:42+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/thoaicoder.com\/index.php\/2023\/06\/01\/a-use-case-of-treemap-in-a-fintech-platform\/\"},\"wordCount\":504,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/thoaicoder.com\/#\/schema\/person\/a3304c209434f63c501b05622d7d2720\"},\"keywords\":[\"Fintech\",\"Java\",\"Treemap\"],\"articleSection\":[\"Java\",\"Software Development Practices\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/thoaicoder.com\/index.php\/2023\/06\/01\/a-use-case-of-treemap-in-a-fintech-platform\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/thoaicoder.com\/index.php\/2023\/06\/01\/a-use-case-of-treemap-in-a-fintech-platform\/\",\"url\":\"https:\/\/thoaicoder.com\/index.php\/2023\/06\/01\/a-use-case-of-treemap-in-a-fintech-platform\/\",\"name\":\"A use case of TreeMap in a fintech platform - I \u2764 Code\",\"isPartOf\":{\"@id\":\"https:\/\/thoaicoder.com\/#website\"},\"datePublished\":\"2023-06-01T03:37:19+00:00\",\"dateModified\":\"2024-01-10T08:03:42+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/thoaicoder.com\/index.php\/2023\/06\/01\/a-use-case-of-treemap-in-a-fintech-platform\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/thoaicoder.com\/index.php\/2023\/06\/01\/a-use-case-of-treemap-in-a-fintech-platform\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/thoaicoder.com\/index.php\/2023\/06\/01\/a-use-case-of-treemap-in-a-fintech-platform\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/thoaicoder.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"A use case of TreeMap in a fintech platform\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/thoaicoder.com\/#website\",\"url\":\"https:\/\/thoaicoder.com\/\",\"name\":\"I \u2764 Code\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/thoaicoder.com\/#\/schema\/person\/a3304c209434f63c501b05622d7d2720\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/thoaicoder.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/thoaicoder.com\/#\/schema\/person\/a3304c209434f63c501b05622d7d2720\",\"name\":\"Thoai\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/thoaicoder.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/thoaicoder.com\/wp-content\/uploads\/2023\/03\/photo_2023-01-05_22-53-32.jpg\",\"contentUrl\":\"https:\/\/thoaicoder.com\/wp-content\/uploads\/2023\/03\/photo_2023-01-05_22-53-32.jpg\",\"width\":640,\"height\":640,\"caption\":\"Thoai\"},\"logo\":{\"@id\":\"https:\/\/thoaicoder.com\/#\/schema\/person\/image\/\"},\"sameAs\":[\"https:\/\/thoaicoder.com\",\"https:\/\/www.linkedin.com\/in\/huu-thoai-nguyen\/\"],\"url\":\"https:\/\/thoaicoder.com\/index.php\/author\/admin_cvyxq4b8\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"A use case of TreeMap in a fintech platform - I \u2764 Code","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/thoaicoder.com\/index.php\/2023\/06\/01\/a-use-case-of-treemap-in-a-fintech-platform\/","og_locale":"en_US","og_type":"article","og_title":"A use case of TreeMap in a fintech platform - I \u2764 Code","og_description":"1. What is TreeMap TreeMap is a data structure that provides an ordered collection of [&hellip;]","og_url":"https:\/\/thoaicoder.com\/index.php\/2023\/06\/01\/a-use-case-of-treemap-in-a-fintech-platform\/","og_site_name":"I \u2764 Code","article_published_time":"2023-06-01T03:37:19+00:00","article_modified_time":"2024-01-10T08:03:42+00:00","og_image":[{"width":800,"height":487,"url":"https:\/\/thoaicoder.com\/wp-content\/uploads\/2023\/06\/800.jpeg","type":"image\/jpeg"}],"author":"Thoai","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Thoai","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/thoaicoder.com\/index.php\/2023\/06\/01\/a-use-case-of-treemap-in-a-fintech-platform\/#article","isPartOf":{"@id":"https:\/\/thoaicoder.com\/index.php\/2023\/06\/01\/a-use-case-of-treemap-in-a-fintech-platform\/"},"author":{"name":"Thoai","@id":"https:\/\/thoaicoder.com\/#\/schema\/person\/a3304c209434f63c501b05622d7d2720"},"headline":"A use case of TreeMap in a fintech platform","datePublished":"2023-06-01T03:37:19+00:00","dateModified":"2024-01-10T08:03:42+00:00","mainEntityOfPage":{"@id":"https:\/\/thoaicoder.com\/index.php\/2023\/06\/01\/a-use-case-of-treemap-in-a-fintech-platform\/"},"wordCount":504,"commentCount":0,"publisher":{"@id":"https:\/\/thoaicoder.com\/#\/schema\/person\/a3304c209434f63c501b05622d7d2720"},"keywords":["Fintech","Java","Treemap"],"articleSection":["Java","Software Development Practices"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/thoaicoder.com\/index.php\/2023\/06\/01\/a-use-case-of-treemap-in-a-fintech-platform\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/thoaicoder.com\/index.php\/2023\/06\/01\/a-use-case-of-treemap-in-a-fintech-platform\/","url":"https:\/\/thoaicoder.com\/index.php\/2023\/06\/01\/a-use-case-of-treemap-in-a-fintech-platform\/","name":"A use case of TreeMap in a fintech platform - I \u2764 Code","isPartOf":{"@id":"https:\/\/thoaicoder.com\/#website"},"datePublished":"2023-06-01T03:37:19+00:00","dateModified":"2024-01-10T08:03:42+00:00","breadcrumb":{"@id":"https:\/\/thoaicoder.com\/index.php\/2023\/06\/01\/a-use-case-of-treemap-in-a-fintech-platform\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/thoaicoder.com\/index.php\/2023\/06\/01\/a-use-case-of-treemap-in-a-fintech-platform\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/thoaicoder.com\/index.php\/2023\/06\/01\/a-use-case-of-treemap-in-a-fintech-platform\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/thoaicoder.com\/"},{"@type":"ListItem","position":2,"name":"A use case of TreeMap in a fintech platform"}]},{"@type":"WebSite","@id":"https:\/\/thoaicoder.com\/#website","url":"https:\/\/thoaicoder.com\/","name":"I \u2764 Code","description":"","publisher":{"@id":"https:\/\/thoaicoder.com\/#\/schema\/person\/a3304c209434f63c501b05622d7d2720"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/thoaicoder.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/thoaicoder.com\/#\/schema\/person\/a3304c209434f63c501b05622d7d2720","name":"Thoai","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/thoaicoder.com\/#\/schema\/person\/image\/","url":"https:\/\/thoaicoder.com\/wp-content\/uploads\/2023\/03\/photo_2023-01-05_22-53-32.jpg","contentUrl":"https:\/\/thoaicoder.com\/wp-content\/uploads\/2023\/03\/photo_2023-01-05_22-53-32.jpg","width":640,"height":640,"caption":"Thoai"},"logo":{"@id":"https:\/\/thoaicoder.com\/#\/schema\/person\/image\/"},"sameAs":["https:\/\/thoaicoder.com","https:\/\/www.linkedin.com\/in\/huu-thoai-nguyen\/"],"url":"https:\/\/thoaicoder.com\/index.php\/author\/admin_cvyxq4b8\/"}]}},"_links":{"self":[{"href":"https:\/\/thoaicoder.com\/index.php\/wp-json\/wp\/v2\/posts\/347","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thoaicoder.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thoaicoder.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thoaicoder.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thoaicoder.com\/index.php\/wp-json\/wp\/v2\/comments?post=347"}],"version-history":[{"count":6,"href":"https:\/\/thoaicoder.com\/index.php\/wp-json\/wp\/v2\/posts\/347\/revisions"}],"predecessor-version":[{"id":368,"href":"https:\/\/thoaicoder.com\/index.php\/wp-json\/wp\/v2\/posts\/347\/revisions\/368"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/thoaicoder.com\/index.php\/wp-json\/wp\/v2\/media\/352"}],"wp:attachment":[{"href":"https:\/\/thoaicoder.com\/index.php\/wp-json\/wp\/v2\/media?parent=347"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thoaicoder.com\/index.php\/wp-json\/wp\/v2\/categories?post=347"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thoaicoder.com\/index.php\/wp-json\/wp\/v2\/tags?post=347"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}