{"id":1820,"date":"2026-10-11T09:00:00","date_gmt":"2026-10-11T03:30:00","guid":{"rendered":"https:\/\/swapnilzambare.com\/blog\/apex-methods-interview-questions-string-date\/"},"modified":"2026-11-22T00:40:01","modified_gmt":"2026-11-21T19:10:01","slug":"apex-methods-interview-questions-string-date","status":"publish","type":"post","link":"https:\/\/swapnilzambare.com\/blog\/apex-methods-interview-questions-string-date\/","title":{"rendered":"Apex Methods Interview Questions: String, Date, Math and Schema (60+ Q&amp;A)"},"content":{"rendered":"\r\n<p class=\"wp-block-paragraph\">Apex Methods Interview Questions check whether you know the built-in methods that save you from writing code by hand, such as String, Date, Math, Schema and Limits. Interviewers often ask small &#8220;how would you&#8221; questions, like getting the first day of the month or reading a field by name. Knowing the right method shows real hands-on experience.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Last reviewed for the Winter &#8217;27 release (November 2026).<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">This is Part 5 of our Salesforce developer interview series. It covers the built-in method questions asked most, with short answers and examples. It builds on <a href=\"https:\/\/swapnilzambare.com\/blog\/apex-built-in-methods-string-date-math\/\">Apex String, Date and Math methods<\/a>, <a href=\"https:\/\/swapnilzambare.com\/blog\/apex-sobjects-generic-vs-specific\/\">generic vs specific sObjects<\/a> and <a href=\"https:\/\/swapnilzambare.com\/blog\/apex-basics-interview-questions\/\">Apex Basics Interview Questions<\/a>.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">What are Apex Methods Interview Questions?<\/h2>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Apex Methods Interview Questions focus on the system classes and instance methods that come with Apex. They cover text handling, dates and times, number rounding, dynamic describe calls and limit checks. So they test how efficiently you solve everyday problems.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Think of a well-stocked toolbox. A beginner tries to tighten every bolt with pliers, while an expert reaches for the exact spanner. Built-in methods are those spanners, ready-made and tested.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">Why Apex Methods Interview Questions Matter<\/h2>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Using the right method makes code shorter and safer. Here is why Apex Methods Interview Questions matter.<\/p>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li>First, String and Date methods appear in most business logic.<\/li>\r\n\r\n<li>Also, Decimal rounding mistakes break invoices.<\/li>\r\n\r\n<li>Next, Schema describe calls power dynamic, reusable code.<\/li>\r\n\r\n<li>Limits methods help you debug governor limit errors.<\/li>\r\n\r\n<li>Finally, small method questions are quick ways to test real experience.<\/li>\r\n<\/ul>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">So knowing these methods helps in both coding rounds and real work.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">How to Prepare for Apex Methods Interview Questions<\/h2>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Preparing for Apex Methods Interview Questions follows five steps. First, learn the ten most used String methods. Next, practise Date and Datetime maths, such as adding months and finding gaps. Then round Decimals with setScale and a rounding mode. After that, use Schema describe calls to list fields of Course__c. Finally, check limits with the Limits class while running a query.<\/p>\r\n\r\n\r\n<figure class=\"wp-block-image aligncenter size-large\"><a href=\"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-methods-interview-questions-string-date-diagram-1.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"640\" src=\"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-methods-interview-questions-string-date-diagram-1-1024x640.png\" alt=\"Apex Methods Interview Questions diagram showing five steps to prepare for built-in method questions\" class=\"wp-image-1818\" srcset=\"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-methods-interview-questions-string-date-diagram-1-1024x640.png 1024w, https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-methods-interview-questions-string-date-diagram-1-300x188.png 300w, https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-methods-interview-questions-string-date-diagram-1-768x480.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Five steps to prepare for built-in method questions.<\/figcaption><\/figure>\r\n\r\n\r\n<h2 class=\"wp-block-heading\">Most Used Built-in Methods at a Glance<\/h2>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">The table below lists the methods interviewers ask about most.<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-table\"><table><thead><tr><th>Class<\/th><th>Method<\/th><th>What it does<\/th><\/tr><\/thead><tbody><tr><td>String<\/td><td>isBlank(s)<\/td><td>True for null, empty or spaces<\/td><\/tr><tr><td>String<\/td><td>split(regex)<\/td><td>Breaks text into a list<\/td><\/tr><tr><td>Date<\/td><td>addMonths(n)<\/td><td>Moves the date by months<\/td><\/tr><tr><td>Date<\/td><td>daysBetween(d)<\/td><td>Days between two dates<\/td><\/tr><tr><td>Decimal<\/td><td>setScale(n, mode)<\/td><td>Rounds to n decimal places<\/td><\/tr><tr><td>Schema<\/td><td>getGlobalDescribe()<\/td><td>Map of all object types<\/td><\/tr><tr><td>Limits<\/td><td>getQueries()<\/td><td>SOQL queries used so far<\/td><\/tr><\/tbody><\/table><\/figure>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">Date vs Datetime<\/h2>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">The table below compares two types that cause many interview mix-ups.<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-table\"><table><thead><tr><th>Feature<\/th><th>Date<\/th><th>Datetime<\/th><\/tr><\/thead><tbody><tr><td>Holds<\/td><td>Day only<\/td><td>Day and time<\/td><\/tr><tr><td>Time zone<\/td><td>None<\/td><td>Stored in GMT<\/td><\/tr><tr><td>Current value<\/td><td>Date.today()<\/td><td>Datetime.now()<\/td><\/tr><tr><td>Formatting<\/td><td>format()<\/td><td>format(&#8216;pattern&#8217;) in user time zone<\/td><\/tr><tr><td>Best for<\/td><td>Birthdays, start dates<\/td><td>Events, timestamps<\/td><\/tr><\/tbody><\/table><\/figure>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">When to use which is simple. Use Date when time does not matter, and Datetime when the exact moment matters.<\/p>\r\n\r\n\r\n<figure class=\"wp-block-image aligncenter size-large\"><a href=\"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-methods-interview-questions-string-date-diagram-2.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"640\" src=\"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-methods-interview-questions-string-date-diagram-2-1024x640.png\" alt=\"Apex Methods Interview Questions diagram comparing Date and Datetime\" class=\"wp-image-1819\" srcset=\"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-methods-interview-questions-string-date-diagram-2-1024x640.png 1024w, https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-methods-interview-questions-string-date-diagram-2-300x188.png 300w, https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-methods-interview-questions-string-date-diagram-2-768x480.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption class=\"wp-element-caption\">Date vs Datetime.<\/figcaption><\/figure>\r\n\r\n\r\n<h2 class=\"wp-block-heading\">Basic Apex Methods Interview Questions<\/h2>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">These Apex Methods Interview Questions cover String methods first.<\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\">Questions on String Methods<\/h3>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q1: How do you check if a String is empty or only spaces?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use String.isBlank(s), which returns true for null, &#8221; and spaces. However, isEmpty() returns false for spaces.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Interview tip: explain the difference from isEmpty() with an example of a String of spaces.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q2: How do you get the length of a String?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Call s.length(). &#8216;Apex&#8217;.length() returns 4.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Calling it on a null String throws a NullPointerException, so check with String.isBlank(s) first when the value may be empty. A common use is checking that a PAN or phone number has the right number of characters.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q3: How do you get part of a String?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use substring(start, end), where start is included and end is not. For example, &#8216;Salesforce&#8217;.substring(0, 5) returns &#8216;Sales&#8217;.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Follow-up you may get: What if the end index is past the length? It throws a StringException, so check length() first.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q4: Is contains() case-sensitive?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Yes. &#8216;Salesforce&#8217;.contains(&#8216;force&#8217;) is true, but contains(&#8216;Force&#8217;) is false.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use containsIgnoreCase() when case should not matter, for example when searching names a user typed.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q5: How do you compare two Strings ignoring case?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use equalsIgnoreCase(), or == which also ignores case. However, equals() is case-sensitive.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Interview tip: mention that == on Strings ignores case in Apex, unlike Java. Interviewers like that detail.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q6: How do you split a comma-separated String?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use s.split(&#8216;,&#8217;), which returns a List&lt;String&gt;. Also, split takes a regular expression.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Follow-up you may get: How do you split on a dot? Escape it, split(&#8216;\\\\.&#8217;), because split uses a regular expression.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q7: How do you remove spaces at both ends?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use trim(). &#8216; Apex &#8216;.trim() returns &#8216;Apex&#8217;.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">trim() removes spaces at both ends only. To remove spaces everywhere, use deleteWhitespace(), and to squash repeated inner spaces, use normalizeSpace(). The common String methods are worth learning together:<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Method<\/th><th>What it does<\/th><th>Example result<\/th><\/tr><\/thead><tbody><tr><td>trim()<\/td><td>Removes spaces at both ends<\/td><td>&#8216; Apex &#8216; gives &#8216;Apex&#8217;<\/td><\/tr><tr><td>toUpperCase()<\/td><td>All capitals<\/td><td>&#8216;apex&#8217; gives &#8216;APEX&#8217;<\/td><\/tr><tr><td>contains(text)<\/td><td>True if text is inside, case sensitive<\/td><td>&#8216;Salesforce&#8217;.contains(&#8216;force&#8217;) is true<\/td><\/tr><tr><td>substring(a, b)<\/td><td>Part of the String<\/td><td>&#8216;Salesforce&#8217;.substring(0, 5) gives &#8216;Sales&#8217;<\/td><\/tr><tr><td>split(&#8216;,&#8217;)<\/td><td>List of parts<\/td><td>&#8216;a,b&#8217;.split(&#8216;,&#8217;) gives a list of 2<\/td><\/tr><tr><td>isBlank(s)<\/td><td>True for null, empty or spaces<\/td><td>String.isBlank(&#8216; &#8216;) is true<\/td><\/tr><\/tbody><\/table><\/figure>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q8: How do you change case?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use toUpperCase() and toLowerCase(). capitalize() makes only the first letter upper case.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Example: &#8216;pune&#8217;.capitalize() returns &#8216;Pune&#8217;. Lower casing both sides is also a common way to compare emails or codes that users type in different ways.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q9: What is the difference between replace and replaceAll?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">replace swaps plain text, while replaceAll uses a regular expression. So replaceAll can match patterns like digits.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Interview tip: give a pattern example, like replaceAll(&#8216;[^0-9]&#8217;, &#8221;) to keep only digits in a phone number.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q10: How do you join a list into one String?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use String.join(list, &#8216;, &#8216;).<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Example: String.join(new List&lt;String&gt;{&#8216;Apex&#8217;, &#8216;SOQL&#8217;, &#8216;LWC&#8217;}, &#8216;, &#8216;) gives &#8216;Apex, SOQL, LWC&#8217;. It is handy for error messages and email bodies.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q11: How do you insert values into a message template?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use String.format(&#8216;Hello {0}, fee {1}&#8217;, new List&lt;Object&gt;{ name, fee }). So messages stay readable.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q12: How do you check the start or end of a String?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use startsWith() and endsWith(). Both are case sensitive.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Example: check whether an ID belongs to Account with String.valueOf(recId).startsWith(&#8216;001&#8217;), or check a file name with fileName.endsWith(&#8216;.pdf&#8217;).<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q13: How do you protect dynamic SOQL from single quotes?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use String.escapeSingleQuotes(input). <a href=\"https:\/\/swapnilzambare.com\/blog\/dynamic-soql-in-apex-injection\/\">Bind variables are the safer choice<\/a>, though.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">escapeSingleQuotes adds a backslash before each quote, so a value like O&#8217;Brien cannot break out of the query string. Binds avoid the problem completely, because the value is never part of the query text.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q14: How do you reverse a String?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use reverse(). &#8216;Apex&#8217;.reverse() returns &#8216;xepA&#8217;. A common exercise is checking for a palindrome by comparing a lower cased String with its reverse.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q15: How do you find the position of text?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use indexOf(text), which returns -1 when not found.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Example: &#8216;Salesforce&#8217;.indexOf(&#8216;force&#8217;) returns 5, because positions start at 0. Use lastIndexOf() to find the last match.<\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\">Questions on Number Methods<\/h3>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q16: How do you round a Decimal to two places?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use setScale(2), or setScale(2, RoundingMode.HALF_UP) to control rounding. So invoices show clean values.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Follow-up you may get: Does setScale change the original value? No, it returns a new Decimal.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q17: What rounding does setScale use by default?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">It uses half-even rounding when needed. So pass a RoundingMode when the business needs half-up.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Interview tip: say half even is also called banker&#8217;s rounding. It shows you know why money needs HALF_UP.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q18: How do you get the remainder of a division?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use Math.mod(a, b), because <a href=\"https:\/\/swapnilzambare.com\/blog\/apex-operators-expressions\/\">Apex has no % operator<\/a>.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Example: Math.mod(10, 3) returns 1. A common use is checking even numbers: Math.mod(n, 2) == 0.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q19: How do you get absolute, max and min values?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use Math.abs(), Math.max() and Math.min().<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Example: Math.abs(-500) returns 500, and Math.max(fee, 1000) gives a minimum fee of 1000. Both values in max and min should be the same number type.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q20: How do you round up or down?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use Math.ceil() to round up and Math.floor() to round down. Also, Math.round() rounds to the nearest whole number.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q21: How do you generate a random number?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use Math.random(), which returns a Double between 0 and 1. Then multiply and convert for a range.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q22: How do you convert a String to a Decimal safely?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use Decimal.valueOf(text) inside try and catch, because it throws a TypeException for text like &#8217;12a&#8217;. For user input, check it first with a pattern or isNumeric() style checks that allow a decimal point.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q23: How do you convert a Decimal to an Integer?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use intValue(). It drops the decimal part, so 7.9 becomes 7.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">If you need the nearest whole number, round first: Math.round(7.9) gives 8, or use setScale(0, System.RoundingMode.HALF_UP).intValue().<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Interview tip: say clearly that intValue() cuts, it does not round. It is a common trap.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">Intermediate Apex Methods Interview Questions<\/h2>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">These Apex Methods Interview Questions cover dates, times and records.<\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\">Questions on Date and Datetime<\/h3>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q24: How do you get today&#8217;s date?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use Date.today(), or System.today(). Both return the current date in the user&#8217;s time zone.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Follow-up you may get: Is Date.today() in GMT? No, it uses the running user&#8217;s time zone.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q25: How do you add days or months?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use addDays(n) and addMonths(n). Negative numbers move backwards.<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Date method<\/th><th>What it does<\/th><th>Example<\/th><\/tr><\/thead><tbody><tr><td>addDays(n)<\/td><td>Moves by days<\/td><td>today.addDays(7) is a week ahead<\/td><\/tr><tr><td>addMonths(n)<\/td><td>Moves by months<\/td><td>addMonths(-1) is a month back<\/td><\/tr><tr><td>daysBetween(d)<\/td><td>Days from one date to another<\/td><td>start.daysBetween(end)<\/td><\/tr><tr><td>toStartOfMonth()<\/td><td>First day of the month<\/td><td>1 November for any November date<\/td><\/tr><tr><td>toStartOfWeek()<\/td><td>First day of the week, by locale<\/td><td>Sunday or Monday<\/td><\/tr><tr><td>Date.newInstance(y, m, d)<\/td><td>Builds a date<\/td><td>Date.newInstance(2026, 11, 22)<\/td><\/tr><\/tbody><\/table><\/figure>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q26: How do you find days between two dates?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use start.daysBetween(end).<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">It returns a positive number when end is later and a negative one when it is earlier. Example: Date.today().daysBetween(course.Start_Date__c) counts days until a course starts.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q27: How do you get the first day of the month?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use d.toStartOfMonth().<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Example: for 22 November 2026 it returns 1 November 2026. It is handy for monthly reports and for finding the last day of a month with addMonths(1).addDays(-1).<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q28: How do you build a Date from parts?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use Date.newInstance(year, month, day), like Date.newInstance(2026, 9, 18).<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">The order is always year, month, day, whatever the user&#8217;s locale. Months start at 1 for January, unlike JavaScript where January is 0.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q29: How do you convert a String to a Date?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use Date.valueOf(&#8216;2026-09-18&#8217;) for ISO format. Also, Date.parse() reads the user&#8217;s locale format.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Interview tip: pick Date.valueOf for integration data, because it does not depend on the user&#8217;s locale.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q30: How do you get the current date and time?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use Datetime.now(), which <a href=\"https:\/\/swapnilzambare.com\/blog\/apex-built-in-methods-string-date-math\/\">stores the moment in GMT<\/a>. Then format() shows it in the user&#8217;s time zone.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Follow-up you may get: How do you get a Datetime for a set time today? Datetime.newInstance(Date.today(), Time.newInstance(9, 0, 0, 0)).<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q31: How do you format a Datetime as text?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use format(&#8216;yyyy-MM-dd HH:mm&#8217;). formatGmt() formats it in GMT instead of the user&#8217;s time zone.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Example: dt.format(&#8216;dd MMM yyyy, hh:mm a&#8217;) gives &#8217;22 Nov 2026, 10:30 AM&#8217; for a user in India. Capital MM is month and lower case mm is minutes, a common mix up.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q32: How do you get only the date part of a Datetime?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use dt.date() for the user&#8217;s time zone, or dt.dateGmt() for GMT.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">The two can differ near midnight. Example: 2 AM on 23 November in Mumbai is still 8:30 PM on 22 November in GMT, so date() and dateGmt() return different days. Pick the one your logic needs.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q33: How do you check for a leap year?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use Date.isLeapYear(2028), which returns true.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Date.daysInMonth(2026, 2) returns 28, the number of days in February 2026. Both are static methods, so you call them on Date, not on a date value.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q34: How do you get the day of the week for a date?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Convert it to a Datetime and format it: Datetime.newInstance(d, Time.newInstance(0, 0, 0, 0)).format(&#8216;EEEE&#8217;) returns &#8216;Sunday&#8217; for 22 November 2026. Use &#8216;E&#8217; for the short name, like &#8216;Sun&#8217;.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q35: How do you get the day, month and year numbers?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use day(), month() and year() on a Date.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Example: for 22 November 2026, d.day() is 22, d.month() is 11 and d.year() is 2026. They return Integers you can compare or use in calculations.<\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\">Questions on sObject Methods<\/h3>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q36: How do you read a field by its name at runtime?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use record.get(&#8216;Fee__c&#8217;). It returns an Object, so cast it to the right type.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Example: Decimal fee = (Decimal) course.get(&#8216;Fee__c&#8217;); This lets <a href=\"https:\/\/swapnilzambare.com\/blog\/apex-schema-describe-dynamic-apex\/\">one method work with fields chosen at run time<\/a>, such as from custom metadata.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q37: How do you set a field by name?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use record.put(&#8216;Fee__c&#8217;, 5000).<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">The value must match the field type, or you get an error at run time. Together with get(), it lets dynamic code write any field, for example copying fields listed in a custom metadata record.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q38: How do you find an sObject&#8217;s type?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use record.getSObjectType(), which returns a Schema.SObjectType. Also, Id.getSObjectType() works on an Id.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Follow-up you may get: How do you get the object name as text? getSObjectType().getDescribe().getName().<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q39: How do you clone a record without its Id?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use record.clone(false). Inserting the clone then creates a new record.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">The first parameter keeps or drops the ID. Other options let you keep read only fields like CreatedDate or the auto number. Example: Opportunity copy = opp.clone(false, true); copy.Name = opp.Name + &#8216; Renewal&#8217;; insert copy;<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q40: How do you show an error on a record in a trigger?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use record.addError(&#8216;Message&#8217;), or field-level addError on a field. So the save fails with that message.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Interview tip: mention that field level addError shows the message next to that field on the page.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q41: How do you check whether a field changed in an update trigger?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Compare the new and old values: if (c.Fee__c != Trigger.oldMap.get(c.Id).Fee__c). For a dynamic field name, use get(fieldName) on both records.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q42: How do you list fields that are populated on a record?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use getPopulatedFieldsAsMap(). It returns field names and values.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">It only includes fields that were queried or set in code, which makes it useful for generic logging of what changed.<\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\">Questions on Schema Describe<\/h3>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q43: What is Schema.getGlobalDescribe()?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">It returns a map of every object name to its SObjectType. However, it is heavy, so avoid calling it often.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Follow-up you may get: What is faster for one object? Schema.SObjectType.Account, or Schema.describeSObjects with just the names you need.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q44: How do you get all fields of an object?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use Schema.SObjectType.Course__c.fields.getMap(). It maps each field name to its token.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Example: for (String f : Schema.SObjectType.Course__c.fields.getMap().keySet()) lists every field API name in lower case. Field names in this map are always lower case.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q45: How do you read picklist values in Apex?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use the field&#8217;s describe: Course__c.Level__c.getDescribe().getPicklistValues().<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">It returns a list of PicklistEntry objects. Read getValue() for the API value and getLabel() for the label users see, and check isActive() to skip inactive values.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q46: How do you get a record type Id by name?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use Schema.SObjectType.Course__c.getRecordTypeInfosByDeveloperName().get(&#8216;Online&#8217;).getRecordTypeId(). So you avoid hard-coded Ids.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Interview tip: stress &#8220;no hard coded IDs&#8221;. It is the real reason for this pattern.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q47: How do you check if a user can read a field?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use the field describe isAccessible(), or better, run queries <a href=\"https:\/\/swapnilzambare.com\/blog\/apex-crud-and-fls-user-mode\/\">WITH USER_MODE<\/a>. User mode checks access automatically.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Follow-up you may get: Which is better for many fields, isAccessible checks or user mode? User mode, because it checks every field in one go.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q48: How do you check whether a user can create records of an object?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use Schema.SObjectType.Course__c.isCreateable(), or simply run the DML in user mode, like Database.insert(records, AccessLevel.USER_MODE), which checks it for you.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q49: What is a field token?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">It is a reference to a field, such as Course__c.Fee__c. So code can describe the field without strings.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">Advanced Apex Methods Interview Questions<\/h2>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">These Apex Methods Interview Questions cover system, user and limit methods.<\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\">Questions on System and UserInfo<\/h3>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q50: How do you get the current user&#8217;s Id?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use UserInfo.getUserId(). UserInfo.getProfileId() returns the profile ID.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">UserInfo also gives getName(), getUserEmail() and getOrganizationId(), all without a query.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q51: How do you get the user&#8217;s time zone?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use UserInfo.getTimeZone(). It returns a TimeZone object.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Example: UserInfo.getTimeZone().getID() returns &#8216;Asia\/Kolkata&#8217; for a user in India. Datetime.format() already uses this time zone, so you rarely need it directly.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q52: How do you check if code runs in a batch or future context?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use <a href=\"https:\/\/swapnilzambare.com\/blog\/async-apex-types-which-to-use\/\">System.isBatch()<\/a>, System.isFuture() or System.isQueueable(). So you can avoid starting async jobs from the wrong place.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Interview tip: give the reason: you cannot start a batch from a batch&#8217;s execute or call a future from a future.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q53: How do you get the org&#8217;s domain URL?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use URL.getOrgDomainUrl(). It returns the org&#8217;s My Domain URL.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use it to build links in emails or messages, like URL.getOrgDomainUrl().toExternalForm() + &#8216;\/&#8217; + recordId, so links work in every sandbox without hard coding.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q54: How do you URL-encode a value?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use EncodingUtil.urlEncode(value, &#8216;UTF-8&#8217;).<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">It turns spaces and special characters into a safe form for URLs, so a city like &#8216;New Delhi&#8217; becomes &#8216;New+Delhi&#8217;. Do it for query parameters before a callout.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q55: How do you check the user&#8217;s locale or language?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use UserInfo.getLocale(), like &#8216;en_IN&#8217;, and UserInfo.getLanguage(), like &#8216;en_US&#8217;. They help format numbers and pick the right label in messages.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q56: How do you base64-encode a Blob?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use <a href=\"https:\/\/swapnilzambare.com\/blog\/apex-crypto-encoding\/\">EncodingUtil.base64Encode<\/a>(blobValue). It is common for files and basic authentication headers.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Follow-up you may get: How do you decode it? EncodingUtil.base64Decode(text) returns a Blob.<\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\">Questions on Limits and Debugging<\/h3>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q57: How do you check how many queries you have used?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use <a href=\"https:\/\/swapnilzambare.com\/blog\/apex-governor-limits-explained\/\">Limits.getQueries()<\/a> for queries used, and Limits.getLimitQueries() for the maximum.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Example: System.debug(&#8216;SOQL &#8216; + Limits.getQueries() + &#8216; of &#8216; + Limits.getLimitQueries()); in long code helps find where the queries go.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q58: How do you check CPU time used?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use Limits.getCpuTime(), and compare it with Limits.getLimitCpuTime().<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Both are in milliseconds. The limit is 10,000 in synchronous code and 60,000 in asynchronous code.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q59: How do you check heap size?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use Limits.getHeapSize(), and compare it with Limits.getLimitHeapSize().<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Heap is the memory your variables use. It helps when large collections cause &#8220;Apex heap size too large&#8221; errors.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q60: How do you match text with a regular expression?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use Pattern.compile(regex).matcher(text).matches().<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">matches() checks the whole String. Example: Pattern.compile(&#8216;[A-Z]{4}-[0-9]{3}&#8217;).matcher(code).matches() checks a course code like APEX-101.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q61: How do you measure how long a block of code takes?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Read Limits.getCpuTime() before and after the block and subtract. For wall clock time, compare System.now().getTime() values, which are in milliseconds.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q62: How do you serialise a record to JSON?<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use <a href=\"https:\/\/swapnilzambare.com\/blog\/json-in-apex-serialize-deserialize\/\">JSON.serialize(record)<\/a>. Then JSON.deserialize turns it back into Apex.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">JSON.serializePretty() gives readable output for debugging, and JSON.serialize(record, true) skips null fields.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">Scenario-Based Apex Methods Interview Questions<\/h2>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">These Apex Methods Interview Questions are common in short coding tasks.<\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\">Questions on Practical Tasks<\/h3>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q63: Get the number of days until a course starts.<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use Date.today().daysBetween(course.Start_Date__c). A negative value means it already started.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Interview tip: mention what a negative result means. It shows you test edge cases.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q64: Build a course code from the name, such as APEX-BASICS.<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use name.toUpperCase().replaceAll(&#8216;\\\\s+&#8217;, &#8216;-&#8216;). Spaces become hyphens.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">\\\\s+ means one or more spaces in a regular expression, so &#8216;Apex  Basics&#8217; with two spaces still gives APEX-BASICS. Add trim() first to drop spaces at the ends.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q65: Show a fee with two decimals, rounding half up.<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use fee.setScale(2, System.RoundingMode.HALF_UP).<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">HALF_UP rounds 1499.565 to 1499.57, which matches how most people expect money to round. Then format it for display, for example with format().<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q66: Read any field from any object in a utility method.<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/swapnilzambare.com\/blog\/apex-sobjects-generic-vs-specific\/\">Accept an sObject<\/a> and a field name, then call record.get(fieldName). So one method serves every object.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q67: Get the record type Id for Online courses without a query.<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use getRecordTypeInfosByDeveloperName() on the Course__c describe.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Example: Id onlineId = Schema.SObjectType.Course__c.getRecordTypeInfosByDeveloperName().get(&#8216;Online&#8217;).getRecordTypeId(); It needs no SOQL and works the same in every org.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q68: Find the last day of the current month.<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use Date.today().toStartOfMonth().addMonths(1).addDays(-1).<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Move to the first day of the month, jump to the first day of next month, and go back one day. Date.daysInMonth(year, month) gives the same answer as a number.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q69: Convert &#8217;10, 20, 30&#8242; into a List&lt;Integer&gt;.<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Split by commas, trim each part and use Integer.valueOf(). Then add each value to the list.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q70: Mask all but the last four digits of a phone number.<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Use String.leftPad: String masked = phone.right(4).leftPad(phone.length(), &#8216;*&#8217;); so 9876543210 becomes ******3210.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Q71: Make sure a course name is not blank before saving.<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Check String.isBlank(c.Name) in a <a href=\"https:\/\/swapnilzambare.com\/blog\/before-vs-after-triggers-apex\/\">before trigger<\/a>, then call c.addError(&#8216;Name is required&#8217;).<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">A Real Apex Methods Interview Questions Answer<\/h2>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Interviewers often combine several methods in one task. Here is &#8220;Print a friendly course summary&#8221;.<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-code\"><code>Course__c c = new Course__c(Name = 'apex basics', Fee__c = 4999.455,\r\n                            Start_Date__c = Date.newInstance(2026, 10, 6));\r\nString name = c.Name.capitalize();\r\nDecimal fee = c.Fee__c.setScale(2, RoundingMode.HALF_UP);\r\nInteger days = Date.newInstance(2026, 9, 18).daysBetween(c.Start_Date__c);\r\n\r\nSystem.debug(String.format('{0} starts in {1} days, fee {2}',\r\n    new List&lt;Object&gt;{ name, days, fee }));<\/code><\/pre>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Explain each method: capitalize fixes the first letter, setScale rounds the fee, daysBetween counts days, and String.format builds the message.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Here is the output.<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-code\"><code>Apex basics starts in 18 days, fee 4999.46<\/code><\/pre>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">Common Mistakes with Apex Methods Interview Questions<\/h2>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li>Using isEmpty() when spaces should count as empty.<\/li>\r\n\r\n<li>Forgetting that contains() is case-sensitive.<\/li>\r\n\r\n<li>Rounding money without a rounding mode.<\/li>\r\n\r\n<li>Calling Schema.getGlobalDescribe() inside loops.<\/li>\r\n\r\n<li>Confusing Date.today() with Datetime.now().<\/li>\r\n<\/ul>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">Best Practices for Answering Apex Methods Interview Questions<\/h2>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li>Name the exact method and give a one-line example.<\/li>\r\n\r\n<li>Mention null safety when you use String methods.<\/li>\r\n\r\n<li>Use describe calls instead of hard-coded Ids.<\/li>\r\n\r\n<li>Show Limits methods when you talk about debugging.<\/li>\r\n\r\n<li>Practise these methods in Anonymous Apex before the interview.<\/li>\r\n<\/ul>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">Official Resources<\/h2>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li><a href=\"https:\/\/developer.salesforce.com\/docs\/platform\/apex-ref\/references\/apex-ref\/apex-methods-system-string.html\" target=\"_blank\" rel=\"noopener noreferrer\">String Class (Apex Reference Guide)<\/a><\/li>\r\n\r\n<li><a href=\"https:\/\/developer.salesforce.com\/docs\/platform\/apex-ref\/references\/apex-ref\/apex-methods-system-date.html\" target=\"_blank\" rel=\"noopener noreferrer\">Date Class (Apex Reference Guide)<\/a><\/li>\r\n<\/ul>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">Quick Recap<\/h2>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li>Apex Methods Interview Questions cover String, Date, Math and Schema.<\/li>\r\n\r\n<li>Use isBlank for empty checks and setScale for money.<\/li>\r\n\r\n<li>Date has no time zone, while Datetime is stored in GMT.<\/li>\r\n\r\n<li>Schema describe calls replace hard-coded Ids.<\/li>\r\n\r\n<li>Limits methods help debug governor limit issues.<\/li>\r\n<\/ul>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">What&#8217;s Next?<\/h2>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Next in the series, move to querying data with our <a href=\"https:\/\/swapnilzambare.com\/blog\/soql-interview-questions-basics-filters\/\">SOQL interview questions<\/a>.<\/p>\r\n","protected":false},"excerpt":{"rendered":"<p>Apex Methods Interview Questions check whether you know the built-in methods that save you from writing code by hand, such as String, Date, Math,&hellip;<\/p>\n","protected":false},"author":1,"featured_media":1861,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_swapz_level":"","_swapz_series_part":0,"_swapz_hide_toc":false,"_swapz_hide_featured":false,"_swapz_description":"","footnotes":""},"categories":[250,8,90],"tags":[98,26,91],"swapz_series":[],"class_list":["post-1820","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-developer-interview-questions","category-salesforce","category-salesforce-interview","tag-apex","tag-intermediate","tag-interview-questions"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Apex Methods Interview Questions: String and Date<\/title>\n<meta name=\"description\" content=\"Apex Methods Interview Questions with answers: String, Date, Datetime, Math, Decimal, Schema describe, sObject, UserInfo and Limits methods with examples.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/swapnilzambare.com\/blog\/apex-methods-interview-questions-string-date\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Apex Methods Interview Questions: String and Date\" \/>\n<meta property=\"og:description\" content=\"Apex Methods Interview Questions with answers: String, Date, Datetime, Math, Decimal, Schema describe, sObject, UserInfo and Limits methods with examples.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/swapnilzambare.com\/blog\/apex-methods-interview-questions-string-date\/\" \/>\n<meta property=\"og:site_name\" content=\"Swapnil Zambare - Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-11T03:30:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-11-21T19:10:01+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-methods-interview-questions-string-date-featured-v2.png\" \/>\n\t<meta property=\"og:image:width\" content=\"2400\" \/>\n\t<meta property=\"og:image:height\" content=\"1260\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Swapnil Zambare\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Swapnil Zambare\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"19 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/apex-methods-interview-questions-string-date\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/apex-methods-interview-questions-string-date\\\/\"},\"author\":{\"name\":\"Swapnil Zambare\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#\\\/schema\\\/person\\\/10b09224c8bcc562716e86789427592a\"},\"headline\":\"Apex Methods Interview Questions: String, Date, Math and Schema (60+ Q&amp;A)\",\"datePublished\":\"2026-10-11T03:30:00+00:00\",\"dateModified\":\"2026-11-21T19:10:01+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/apex-methods-interview-questions-string-date\\\/\"},\"wordCount\":3841,\"publisher\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/apex-methods-interview-questions-string-date\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/apex-methods-interview-questions-string-date-featured-v2.png\",\"keywords\":[\"Apex\",\"Intermediate\",\"Interview Questions\"],\"articleSection\":[\"Developer Interview Questions\",\"Salesforce\",\"Salesforce Interview\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/apex-methods-interview-questions-string-date\\\/\",\"url\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/apex-methods-interview-questions-string-date\\\/\",\"name\":\"Apex Methods Interview Questions: String and Date\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/apex-methods-interview-questions-string-date\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/apex-methods-interview-questions-string-date\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/apex-methods-interview-questions-string-date-featured-v2.png\",\"datePublished\":\"2026-10-11T03:30:00+00:00\",\"dateModified\":\"2026-11-21T19:10:01+00:00\",\"description\":\"Apex Methods Interview Questions with answers: String, Date, Datetime, Math, Decimal, Schema describe, sObject, UserInfo and Limits methods with examples.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/apex-methods-interview-questions-string-date\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/apex-methods-interview-questions-string-date\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/apex-methods-interview-questions-string-date\\\/#primaryimage\",\"url\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/apex-methods-interview-questions-string-date-featured-v2.png\",\"contentUrl\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/apex-methods-interview-questions-string-date-featured-v2.png\",\"width\":2400,\"height\":1260,\"caption\":\"Apex Methods Interview Questions featured image: title card with a sample interview question and answer\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/apex-methods-interview-questions-string-date\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Apex Methods Interview Questions: String, Date, Math and Schema (60+ Q&amp;A)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/\",\"name\":\"Swapnil Zambare - Blog\",\"description\":\"Salesforce &amp; Tech Guides\",\"publisher\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#organization\",\"name\":\"Swapnil Zambare - Blog\",\"url\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/site-icon-512.png\",\"contentUrl\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/site-icon-512.png\",\"width\":512,\"height\":512,\"caption\":\"Swapnil Zambare - Blog\"},\"image\":{\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/in\\\/theSwapnilZambare\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/#\\\/schema\\\/person\\\/10b09224c8bcc562716e86789427592a\",\"name\":\"Swapnil Zambare\",\"sameAs\":[\"https:\\\/\\\/swapnilzambare.com\\\/blog\"],\"url\":\"https:\\\/\\\/swapnilzambare.com\\\/blog\\\/author\\\/swapnil-zambare\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Apex Methods Interview Questions: String and Date","description":"Apex Methods Interview Questions with answers: String, Date, Datetime, Math, Decimal, Schema describe, sObject, UserInfo and Limits methods with examples.","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:\/\/swapnilzambare.com\/blog\/apex-methods-interview-questions-string-date\/","og_locale":"en_US","og_type":"article","og_title":"Apex Methods Interview Questions: String and Date","og_description":"Apex Methods Interview Questions with answers: String, Date, Datetime, Math, Decimal, Schema describe, sObject, UserInfo and Limits methods with examples.","og_url":"https:\/\/swapnilzambare.com\/blog\/apex-methods-interview-questions-string-date\/","og_site_name":"Swapnil Zambare - Blog","article_published_time":"2026-10-11T03:30:00+00:00","article_modified_time":"2026-11-21T19:10:01+00:00","og_image":[{"width":2400,"height":1260,"url":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-methods-interview-questions-string-date-featured-v2.png","type":"image\/png"}],"author":"Swapnil Zambare","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Swapnil Zambare","Est. reading time":"19 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/swapnilzambare.com\/blog\/apex-methods-interview-questions-string-date\/#article","isPartOf":{"@id":"https:\/\/swapnilzambare.com\/blog\/apex-methods-interview-questions-string-date\/"},"author":{"name":"Swapnil Zambare","@id":"https:\/\/swapnilzambare.com\/blog\/#\/schema\/person\/10b09224c8bcc562716e86789427592a"},"headline":"Apex Methods Interview Questions: String, Date, Math and Schema (60+ Q&amp;A)","datePublished":"2026-10-11T03:30:00+00:00","dateModified":"2026-11-21T19:10:01+00:00","mainEntityOfPage":{"@id":"https:\/\/swapnilzambare.com\/blog\/apex-methods-interview-questions-string-date\/"},"wordCount":3841,"publisher":{"@id":"https:\/\/swapnilzambare.com\/blog\/#organization"},"image":{"@id":"https:\/\/swapnilzambare.com\/blog\/apex-methods-interview-questions-string-date\/#primaryimage"},"thumbnailUrl":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-methods-interview-questions-string-date-featured-v2.png","keywords":["Apex","Intermediate","Interview Questions"],"articleSection":["Developer Interview Questions","Salesforce","Salesforce Interview"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/swapnilzambare.com\/blog\/apex-methods-interview-questions-string-date\/","url":"https:\/\/swapnilzambare.com\/blog\/apex-methods-interview-questions-string-date\/","name":"Apex Methods Interview Questions: String and Date","isPartOf":{"@id":"https:\/\/swapnilzambare.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/swapnilzambare.com\/blog\/apex-methods-interview-questions-string-date\/#primaryimage"},"image":{"@id":"https:\/\/swapnilzambare.com\/blog\/apex-methods-interview-questions-string-date\/#primaryimage"},"thumbnailUrl":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-methods-interview-questions-string-date-featured-v2.png","datePublished":"2026-10-11T03:30:00+00:00","dateModified":"2026-11-21T19:10:01+00:00","description":"Apex Methods Interview Questions with answers: String, Date, Datetime, Math, Decimal, Schema describe, sObject, UserInfo and Limits methods with examples.","breadcrumb":{"@id":"https:\/\/swapnilzambare.com\/blog\/apex-methods-interview-questions-string-date\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/swapnilzambare.com\/blog\/apex-methods-interview-questions-string-date\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/swapnilzambare.com\/blog\/apex-methods-interview-questions-string-date\/#primaryimage","url":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-methods-interview-questions-string-date-featured-v2.png","contentUrl":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/11\/apex-methods-interview-questions-string-date-featured-v2.png","width":2400,"height":1260,"caption":"Apex Methods Interview Questions featured image: title card with a sample interview question and answer"},{"@type":"BreadcrumbList","@id":"https:\/\/swapnilzambare.com\/blog\/apex-methods-interview-questions-string-date\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/swapnilzambare.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Apex Methods Interview Questions: String, Date, Math and Schema (60+ Q&amp;A)"}]},{"@type":"WebSite","@id":"https:\/\/swapnilzambare.com\/blog\/#website","url":"https:\/\/swapnilzambare.com\/blog\/","name":"Swapnil Zambare - Blog","description":"Salesforce &amp; Tech Guides","publisher":{"@id":"https:\/\/swapnilzambare.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/swapnilzambare.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/swapnilzambare.com\/blog\/#organization","name":"Swapnil Zambare - Blog","url":"https:\/\/swapnilzambare.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/swapnilzambare.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/09\/site-icon-512.png","contentUrl":"https:\/\/swapnilzambare.com\/blog\/wp-content\/uploads\/2026\/09\/site-icon-512.png","width":512,"height":512,"caption":"Swapnil Zambare - Blog"},"image":{"@id":"https:\/\/swapnilzambare.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.linkedin.com\/in\/theSwapnilZambare"]},{"@type":"Person","@id":"https:\/\/swapnilzambare.com\/blog\/#\/schema\/person\/10b09224c8bcc562716e86789427592a","name":"Swapnil Zambare","sameAs":["https:\/\/swapnilzambare.com\/blog"],"url":"https:\/\/swapnilzambare.com\/blog\/author\/swapnil-zambare\/"}]}},"_links":{"self":[{"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/posts\/1820","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/comments?post=1820"}],"version-history":[{"count":2,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/posts\/1820\/revisions"}],"predecessor-version":[{"id":3507,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/posts\/1820\/revisions\/3507"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/media\/1861"}],"wp:attachment":[{"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/media?parent=1820"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/categories?post=1820"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/tags?post=1820"},{"taxonomy":"swapz_series","embeddable":true,"href":"https:\/\/swapnilzambare.com\/blog\/wp-json\/wp\/v2\/swapz_series?post=1820"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}